Annotation of embedaddon/php/tests/func/002.phpt, revision 1.1
1.1 ! misho 1: --TEST--
! 2: Static variables in functions
! 3: --FILE--
! 4: <?php
! 5: function blah()
! 6: {
! 7: static $hey=0,$yo=0;
! 8:
! 9: echo "hey=".$hey++.", ",$yo--."\n";
! 10: }
! 11:
! 12: blah();
! 13: blah();
! 14: blah();
! 15: if (isset($hey) || isset($yo)) {
! 16: echo "Local variables became global :(\n";
! 17: }
! 18: --EXPECT--
! 19: hey=0, 0
! 20: hey=1, -1
! 21: hey=2, -2
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>