# indirect references to static function variables

- Thread: https://externals.io/message/7610
- Original archive: https://news-web.php.net/php.internals/7610
- Started by Jan Lehnardt on 2004-02-05T10:16:20+00:00
- Messages: 1
- Reply by email to internals@lists.php.net
- More for agents: search with https://externals.io/search.md?q={query} · JSON API at https://externals.io/api · documentation at https://externals.io/llms.txt

---

## #7610 — Jan Lehnardt — 2004-02-05T10:16:20+00:00

URL: https://externals.io/message/7610#7610

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
