0

PHP 7 : how to Unset all variables

previously I was using the following script in PHP 5.5.9 to unset all variables, which was working very well

but now when i used same code in PHP 7 , this is giving  following messages:

after reading php 7 documentations and some research on internet i found that i have to use foreach instead of for 

The order of evaluation of $$vars[$i] is different in PHP 7. It’s now strictly left to right.

Previously it would have first evaluated $vars[$i] and then formed a new variable from the result of that with $.

Now it first evaluates $$vars and then tries to find [$i] in the result of that.

Leave a Reply

Your email address will not be published. Required fields are marked *