indirect references to static function variables
| From: | Jan Lehnardt | Date: | Thu, 05 Feb 2004 10:16:20 +0000 |
| Subject: | indirect references to static function variables | ||
| Groups: | php.internals | ||
| Request: | Send a blank email to internals+get-7610@lists.php.net to get a copy of this message | ||
Hi again,
the ZEND_CHANGES file states:
[...]
* Static function variables.
Statics are now treated at compile-time which allows developers
to assign variables to statics by reference. This change also
greatly improves their performance but means that indirect
references to statics will not work anymore.
[..]
The only thing close to "indirect references" I could come up
with, was this:
<?php
function foo()
{
static $a = 0;
$a_name = "a";
echo $$a_name;
echo $a;
$a++;
}
foo();
foo();
?>
Which works as expected in both PHP 4 and 5.
So what exactly doesn't work anymore? Or what is meant by
"indirect references"?
Best regards,
Jan
--