diff options
Diffstat (limited to 'tests/func/002.phpt')
-rw-r--r-- | tests/func/002.phpt | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/func/002.phpt b/tests/func/002.phpt new file mode 100644 index 0000000..cb35f92 --- /dev/null +++ b/tests/func/002.phpt @@ -0,0 +1,21 @@ +--TEST-- +Static variables in functions +--FILE-- +<?php +function blah() +{ + static $hey=0,$yo=0; + + echo "hey=".$hey++.", ",$yo--."\n"; +} + +blah(); +blah(); +blah(); +if (isset($hey) || isset($yo)) { + echo "Local variables became global :(\n"; +} +--EXPECT-- +hey=0, 0 +hey=1, -1 +hey=2, -2 |