Only if you assigned the value by reference. This behavior is mentioned in PHP's documentation for foreach loops https://www.php.net/manual/en/control-s ... oreach.php:
Reference of a $value and the last array element remain even after the foreach loop. It is recommended to destroy it by unset().
Statistics: Posted by SharkyKZ — Fri Jan 19, 2024 1:11 pm