Re: I this a bug in PHP 7.1.9?
| From: | Jefferson Gonzalez | Date: | Mon, 04 Sep 2017 04:41:50 +0000 |
| Subject: | Re: I this a bug in PHP 7.1.9? | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-100361@lists.php.net to get a copy of this message | ||
On 09/03/2017 05:48 PM, David Rodrigues wrote:
From doc: http://php.net/manual/en/language.variables.scope.phpstatic $var = array(); if(empty($var)) {Note: Static variables may be declared as seen in the examples above.From PHP 5.6 you can assign values to these variables which are the result of expressions, but you can't use any function here, what will cause a parse error. Ahh, thanks a lot, I missed that one... I guess this change is to optimize the performance of PHP somehow. Now I will have to make a search on my code base to see where I'm using more functions that use static variables to store the return value of a function (to speed stuff up) and change it on a way that is compatible...
$var = function_output();}