Return to 002.phpt CVS log | Up to [ELWIX - Embedded LightWeight unIX -] / embedaddon / php / tests / func |
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