diff options
| author | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
|---|---|---|
| committer | Ondřej Surý <ondrej@sury.org> | 2010-01-07 13:31:53 +0100 |
| commit | 0fab6db7cac8d2be99579dd049f812a8ff98e74f (patch) | |
| tree | 91f01b0d06916c78262404096bfd466b8e95e5b5 /Zend/tests | |
| parent | d3a8757891280dc6650ca7eead67830c794b0e7b (diff) | |
| download | php-0fab6db7cac8d2be99579dd049f812a8ff98e74f.tar.gz | |
Imported Upstream version 5.3.1upstream/5.3.1
Diffstat (limited to 'Zend/tests')
35 files changed, 528 insertions, 120 deletions
diff --git a/Zend/tests/019.phpt b/Zend/tests/019.phpt index 47158771e..70093cd28 100644 --- a/Zend/tests/019.phpt +++ b/Zend/tests/019.phpt @@ -359,7 +359,8 @@ var_dump($global_var); //Note: No error conditions relating to passing arugments can be tested // because these are not functions but statements, it will result in syntax error. -echo "Done\n"; +?> +===DONE=== --EXPECTF-- *** Testing unset(), empty() & isset() with scalar variables *** -- Iteration 1 -- @@ -1185,11 +1186,11 @@ bool(true) *** Testing unset(), emtpy() & isset() with resource variables *** -- Iteration 1 -- -resource(5) of type (stream) +resource(%d) of type (stream) bool(true) bool(false) bool(true) -resource(5) of type (stream) +resource(%d) of type (stream) bool(false) bool(true) bool(false) @@ -1198,11 +1199,11 @@ bool(false) Notice: Undefined variable: resource in %s on line %d NULL -- Iteration 2 -- -resource(6) of type (stream) +resource(%d) of type (stream) bool(true) bool(false) bool(true) -resource(6) of type (stream) +resource(%d) of type (stream) bool(false) bool(true) bool(false) @@ -1217,7 +1218,7 @@ bool(false) bool(true) *** Testing unset(), empty() & isset() with objects *** -object(Point)#1 (3) { +object(Point)#%d (3) { ["x"]=> int(30) ["y"]=> @@ -1239,7 +1240,7 @@ bool(false) Notice: Undefined variable: lable in %s on line %d bool(true) -object(Point)#1 (3) { +object(Point)#%d (3) { ["x"]=> int(30) ["y"]=> @@ -1247,7 +1248,7 @@ object(Point)#1 (3) { ["lable"]=> string(6) "Point1" } -object(Point)#1 (2) { +object(Point)#%d (2) { ["y"]=> int(40) ["lable"]=> @@ -1255,7 +1256,7 @@ object(Point)#1 (2) { } bool(false) bool(true) -object(Point)#1 (0) { +object(Point)#%d (0) { } bool(true) bool(false) @@ -1276,7 +1277,7 @@ array(3) { [2]=> string(9) "testPoint" } -object(Point)#1 (3) { +object(Point)#%d (3) { ["x"]=> int(5) ["y"]=> @@ -1329,4 +1330,4 @@ bool(false) bool(false) bool(true) int(10) -Done +===DONE=== diff --git a/Zend/tests/024.phpt b/Zend/tests/024.phpt index 6fe10201f..ff35a5c89 100644 --- a/Zend/tests/024.phpt +++ b/Zend/tests/024.phpt @@ -18,17 +18,17 @@ var_dump($a->$b->$c[1]); Notice: Undefined variable: a in %s on line %d NULL -Notice: Undefined variable: c in %s on line %d +Notice: Undefined variable: %s in %s on line %d -Notice: Undefined variable: a in %s on line %d +Notice: Undefined variable: %s in %s on line %d NULL Notice: Undefined variable: a in %s on line %d int(1) -Notice: Undefined variable: b in %s on line %d +Notice: Undefined variable: %s in %s on line %d -Notice: Undefined variable: a in %s on line %d +Notice: Undefined variable: %s in %s on line %d int(0) Notice: Undefined variable: a in %s on line %d diff --git a/Zend/tests/bug30162.phpt b/Zend/tests/bug30162.phpt index ae11f8ff8..a011292a1 100755 --- a/Zend/tests/bug30162.phpt +++ b/Zend/tests/bug30162.phpt @@ -41,12 +41,14 @@ $db = new hariCow; var_dump($db); ?> +===DONE=== --EXPECTF-- Notice: Undefined variable: db in %sbug30162.php on line 35 NULL -object(hariCow)#1 (2) { +object(hariCow)#%d (2) { ["x"]=> string(1) "x" ["y"]=> string(1) "y" } +===DONE===
\ No newline at end of file diff --git a/Zend/tests/bug39542/bug39542.php b/Zend/tests/bug39542/bug39542.php index 110951766..90cb36cc6 100755 --- a/Zend/tests/bug39542/bug39542.php +++ b/Zend/tests/bug39542/bug39542.php @@ -1,7 +1,7 @@ -<?php
-class bug39542 {
- function bug39542() {
- echo "ok\n";
- }
-}
-?>
+<?php +class bug39542 { + function bug39542() { + echo "ok\n"; + } +} +?> diff --git a/Zend/tests/bug40236.inc b/Zend/tests/bug40236.inc index 0fbbfc9ff..fc03349f7 100755 --- a/Zend/tests/bug40236.inc +++ b/Zend/tests/bug40236.inc @@ -1,10 +1,10 @@ -<?php
-function func1() { }
-function func2() { }
-function func3() { }
-function func4() { }
-function func5() { }
-function func6() { }
-function func7() { }
-print ("ok\n");
+<?php +function func1() { } +function func2() { } +function func3() { } +function func4() { } +function func5() { } +function func6() { } +function func7() { } +print ("ok\n"); ?>
\ No newline at end of file diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt index 9afb0ef46..f18c25a6c 100644 --- a/Zend/tests/bug46106.phpt +++ b/Zend/tests/bug46106.phpt @@ -1,22 +1,22 @@ ---TEST--
-Bug #46106 (Memory leaks when using global statement)
---FILE--
-<?php
-$foo = array(1);
-
-function foobar($errno, $errstr, $errfile, $errline) { }
-
-set_error_handler('foobar');
-
-function test($x) {
- global $foo;
-
- $x->invokeArgs(array(0));
-}
-
-$x = new ReflectionFunction('str_pad');
-test($x);
-?>
-DONE
---EXPECT--
-DONE
+--TEST-- +Bug #46106 (Memory leaks when using global statement) +--FILE-- +<?php +$foo = array(1); + +function foobar($errno, $errstr, $errfile, $errline) { } + +set_error_handler('foobar'); + +function test($x) { + global $foo; + + $x->invokeArgs(array(0)); +} + +$x = new ReflectionFunction('str_pad'); +test($x); +?> +DONE +--EXPECT-- +DONE diff --git a/Zend/tests/bug47109.phpt b/Zend/tests/bug47109.phpt index b374202be..8f810d7fb 100644 --- a/Zend/tests/bug47109.phpt +++ b/Zend/tests/bug47109.phpt @@ -1,11 +1,11 @@ ---TEST--
-Bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object)
---FILE--
-<?php
-$a->{"a"."b"};
-?>
---EXPECTF--
-Notice: Undefined variable: a in %sbug47109.php on line 2
-
-Notice: Trying to get property of non-object in %sbug47109.php on line 2
-
+--TEST-- +Bug #47109 (Memory leak on $a->{"a"."b"} when $a is not an object) +--FILE-- +<?php +$a->{"a"."b"}; +?> +--EXPECTF-- +Notice: Undefined variable: a in %sbug47109.php on line 2 + +Notice: Trying to get property of non-object in %sbug47109.php on line 2 + diff --git a/Zend/tests/bug48693.phpt b/Zend/tests/bug48693.phpt new file mode 100644 index 000000000..e57434602 --- /dev/null +++ b/Zend/tests/bug48693.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #48693 (Double declaration of __lambda_func when lambda wrongly formatted) +--FILE-- +<?php + +$x = create_function('', 'return 1; }'); +$y = create_function('', 'function a() { }; return 2;'); +$z = create_function('', '{'); +$w = create_function('', 'return 3;'); + +var_dump( + $x, + $y(), + $z, + $w(), + $y != $z +); + +?> +--EXPECTF-- +Parse error: syntax error, unexpected '}' in %s(%d) : runtime-created function on line 1 + +Parse error: syntax error, unexpected $end in %s(%d) : runtime-created function on line 1 +bool(false) +int(2) +bool(false) +int(3) +bool(true) diff --git a/Zend/tests/bug48770.phpt b/Zend/tests/bug48770.phpt new file mode 100644 index 000000000..40fa84157 --- /dev/null +++ b/Zend/tests/bug48770.phpt @@ -0,0 +1,53 @@ +--TEST-- +Bug #48770 (call_user_func_array() fails to call parent from inheriting class) +--XFAIL-- +See Bug #48770 +--FILE-- +<?php + +class A { + public function func($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func22($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class B extends A { + public function func($str) { + static $avoid_crash = 0; + + if ($avoid_crash++ == 1) { + print "This method shouldn't be called when using parent::func!\n"; + return; + } + + call_user_func_array(array($this, 'parent::func'), array($str)); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class C extends B { + public function func($str) { + parent::func($str); + } +} + +$c = new C; +$c->func('This should work!'); + +?> +--EXPECTF-- +%unicode|string%(26) "A::func: This should work!" diff --git a/Zend/tests/bug48770_2.phpt b/Zend/tests/bug48770_2.phpt new file mode 100644 index 000000000..dff54e155 --- /dev/null +++ b/Zend/tests/bug48770_2.phpt @@ -0,0 +1,54 @@ +--TEST-- +Bug #48770 (call_user_func_array() fails to call parent from inheriting class) +--XFAIL-- +See Bug #48770 +--FILE-- +<?php + +class A { + public function func($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func22($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class B extends A { + public function func($str) { + call_user_func_array(array($this, 'parent::func2'), array($str)); + call_user_func_array(array($this, 'parent::func3'), array($str)); + call_user_func_array(array($this, 'parent::func22'), array($str)); + call_user_func_array(array($this, 'parent::inexistent'), array($str)); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class C extends B { + public function func($str) { + parent::func($str); + } +} + +$c = new C; +$c->func('This should work!'); + +?> +--EXPECTF-- +%unicode|string%(27) "A::func2: This should work!" +%unicode|string%(27) "A::func3: This should work!" + +Warning: call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() in %s on line %d + +Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' in %s on line %d diff --git a/Zend/tests/bug48770_3.phpt b/Zend/tests/bug48770_3.phpt new file mode 100644 index 000000000..68fe84314 --- /dev/null +++ b/Zend/tests/bug48770_3.phpt @@ -0,0 +1,51 @@ +--TEST-- +Bug #48770 (call_user_func_array() fails to call parent from inheriting class) +--XFAIL-- +See Bug #48770 +--FILE-- +<?php + +class A { + public function func($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } + private function func22($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class B extends A { + public function func($str) { + call_user_func_array(array($this, 'self::func2'), array($str)); + call_user_func_array(array($this, 'self::func3'), array($str)); + call_user_func_array(array($this, 'self::inexistent'), array($str)); + } + private function func2($str) { + var_dump(__METHOD__ .': '. $str); + } + protected function func3($str) { + var_dump(__METHOD__ .': '. $str); + } +} + +class C extends B { + public function func($str) { + parent::func($str); + } +} + +$c = new C; +$c->func('This should work!'); + +?> +--EXPECTF-- +%unicode|string%(27) "B::func2: This should work!" +%unicode|string%(27) "B::func3: This should work!" + +Warning: call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' in %s on line %d diff --git a/Zend/tests/bug48899.phpt b/Zend/tests/bug48899.phpt new file mode 100644 index 000000000..ff640543c --- /dev/null +++ b/Zend/tests/bug48899.phpt @@ -0,0 +1,24 @@ +--TEST-- +Bug #48899 (is_callable returns true even if method does not exist in parent class) +--FILE-- +<?php + +class ParentClass { } + +class ChildClass extends ParentClass { + public function testIsCallable() { + var_dump(is_callable(array($this, 'parent::testIsCallable'))); + } + public function testIsCallable2() { + var_dump(is_callable(array($this, 'static::testIsCallable2'))); + } +} + +$child = new ChildClass(); +$child->testIsCallable(); +$child->testIsCallable2(); + +?> +--EXPECT-- +bool(false) +bool(true) diff --git a/Zend/tests/bug48912.phpt b/Zend/tests/bug48912.phpt new file mode 100644 index 000000000..dc021a2ef --- /dev/null +++ b/Zend/tests/bug48912.phpt @@ -0,0 +1,16 @@ +--TEST-- +Bug #48912 (Namespace causes unexpected strict behaviour with extract()) +--FILE-- +<?php +namespace A; + +function test() +{ + extract(func_get_arg(0)); +} + +test(array('x' => 1)); +echo "ok\n"; +?> +--EXPECT-- +ok diff --git a/Zend/tests/bug49269.phpt b/Zend/tests/bug49269.phpt new file mode 100644 index 000000000..2de29d8b9 --- /dev/null +++ b/Zend/tests/bug49269.phpt @@ -0,0 +1,26 @@ +--TEST-- +Bug #49269 (Ternary operator fails on Iterator object when used inside foreach declaration). +--FILE-- +<?php +class TestObject implements Iterator +{ + public $n = 0; + function valid() + { + return ($this->n < 3); + } + function current() {return $this->n;} + function next() {$this->n++;} + function key() { } + function rewind() {$this->n = 0;} +} + + +$array_object = new TestObject(); + +foreach ((true ? $array_object : $array_object) as $item) echo "$item\n"; +?> +--EXPECT-- +0 +1 +2 diff --git a/Zend/tests/bug49908.phpt b/Zend/tests/bug49908.phpt new file mode 100644 index 000000000..08d6383d8 --- /dev/null +++ b/Zend/tests/bug49908.phpt @@ -0,0 +1,28 @@ +--TEST-- +Bug #49908 (throwing exception in __autoload crashes when interface is not defined) +--FILE-- +<?php + +function __autoload($className) { + var_dump($className); + + if ($className == 'Foo') { + class Foo implements Bar {}; + } else { + throw new Exception($className); + } +} + +new Foo; + +?> +--EXPECTF-- +%unicode|string%(3) "Foo" +%unicode|string%(3) "Bar" + +Fatal error: Uncaught exception 'Exception' with message 'Bar' in %s:%d +Stack trace: +#0 %s(7): __autoload('Bar') +#1 %s(13): __autoload('Foo') +#2 {main} + thrown in %s on line %d diff --git a/Zend/tests/call_user_func_001.phpt b/Zend/tests/call_user_func_001.phpt new file mode 100644 index 000000000..e9b35f957 --- /dev/null +++ b/Zend/tests/call_user_func_001.phpt @@ -0,0 +1,35 @@ +--TEST-- +Testing call_user_func inside namespace +--FILE-- +<?php + +namespace testing { + function foobar($str) { + var_dump($str); + } + + abstract class bar { + protected function prot($str) { + print "Shouldn't be called!\n"; + } + } + class foo extends bar { + private function priv($str) { + print "Shouldn't be called!\n"; + } + } + + call_user_func(__NAMESPACE__ .'\foobar', 'foobar'); + + $class = __NAMESPACE__ .'\foo'; + call_user_func(array(new $class, 'priv'), 'foobar'); + call_user_func(array(new $class, 'prot'), 'foobar'); +} + +?> +--EXPECTF-- +%string|unicode%(6) "foobar" + +Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access private method testing\foo::priv() in %s on line %d + +Warning: call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() in %s on line %d diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt new file mode 100644 index 000000000..e79dd1a75 --- /dev/null +++ b/Zend/tests/call_user_func_002.phpt @@ -0,0 +1,29 @@ +--TEST-- +Testing call_user_func() with autoload and passing invalid params +--FILE-- +<?php + +function __autoload($class) { + var_dump($class); +} + +call_user_func(array('foo', 'bar')); +call_user_func(array('', 'bar')); +call_user_func(array($foo, 'bar')); +call_user_func(array($foo, '')); + +?> +--EXPECTF-- +%unicode|string%(3) "foo" + +Warning: call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found in %s on line %d + +Warning: call_user_func() expects parameter 1 to be a valid callback, class '' not found in %s on line %d + +Notice: Undefined variable: foo in %s on line %d + +Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d + +Notice: Undefined variable: foo in %s on line %d + +Warning: call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in %s on line %d diff --git a/Zend/tests/call_user_func_003.phpt b/Zend/tests/call_user_func_003.phpt new file mode 100644 index 000000000..d516584eb --- /dev/null +++ b/Zend/tests/call_user_func_003.phpt @@ -0,0 +1,31 @@ +--TEST-- +Testing call_user_func() with closures +--FILE-- +<?php + +$foo = function() { + static $instance; + + if (is_null($instance)) { + $instance = function () { + return 'OK!'; + }; + } + + return $instance; +}; + +var_dump(call_user_func(array($foo, '__invoke'))->__invoke()); +var_dump(call_user_func(function() use (&$foo) { return $foo; }, '__invoke')); + +?> +--EXPECTF-- +%unicode|string%(3) "OK!" +object(Closure)#%d (1) { + [%u|b%"static"]=> + array(1) { + [%u|b%"instance"]=> + object(Closure)#%d (0) { + } + } +} diff --git a/Zend/tests/closure_034.phpt b/Zend/tests/closure_034.phpt new file mode 100644 index 000000000..d1356c31d --- /dev/null +++ b/Zend/tests/closure_034.phpt @@ -0,0 +1,25 @@ +--TEST-- +Closure 033: Recursive var_dump on closures +--FILE-- +<?php + +$a = function () use(&$a) {}; +var_dump($a); + +?> +===DONE=== +--EXPECTF-- +object(Closure)#1 (1) { + ["static"]=> + array(1) { + ["a"]=> + &object(Closure)#1 (1) { + ["static"]=> + array(1) { + ["a"]=> + *RECURSION* + } + } + } +} +===DONE=== diff --git a/Zend/tests/constants_002.phpt b/Zend/tests/constants_002.phpt index 2e769f5db..5acca981f 100644 --- a/Zend/tests/constants_002.phpt +++ b/Zend/tests/constants_002.phpt @@ -16,9 +16,3 @@ Warning: Constants may only evaluate to scalar values in %s on line %d Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d string(%d) "foo" resource(%d) of type (stream) ---UEXPECTF-- -Warning: Constants may only evaluate to scalar values in %s on line %d - -Notice: Use of undefined constant foo - assumed 'foo' in %s on line %d -unicode(%d) "foo" -resource(%d) of type (stream) diff --git a/Zend/tests/each_003.phpt b/Zend/tests/each_003.phpt index 8c0c32a7f..2361d6a31 100644 --- a/Zend/tests/each_003.phpt +++ b/Zend/tests/each_003.phpt @@ -22,16 +22,3 @@ array(4) { ["key"]=> int(0) } ---UEXPECTF-- -array(4) { - [1]=> - array(0) { - } - [u"value"]=> - array(0) { - } - [0]=> - int(0) - [u"key"]=> - int(0) -} diff --git a/Zend/tests/function_exists_error.phpt b/Zend/tests/function_exists_error.phpt index c95dc0718..cbc3908f1 100644 --- a/Zend/tests/function_exists_error.phpt +++ b/Zend/tests/function_exists_error.phpt @@ -1,6 +1,5 @@ --TEST-- Test function_exists() function : error conditions ---INI-- --FILE-- <?php /* diff --git a/Zend/tests/get_parent_class_001.phpt b/Zend/tests/get_parent_class_001.phpt index 5115fe16d..dfef5e08c 100644 --- a/Zend/tests/get_parent_class_001.phpt +++ b/Zend/tests/get_parent_class_001.phpt @@ -26,6 +26,3 @@ $a->foo(); --EXPECT-- string(3) "bar" bool(false) ---UEXPECT-- -unicode(3) "bar" -bool(false) diff --git a/Zend/tests/get_required_files.phpt b/Zend/tests/get_required_files.phpt new file mode 100644 index 000000000..c2ba36888 --- /dev/null +++ b/Zend/tests/get_required_files.phpt @@ -0,0 +1,16 @@ +--TEST-- +Check if get_required_files works +--CREDITS-- +Sebastian Schürmann +sschuermann@chip.de +Testfest 2009 Munich +--FILE-- +<?php +$files = get_required_files(); +var_dump($files); +?> +--EXPECTF-- +array(1) { + [0]=> + %string|unicode%(%d)%s +} diff --git a/Zend/tests/globals_001.phpt b/Zend/tests/globals_001.phpt index 0f77104ac..8efa71d31 100644 --- a/Zend/tests/globals_001.phpt +++ b/Zend/tests/globals_001.phpt @@ -1,6 +1,6 @@ --TEST-- globals in global scope ---INIT-- +--INI-- variables_order="egpcs" --FILE-- <?php diff --git a/Zend/tests/globals_002.phpt b/Zend/tests/globals_002.phpt index 8074eb1db..e5d518ac5 100644 --- a/Zend/tests/globals_002.phpt +++ b/Zend/tests/globals_002.phpt @@ -1,6 +1,6 @@ --TEST-- globals in local scope ---INIT-- +--INI-- variables_order="egpcs" --FILE-- <?php diff --git a/Zend/tests/globals_003.phpt b/Zend/tests/globals_003.phpt index 9ddae33a1..6de7c53e3 100644 --- a/Zend/tests/globals_003.phpt +++ b/Zend/tests/globals_003.phpt @@ -1,6 +1,6 @@ --TEST-- globals in local scope - 2 ---INIT-- +--INI-- variables_order="egpcs" --FILE-- <?php diff --git a/Zend/tests/globals_004.phpt b/Zend/tests/globals_004.phpt index f5da018f7..07dfc7806 100644 --- a/Zend/tests/globals_004.phpt +++ b/Zend/tests/globals_004.phpt @@ -1,6 +1,6 @@ --TEST-- globals in local scope - 3 ---INIT-- +--INI-- variables_order="egpcs" --FILE-- <?php diff --git a/Zend/tests/ns_022.inc b/Zend/tests/ns_022.inc index 749b00fb7..be571fc34 100755 --- a/Zend/tests/ns_022.inc +++ b/Zend/tests/ns_022.inc @@ -1,6 +1,6 @@ -<?php
-class Test {
- static function foo() {
- echo __CLASS__,"::",__FUNCTION__,"\n";
- }
-}
+<?php +class Test { + static function foo() { + echo __CLASS__,"::",__FUNCTION__,"\n"; + } +} diff --git a/Zend/tests/ns_023.phpt b/Zend/tests/ns_023.phpt index bc1681c12..34fbb56f2 100755 --- a/Zend/tests/ns_023.phpt +++ b/Zend/tests/ns_023.phpt @@ -7,5 +7,3 @@ namespace test\foo; var_dump(__NAMESPACE__); --EXPECT-- string(8) "test\foo" ---UEXPECT-- -unicode(8) "test\foo" diff --git a/Zend/tests/ns_024.phpt b/Zend/tests/ns_024.phpt index 6e4f8bb22..019a89c47 100755 --- a/Zend/tests/ns_024.phpt +++ b/Zend/tests/ns_024.phpt @@ -5,5 +5,3 @@ var_dump(__NAMESPACE__); --EXPECT-- string(0) "" ---UEXPECT-- -unicode(0) "" diff --git a/Zend/tests/ns_028.inc b/Zend/tests/ns_028.inc index 0bba489ce..5bd3ae776 100755 --- a/Zend/tests/ns_028.inc +++ b/Zend/tests/ns_028.inc @@ -1,15 +1,15 @@ -<?php
-namespace Foo;
-
-class Foo {
- function __construct() {
- echo "Method - ".__CLASS__."::".__FUNCTION__."\n";
- }
- static function Bar() {
- echo "Method - ".__CLASS__."::".__FUNCTION__."\n";
- }
-}
-
-function Bar() {
- echo "Func - ".__FUNCTION__."\n";
-}
+<?php +namespace Foo; + +class Foo { + function __construct() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } + static function Bar() { + echo "Method - ".__CLASS__."::".__FUNCTION__."\n"; + } +} + +function Bar() { + echo "Func - ".__FUNCTION__."\n"; +} diff --git a/Zend/tests/unexpected_ref_bug.phpt b/Zend/tests/unexpected_ref_bug.phpt new file mode 100755 index 000000000..61fe1aa5b --- /dev/null +++ b/Zend/tests/unexpected_ref_bug.phpt @@ -0,0 +1,18 @@ +--TEST-- +Crash when function parameter modified via unexpected reference +--FILE-- +<?php +function my_errorhandler($errno,$errormsg) { + global $my_var; + $my_var = 0; + return true; +} +set_error_handler("my_errorhandler"); +$my_var = str_repeat("A",64); +$data = call_user_func_array("explode",array(new StdClass(), &$my_var)); +$my_var=array(1,2,3); +$data = call_user_func_array("implode",array(&$my_var, new StdClass())); +echo "Done.\n"; +?> +--EXPECTF-- +Done. diff --git a/Zend/tests/unset_cv07.phpt b/Zend/tests/unset_cv07.phpt index fe16abf75..b7bdb7db5 100644 --- a/Zend/tests/unset_cv07.phpt +++ b/Zend/tests/unset_cv07.phpt @@ -1,7 +1,5 @@ --TEST-- unset() CV 7 (indirect unset() of global variable in import_request_variables()) ---SKIPIF-- -<?php if (php_sapi_name()=='cli') echo 'skip'; ?> --GET-- x=2 --FILE-- diff --git a/Zend/tests/zend_operators.phpt b/Zend/tests/zend_operators.phpt index 99fdf0217..00546b243 100644 --- a/Zend/tests/zend_operators.phpt +++ b/Zend/tests/zend_operators.phpt @@ -1,7 +1,7 @@ --TEST-- Operator precedence --FILE-- -<?php /* $Id: zend_operators.phpt,v 1.1 2004/03/04 10:58:49 derick Exp $ */ +<?php /* $Id: zend_operators.phpt 242949 2007-09-26 15:44:16Z cvs2svn $ */ var_dump((object)1 instanceof stdClass); var_dump(! (object)1 instanceof Exception); |
