summaryrefslogtreecommitdiff
path: root/tests/func/002.phpt
diff options
context:
space:
mode:
authorStig Bakken <ssb@php.net>2000-08-27 19:46:06 +0000
committerStig Bakken <ssb@php.net>2000-08-27 19:46:06 +0000
commit315f4f5658cf22a17ba06fa2ca2f3d890355873f (patch)
tree3dd1134c1d1c3821b48fab806884123f09b2d21f /tests/func/002.phpt
parent7eeda99a055df5a510d3d20526e9adcb42fecdb0 (diff)
downloadphp-git-315f4f5658cf22a17ba06fa2ca2f3d890355873f.tar.gz
@PHP 3 regression testing framework re-born (Stig)
Took the old PHP 3 regression testing framework and rewrote it in PHP. Should work on both Windows and UNIX, however I have not tested it on Windows. See tests/README for how to write tests. Added the PHP 3 tests and converted most of them.
Diffstat (limited to 'tests/func/002.phpt')
-rw-r--r--tests/func/002.phpt22
1 files changed, 22 insertions, 0 deletions
diff --git a/tests/func/002.phpt b/tests/func/002.phpt
new file mode 100644
index 0000000000..aa752ee13c
--- /dev/null
+++ b/tests/func/002.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Static variables in functions
+--POST--
+--GET--
+--FILE--
+<?php
+old_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