diff options
author | Dmitry Stogov <dmitry@php.net> | 2004-10-05 06:53:39 +0000 |
---|---|---|
committer | Dmitry Stogov <dmitry@php.net> | 2004-10-05 06:53:39 +0000 |
commit | 3f35c6a6cc69bc3054fad4a7031ea780baed8945 (patch) | |
tree | a3d2270990dc74485c7695ab821d5a079bcbde89 /Zend/tests | |
parent | 216853c0dbd0fb46f25b2570bb575ff9df003c1c (diff) | |
download | php-git-3f35c6a6cc69bc3054fad4a7031ea780baed8945.tar.gz |
Added test cases for CV optimization patch
Diffstat (limited to 'Zend/tests')
-rw-r--r-- | Zend/tests/unset.inc | 3 | ||||
-rw-r--r-- | Zend/tests/unset_cv01.phpt | 13 | ||||
-rw-r--r-- | Zend/tests/unset_cv02.phpt | 13 | ||||
-rw-r--r-- | Zend/tests/unset_cv03.phpt | 13 | ||||
-rw-r--r-- | Zend/tests/unset_cv04.phpt | 16 | ||||
-rw-r--r-- | Zend/tests/unset_cv05.phpt | 20 | ||||
-rw-r--r-- | Zend/tests/unset_cv06.phpt | 22 | ||||
-rw-r--r-- | Zend/tests/unset_cv07.phpt | 16 | ||||
-rw-r--r-- | Zend/tests/unset_cv08.phpt | 16 | ||||
-rw-r--r-- | Zend/tests/unset_cv09.phpt | 14 | ||||
-rw-r--r-- | Zend/tests/unset_cv10.phpt | 18 |
11 files changed, 164 insertions, 0 deletions
diff --git a/Zend/tests/unset.inc b/Zend/tests/unset.inc new file mode 100644 index 0000000000..12f02dc0af --- /dev/null +++ b/Zend/tests/unset.inc @@ -0,0 +1,3 @@ +<?php +unset($x) +?> diff --git a/Zend/tests/unset_cv01.phpt b/Zend/tests/unset_cv01.phpt new file mode 100644 index 0000000000..99af118d10 --- /dev/null +++ b/Zend/tests/unset_cv01.phpt @@ -0,0 +1,13 @@ +--TEST-- +unset() CV 1 (unset() global variable) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +unset($x); +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv01.php on line %d diff --git a/Zend/tests/unset_cv02.phpt b/Zend/tests/unset_cv02.phpt new file mode 100644 index 0000000000..cb2475350c --- /dev/null +++ b/Zend/tests/unset_cv02.phpt @@ -0,0 +1,13 @@ +--TEST-- +unset() CV 2 (unset() global variable in $GLOBALS) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +unset($GLOBALS["x"]); +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv02.php on line %d diff --git a/Zend/tests/unset_cv03.phpt b/Zend/tests/unset_cv03.phpt new file mode 100644 index 0000000000..221abe2d88 --- /dev/null +++ b/Zend/tests/unset_cv03.phpt @@ -0,0 +1,13 @@ +--TEST-- +unset() CV 3 (unset() global variable in included file) +--FILE-- +<?php +$x = "ok\n"; +echo $x; +include "unset.inc"; +echo $x; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv03.php on line %d diff --git a/Zend/tests/unset_cv04.phpt b/Zend/tests/unset_cv04.phpt new file mode 100644 index 0000000000..5044cb1c8d --- /dev/null +++ b/Zend/tests/unset_cv04.phpt @@ -0,0 +1,16 @@ +--TEST-- +unset() CV 4 (unset() local variable in included file) +--FILE-- +<?php +function f() { + $x = "ok\n"; + echo $x; + include "unset.inc"; + echo $x; +} +f(); +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv04.php on line %d diff --git a/Zend/tests/unset_cv05.phpt b/Zend/tests/unset_cv05.phpt new file mode 100644 index 0000000000..fc8b5c8d60 --- /dev/null +++ b/Zend/tests/unset_cv05.phpt @@ -0,0 +1,20 @@ +--TEST-- +unset() CV 5 (indirect unset() of global variable in session_start()) +--SKIPIF-- +<?php include('../../ext/session/tests/skipif.inc'); ?> +--FILE-- +<?php +$HTTP_SESSION_VARS = "ok\n"; +echo $HTTP_SESSION_VARS; +session_start(); +echo $HTTP_SESSION_VARS; +echo "\nok\n"; +?> +--EXPECTF-- +ok + +Warning: session_start(): Cannot send session cookie - headers already sent by (output started at %sunset_cv05.php on line %d + +Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at %sunset_cv05.php:%d) in %sunset_cv05.php on line %d +Array +ok diff --git a/Zend/tests/unset_cv06.phpt b/Zend/tests/unset_cv06.phpt new file mode 100644 index 0000000000..1d0d5cdd44 --- /dev/null +++ b/Zend/tests/unset_cv06.phpt @@ -0,0 +1,22 @@ +--TEST-- +unset() CV 6 (indirect unset() of global variable in session_unset()) +--SKIPIF-- +<?php include('../../ext/session/tests/skipif.inc'); ?> +--FILE-- +<?php +$x = "1\n"; +session_start(); +echo $x; +session_register('x'); +$_SESSION['x'] = "2\n"; +echo $x; +session_unset(); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +1 +2 + +Notice: Undefined variable: x in %sunset_cv06.php on line %d +ok diff --git a/Zend/tests/unset_cv07.phpt b/Zend/tests/unset_cv07.phpt new file mode 100644 index 0000000000..e828915dab --- /dev/null +++ b/Zend/tests/unset_cv07.phpt @@ -0,0 +1,16 @@ +--TEST-- +unset() CV 7 (indirect unset() of global variable in import_request_variables()) +--GET-- +x=2 +--FILE-- +<?php +$x = "1\n"; +echo $x; +import_request_variables("g"); +echo $x; +echo "\nok\n"; +?> +--EXPECT-- +1 +2 +ok diff --git a/Zend/tests/unset_cv08.phpt b/Zend/tests/unset_cv08.phpt new file mode 100644 index 0000000000..f1b61bf827 --- /dev/null +++ b/Zend/tests/unset_cv08.phpt @@ -0,0 +1,16 @@ +--TEST-- +unset() CV 8 (unset() of global variable in array_unique($GLOBALS)) +--FILE-- +<?php +$a = "ok\n"; +$b = "ok\n"; +array_unique($GLOBALS); +echo $a; +echo $b; +echo "ok\n"; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: b in %sunset_cv08.php on line %d +ok diff --git a/Zend/tests/unset_cv09.phpt b/Zend/tests/unset_cv09.phpt new file mode 100644 index 0000000000..a5407ad64e --- /dev/null +++ b/Zend/tests/unset_cv09.phpt @@ -0,0 +1,14 @@ +--TEST-- +unset() CV 9 (unset() of global variable in array_pop($GLOBALS)) +--FILE-- +<?php +$x = "ok\n"; +echo array_pop($GLOBALS); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv09.php on line %d +ok diff --git a/Zend/tests/unset_cv10.phpt b/Zend/tests/unset_cv10.phpt new file mode 100644 index 0000000000..0eb41922c5 --- /dev/null +++ b/Zend/tests/unset_cv10.phpt @@ -0,0 +1,18 @@ +--TEST-- +unset() CV 10 (unset() of global variable in ArrayObject::offsetUnset($GLOBALS)) +--SKIPIF-- +<?php if (!extension_loaded("spl")) print "skip"; ?> +--FILE-- +<?php +$a = new ArrayObject($GLOBALS); +$x = "ok\n"; +echo $x; +$a->offsetUnset('x'); +echo $x; +echo "ok\n"; +?> +--EXPECTF-- +ok + +Notice: Undefined variable: x in %sunset_cv10.php on line %d +ok |