diff options
author | Xinchen Hui <laruence@php.net> | 2015-04-01 13:06:38 +0800 |
---|---|---|
committer | Xinchen Hui <laruence@php.net> | 2015-04-01 13:06:38 +0800 |
commit | fd0baec2e9afbd6706f16c26d32ec038c192d7e5 (patch) | |
tree | 0ba31b7242cc63451c84fb9fbb1172bffa9314e9 | |
parent | af812eac4c9727bdfb90cac1a35ab53d741cb7eb (diff) | |
parent | ed772e1a998ca72fc1c354fcefc05149ca7a2a56 (diff) | |
download | php-git-fd0baec2e9afbd6706f16c26d32ec038c192d7e5.tar.gz |
Merge branch 'master' of https://git.php.net/repository/php-src
188 files changed, 874 insertions, 384 deletions
diff --git a/Zend/tests/019.phpt b/Zend/tests/019.phpt index 654f86bb11..0548a38f88 100644 --- a/Zend/tests/019.phpt +++ b/Zend/tests/019.phpt @@ -201,7 +201,7 @@ class Point var $y; var $lable; - function Point($x, $y) { + function __construct($x, $y) { $this->x = $x; $this->y = $y; } @@ -1271,7 +1271,7 @@ bool(false) bool(true) array(3) { [0]=> - string(5) "Point" + string(11) "__construct" [1]=> string(8) "setLable" [2]=> diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt index 437ac9113a..ca3b3eb6af 100644 --- a/Zend/tests/add_002.phpt +++ b/Zend/tests/add_002.phpt @@ -8,12 +8,22 @@ $a = array(1,2,3); $o = new stdclass; $o->prop = "value"; +try { + var_dump($a + $o); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a + $o; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Notice: Object of class stdClass could not be converted to int in %sadd_002.php on line %d + +Exception: Unsupported operand types + Notice: Object of class stdClass could not be converted to int in %s on line %d Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt index 4223af3f19..f0c9314b2d 100644 --- a/Zend/tests/add_003.phpt +++ b/Zend/tests/add_003.phpt @@ -8,12 +8,22 @@ $a = array(1,2,3); $o = new stdclass; $o->prop = "value"; +try { + var_dump($o + $a); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $o + $a; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Notice: Object of class stdClass could not be converted to int in %sadd_003.php on line %d + +Exception: Unsupported operand types + Notice: Object of class stdClass could not be converted to int in %s on line %d Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/add_004.phpt b/Zend/tests/add_004.phpt index 492ff31ba3..5629ed2ea4 100644 --- a/Zend/tests/add_004.phpt +++ b/Zend/tests/add_004.phpt @@ -5,10 +5,18 @@ adding numbers to arrays $a = array(1,2,3); +try { + var_dump($a + 5); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a + 5; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/add_007.phpt b/Zend/tests/add_007.phpt index b2f1559b7a..b7d44a8683 100644 --- a/Zend/tests/add_007.phpt +++ b/Zend/tests/add_007.phpt @@ -7,10 +7,18 @@ $a = array(1,2,3); $s1 = "some string"; +try { + var_dump($a + $s1); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a + $s1; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/bug18556.phpt b/Zend/tests/bug18556.phpt index 036abb2ada..f8e48c2772 100644 --- a/Zend/tests/bug18556.phpt +++ b/Zend/tests/bug18556.phpt @@ -8,7 +8,7 @@ setlocale(LC_ALL, $g_lang); class InfoBlob { var $foo; - function InfoBlob() { + function __construct() { $this->foo = "Foo"; } } diff --git a/Zend/tests/bug20240.phpt b/Zend/tests/bug20240.phpt index acf673a277..53bb050576 100644 --- a/Zend/tests/bug20240.phpt +++ b/Zend/tests/bug20240.phpt @@ -9,7 +9,7 @@ class test { public $member; - function test() { + function __construct() { $this->member = 1; register_shutdown_function(array($this, 'destructor')); } diff --git a/Zend/tests/bug30080.phpt b/Zend/tests/bug30080.phpt index 8cac75ab8d..ff4a82b21f 100644 --- a/Zend/tests/bug30080.phpt +++ b/Zend/tests/bug30080.phpt @@ -3,7 +3,7 @@ Bug #30080 (Passing array or non array of objects) --FILE-- <?php class foo { - function foo($arrayobj) { + function __construct($arrayobj) { var_dump($arrayobj); } } diff --git a/Zend/tests/bug31177-2.phpt b/Zend/tests/bug31177-2.phpt index 10083c59ed..6cba62cedf 100644 --- a/Zend/tests/bug31177-2.phpt +++ b/Zend/tests/bug31177-2.phpt @@ -3,13 +3,13 @@ Bug #31177 (memory corruption because of incorrect refcounting) --FILE-- <?php class foo { - function foo($n=0) { + function __construct($n=0) { if($n) throw new Exception("new"); } } $x = new foo(); try { - $y=$x->foo(1); + $y=$x->__construct(1); } catch (Exception $e) { var_dump($x); } diff --git a/Zend/tests/bug32226.phpt b/Zend/tests/bug32226.phpt index 9536c921a3..f8e13cfb6e 100644 --- a/Zend/tests/bug32226.phpt +++ b/Zend/tests/bug32226.phpt @@ -5,7 +5,7 @@ Bug #32226 (SEGV with exception handler on non existing instance) class A { - public function A() + public function __construct() { set_exception_handler(array($this, 'EH')); diff --git a/Zend/tests/bug38942.phpt b/Zend/tests/bug38942.phpt index 85bb56d200..d0335b1071 100644 --- a/Zend/tests/bug38942.phpt +++ b/Zend/tests/bug38942.phpt @@ -10,7 +10,8 @@ class bar extends foo { } print_r(get_class_methods("bar")); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in %s on line %d Array ( [0] => foo diff --git a/Zend/tests/bug39127.phpt b/Zend/tests/bug39127.phpt index a013da145e..2f5b0fd2bf 100644 --- a/Zend/tests/bug39127.phpt +++ b/Zend/tests/bug39127.phpt @@ -14,6 +14,7 @@ var_dump(is_callable(array($b,"__construct"))); echo "Done\n"; ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; a has a deprecated constructor in %s on line %d string(13) "a::a() called" bool(true) bool(false) diff --git a/Zend/tests/bug39542/bug39542.php b/Zend/tests/bug39542/bug39542.php index 90cb36cc68..13b3b3eaf4 100755 --- a/Zend/tests/bug39542/bug39542.php +++ b/Zend/tests/bug39542/bug39542.php @@ -1,6 +1,6 @@ <?php class bug39542 { - function bug39542() { + function __construct() { echo "ok\n"; } } diff --git a/Zend/tests/bug40784.phpt b/Zend/tests/bug40784.phpt index 6da8f2a16b..a103d4a01c 100644 --- a/Zend/tests/bug40784.phpt +++ b/Zend/tests/bug40784.phpt @@ -19,6 +19,7 @@ $b = new B; echo "Done\n"; ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d I'm A I'm A Done diff --git a/Zend/tests/bug43323.phpt b/Zend/tests/bug43323.phpt index d366a6dd1f..74abe766e5 100644 --- a/Zend/tests/bug43323.phpt +++ b/Zend/tests/bug43323.phpt @@ -9,4 +9,6 @@ abstract class bar { class foo extends bar { } --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; bar has a deprecated constructor in %s on line %d + Fatal error: Class foo contains 1 abstract method and must therefore be declared abstract or implement the remaining methods (bar::bar) in %sbug43323.php on line 7 diff --git a/Zend/tests/bug46381.phpt b/Zend/tests/bug46381.phpt index 4d58e9fdf3..6479d0c8a4 100644 --- a/Zend/tests/bug46381.phpt +++ b/Zend/tests/bug46381.phpt @@ -1,17 +1,15 @@ --TEST-- Bug #46381 (wrong $this passed to internal methods causes segfault) ---SKIPIF-- -<?php if (!extension_loaded("spl")) die("skip SPL is no available"); ?> --FILE-- <?php class test { - public function test() { + public function method() { return ArrayIterator::current(); } } $test = new test(); -$test->test(); +$test->method(); echo "Done\n"; ?> diff --git a/Zend/tests/bug47343.phpt b/Zend/tests/bug47343.phpt index 07a3b4e330..b0b7977beb 100644 --- a/Zend/tests/bug47343.phpt +++ b/Zend/tests/bug47343.phpt @@ -20,7 +20,7 @@ class A class B { - public function B($A) + public function __construct($A) { $this->A = $A; } diff --git a/Zend/tests/bug48215_2.phpt b/Zend/tests/bug48215_2.phpt index 199a252208..da6b7a84b6 100644 --- a/Zend/tests/bug48215_2.phpt +++ b/Zend/tests/bug48215_2.phpt @@ -8,7 +8,7 @@ class a { } class b extends a {} class c extends b { - function C() { + function __construct() { b::b(); } } diff --git a/Zend/tests/bug50261.phpt b/Zend/tests/bug50261.phpt index 271a2c4805..ce120b9416 100644 --- a/Zend/tests/bug50261.phpt +++ b/Zend/tests/bug50261.phpt @@ -30,7 +30,8 @@ class testClass2 extends testClass { new testClass2; ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; testClass has a deprecated constructor in %s on line %d testClass::testClass (1) testClass::testClass (2) testClass::testClass (3) diff --git a/Zend/tests/bug52051.phpt b/Zend/tests/bug52051.phpt index e8a4f49e3c..acfddbc36d 100644 --- a/Zend/tests/bug52051.phpt +++ b/Zend/tests/bug52051.phpt @@ -22,6 +22,13 @@ class C extends B { new C(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; AA has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; CC has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; C has a deprecated constructor in %s on line %d foo bar diff --git a/Zend/tests/bug52160.phpt b/Zend/tests/bug52160.phpt index c85d2f09af..a0e5a9d7ae 100644 --- a/Zend/tests/bug52160.phpt +++ b/Zend/tests/bug52160.phpt @@ -29,6 +29,6 @@ class baz { ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class foo in %s on line %d +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; baz has a deprecated constructor in %s on line %d Fatal error: Constructor baz::baz() cannot be static in %s on line %d diff --git a/Zend/tests/bug60536_001.phpt b/Zend/tests/bug60536_001.phpt index a94e21ecee..37a5a6d813 100644 --- a/Zend/tests/bug60536_001.phpt +++ b/Zend/tests/bug60536_001.phpt @@ -8,17 +8,17 @@ class X { } class Y extends X { use T; - function x() { + function __construct() { return ++$this->x; } } class Z extends Y { - function z() { + function __construct() { return ++$this->x; } } $a = new Z(); -$a->x(); +$a->__construct(); echo "DONE"; ?> --EXPECTF-- diff --git a/Zend/tests/bug65108.phpt b/Zend/tests/bug65108.phpt index d3e5a65b26..23e1e856d7 100644 --- a/Zend/tests/bug65108.phpt +++ b/Zend/tests/bug65108.phpt @@ -8,7 +8,7 @@ class C { } class B { - public function B() { + public function __construct() { $isCallable = is_callable(array(new C, 'f')); var_dump($isCallable); } diff --git a/Zend/tests/bug65322.phpt b/Zend/tests/bug65322.phpt index aab163d915..b8b97dd777 100644 --- a/Zend/tests/bug65322.phpt +++ b/Zend/tests/bug65322.phpt @@ -13,10 +13,12 @@ set_error_handler(function($_, $msg, $file) { new B; }); -eval('class A { function a() {} function __construct() {} }'); +/* This is just a particular example of a non-fatal compile-time error + * If this breaks in future, just find another example and use it instead */ +eval('abstract class foo { abstract static function bar(); }'); ?> --EXPECTF-- -string(50) "Redefining already defined constructor for class A" +string(%d) "Static function foo::bar() should not be abstract" string(%d) "%s(%d) : eval()'d code" string(1) "B" diff --git a/Zend/tests/constant_expressions_exceptions.inc b/Zend/tests/constant_expressions_exceptions.inc new file mode 100644 index 0000000000..2b8f3befdb --- /dev/null +++ b/Zend/tests/constant_expressions_exceptions.inc @@ -0,0 +1,2 @@ +<?php +const T = array(1,2) - array(0); diff --git a/Zend/tests/constant_expressions_exceptions_001.phpt b/Zend/tests/constant_expressions_exceptions_001.phpt new file mode 100644 index 0000000000..076584a569 --- /dev/null +++ b/Zend/tests/constant_expressions_exceptions_001.phpt @@ -0,0 +1,7 @@ +--TEST-- +Constant Expressions with unsupported operands 001 +--FILE-- +<?php +const T = array(1,2) - array(0); +--EXPECTF-- +Fatal error: Unsupported operand types in %sconstant_expressions_exceptions_001.php on line 2 diff --git a/Zend/tests/constant_expressions_exceptions_002.phpt b/Zend/tests/constant_expressions_exceptions_002.phpt new file mode 100644 index 0000000000..3259483197 --- /dev/null +++ b/Zend/tests/constant_expressions_exceptions_002.phpt @@ -0,0 +1,13 @@ +--TEST-- +Constant Expressions with unsupported operands 002 +--FILE-- +<?php +try { + require("constant_expressions_exceptions.inc"); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; +} +?> +DONE +--EXPECTF-- +Fatal error: Unsupported operand types in %sconstant_expressions_exceptions.inc on line 2 diff --git a/Zend/tests/div_002.phpt b/Zend/tests/div_002.phpt index 6ade1d9f51..b74743380c 100644 --- a/Zend/tests/div_002.phpt +++ b/Zend/tests/div_002.phpt @@ -6,10 +6,18 @@ dividing arrays $a = array(1,2,3); $b = array(1); +try { + var_dump($a / $b); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a / $b; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/dynamic_call_001.phpt b/Zend/tests/dynamic_call_001.phpt index 94e4203caf..9a22dc2c6b 100644 --- a/Zend/tests/dynamic_call_001.phpt +++ b/Zend/tests/dynamic_call_001.phpt @@ -14,4 +14,6 @@ $a::$a(); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in %s on line %d + Fatal error: Non-static method foo::foo() cannot be called statically in %s on line %d diff --git a/Zend/tests/errmsg_045.phpt b/Zend/tests/errmsg_045.phpt index b27f67ade4..331425ad9c 100644 --- a/Zend/tests/errmsg_045.phpt +++ b/Zend/tests/errmsg_045.phpt @@ -8,11 +8,13 @@ set_error_handler(function($_, $msg, $file) { echo $undefined; }); -eval('class A { function a() {} function __construct() {} }'); +/* This is just a particular example of a non-fatal compile-time error + * If this breaks in future, just find another example and use it instead */ +eval('abstract class foo { abstract static function bar(); }'); ?> --EXPECTF-- -string(50) "Redefining already defined constructor for class A" +string(%d) "Static function foo::bar() should not be abstract" string(%d) "%s(%d) : eval()'d code" Notice: Undefined variable: undefined in %s on line %d diff --git a/Zend/tests/exception_013.phpt b/Zend/tests/exception_013.phpt new file mode 100644 index 0000000000..72e9377866 --- /dev/null +++ b/Zend/tests/exception_013.phpt @@ -0,0 +1,36 @@ +--TEST-- +Exceptions on improper access to static class properties +--FILE-- +<?php +class C { + static private $p = 0; +} + +try { + var_dump(C::$a); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; +} + +try { + var_dump(C::$p); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; +} + +try { + unset(C::$a); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; +} + +var_dump(C::$a); +?> +--EXPECTF-- +Exception: Access to undeclared static property: C::$a in %sexception_013.php on line 7 + +Exception: Cannot access private property C::$p in %sexception_013.php on line 13 + +Exception: Attempt to unset static property C::$a in %sexception_013.php on line 19 + +Fatal error: Access to undeclared static property: C::$a in %sexception_013.php on line 24 diff --git a/Zend/tests/exception_014.phpt b/Zend/tests/exception_014.phpt new file mode 100644 index 0000000000..71bb14df1d --- /dev/null +++ b/Zend/tests/exception_014.phpt @@ -0,0 +1,21 @@ +--TEST-- +Exceptions on improper access to static class properties +--FILE-- +<?php +class C { + private $p = 0; +} + +$x = new C; +try { + var_dump($x->p); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; +} + +var_dump($x->p); +?> +--EXPECTF-- +Exception: Cannot access private property C::$p in %sexception_014.php on line %d + +Fatal error: Cannot access private property C::$p in %sexception_014.php on line %d diff --git a/Zend/tests/get_class_methods_001.phpt b/Zend/tests/get_class_methods_001.phpt index 277ea2cf5a..a2a3d0ca20 100644 --- a/Zend/tests/get_class_methods_001.phpt +++ b/Zend/tests/get_class_methods_001.phpt @@ -3,30 +3,30 @@ get_class_methods(): Testing scope --FILE-- <?php -abstract class A { +abstract class X { public function a() { } private function b() { } protected function c() { } } -class B extends A { +class Y extends X { private function bb() { } static public function test() { - var_dump(get_class_methods('A')); - var_dump(get_class_methods('B')); + var_dump(get_class_methods('X')); + var_dump(get_class_methods('Y')); } } -var_dump(get_class_methods('A')); -var_dump(get_class_methods('B')); +var_dump(get_class_methods('X')); +var_dump(get_class_methods('Y')); -B::test(); +Y::test(); ?> ---EXPECT-- +--EXPECTF-- array(1) { [0]=> string(1) "a" diff --git a/Zend/tests/get_class_methods_002.phpt b/Zend/tests/get_class_methods_002.phpt index 27da6e8d9b..62f326c053 100644 --- a/Zend/tests/get_class_methods_002.phpt +++ b/Zend/tests/get_class_methods_002.phpt @@ -24,7 +24,6 @@ new B; ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class B in %s on line %d array(2) { [0]=> string(1) "a" diff --git a/Zend/tests/get_class_methods_003.phpt b/Zend/tests/get_class_methods_003.phpt index bbb758625b..5c3c09f4e0 100644 --- a/Zend/tests/get_class_methods_003.phpt +++ b/Zend/tests/get_class_methods_003.phpt @@ -3,13 +3,13 @@ get_class_methods(): Testing scope --FILE-- <?php -interface A { +interface I { function aa(); function bb(); static function cc(); } -class C { +class X { public function a() { } protected function b() { } private function c() { } @@ -19,22 +19,22 @@ class C { static private function static_c() { } } -class B extends C implements A { +class Y extends X implements I { public function aa() { } public function bb() { } static function cc() { } public function __construct() { - var_dump(get_class_methods('A')); - var_dump(get_class_methods('B')); - var_dump(get_class_methods('C')); + var_dump(get_class_methods('I')); + var_dump(get_class_methods('Y')); + var_dump(get_class_methods('X')); } public function __destruct() { } } -new B; +new Y; ?> --EXPECT-- diff --git a/Zend/tests/mul_001.phpt b/Zend/tests/mul_001.phpt index 4c5a75e7d1..2a827af74f 100644 --- a/Zend/tests/mul_001.phpt +++ b/Zend/tests/mul_001.phpt @@ -6,10 +6,18 @@ multiplying arrays $a = array(1,2,3); $b = array(1); +try { + var_dump($a * $b); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a * $b; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/not_002.phpt b/Zend/tests/not_002.phpt index df27772a73..4c9be5befa 100644 --- a/Zend/tests/not_002.phpt +++ b/Zend/tests/not_002.phpt @@ -6,10 +6,18 @@ bitwise NOT and arrays $a = array(1,2,3); $b = array(1,2); +try { + var_dump(~$b); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $a = ~$b; var_dump($a); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/objects_010.phpt b/Zend/tests/objects_010.phpt index 5d004629d9..0f85498e2c 100644 --- a/Zend/tests/objects_010.phpt +++ b/Zend/tests/objects_010.phpt @@ -1,7 +1,5 @@ --TEST-- redefining constructor (__construct second) ---INI-- -error_reporting=8191 --FILE-- <?php @@ -15,5 +13,4 @@ class test { echo "Done\n"; ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class test in %s on line %d Done diff --git a/Zend/tests/return_types/023.phpt b/Zend/tests/return_types/023.phpt index 61a9e1c4e0..9e36bf7c04 100644 --- a/Zend/tests/return_types/023.phpt +++ b/Zend/tests/return_types/023.phpt @@ -9,4 +9,6 @@ class Foo { } --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Foo has a deprecated constructor in %s on line %d + Fatal error: Constructor %s::%s() cannot declare a return type in %s on line %s diff --git a/Zend/tests/sub_001.phpt b/Zend/tests/sub_001.phpt index 2a8b3cdffd..a9438fdcde 100644 --- a/Zend/tests/sub_001.phpt +++ b/Zend/tests/sub_001.phpt @@ -6,10 +6,18 @@ subtracting arrays $a = array(1,2,3); $b = array(1); +try { + var_dump($a - $b); +} catch (EngineException $e) { + echo "\nException: " . $e->getMessage() . "\n"; +} + $c = $a - $b; var_dump($c); echo "Done\n"; ?> --EXPECTF-- +Exception: Unsupported operand types + Fatal error: Unsupported operand types in %s on line %d diff --git a/Zend/tests/traits/bug55554b.phpt b/Zend/tests/traits/bug55554b.phpt index bf40e89a08..06229bac34 100644 --- a/Zend/tests/traits/bug55554b.phpt +++ b/Zend/tests/traits/bug55554b.phpt @@ -50,6 +50,8 @@ $o = new ReportCollision; --EXPECTF-- OverridingIsSilent1 __construct + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OverridingIsSilent2 has a deprecated constructor in %s on line %d OverridingIsSilent2 OverridingIsSilent2 Fatal error: ReportCollision has colliding constructor definitions coming from traits in %s on line %d diff --git a/Zend/tests/traits/noctor001.phpt b/Zend/tests/traits/noctor001.phpt index d15acff87a..19fe8dbd0d 100644 --- a/Zend/tests/traits/noctor001.phpt +++ b/Zend/tests/traits/noctor001.phpt @@ -22,7 +22,8 @@ var_dump($rbarfoo->isConstructor()); $rbarbar = new ReflectionMethod('Bar::Bar'); var_dump($rbarbar->isConstructor()); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Bar has a deprecated constructor in %s on line %d bool(false) bool(false) bool(true) diff --git a/Zend/zend.c b/Zend/zend.c index 6bb614fab5..1f764445bd 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -1017,18 +1017,22 @@ static void zend_error_va_list(int type, const char *format, va_list args) zend_array *symbol_table; if (type & E_EXCEPTION) { - char *message = NULL; + type &= ~E_EXCEPTION; + //TODO: we can't convert compile-time errors to exceptions yet??? + if (EG(current_execute_data) && !CG(in_compilation)) { + char *message = NULL; #if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS) - va_start(args, format); + va_start(args, format); #endif - zend_vspprintf(&message, 0, format, args); - zend_throw_exception(zend_get_engine_exception(), message, type & ~E_EXCEPTION); - efree(message); + zend_vspprintf(&message, 0, format, args); + zend_throw_exception(zend_get_engine_exception(), message, type); + efree(message); #if !defined(HAVE_NORETURN) || defined(HAVE_NORETURN_ALIAS) - va_end(args); + va_end(args); #endif - return; + return; + } } /* Report about uncaught exception in case of fatal errors */ diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 2a76ff39e6..b1dcfcd66b 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -3171,7 +3171,7 @@ void zend_compile_method_call(znode *result, zend_ast *ast, uint32_t type) /* {{ } /* }}} */ -zend_bool zend_is_constructor(zend_string *name) /* {{{ */ +static zend_bool zend_is_constructor(zend_string *name) /* {{{ */ { return zend_string_equals_literal_ci(name, ZEND_CONSTRUCTOR_FUNC_NAME); } @@ -4409,10 +4409,6 @@ void zend_begin_method_decl(zend_op_array *op_array, zend_string *name, zend_boo ce->constructor = (zend_function *) op_array; } } else if (zend_string_equals_literal(lcname, ZEND_CONSTRUCTOR_FUNC_NAME)) { - if (CG(active_class_entry)->constructor) { - zend_error(E_STRICT, "Redefining already defined constructor for class %s", - ce->name->val); - } ce->constructor = (zend_function *) op_array; } else if (zend_string_equals_literal(lcname, ZEND_DESTRUCTOR_FUNC_NAME)) { ce->destructor = (zend_function *) op_array; @@ -4951,6 +4947,11 @@ void zend_compile_class_decl(zend_ast *ast) /* {{{ */ zend_compile_stmt(stmt_ast); + if (ce->num_traits == 0) { + /* For traits this check is delayed until after trait binding */ + zend_check_deprecated_constructor(ce); + } + if (ce->constructor) { ce->constructor->common.fn_flags |= ZEND_ACC_CTOR; if (ce->constructor->common.fn_flags & ZEND_ACC_STATIC) { diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 3e9083c8a4..fd40c8ed84 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -23,6 +23,7 @@ #include "zend_execute.h" #include "zend_inheritance.h" #include "zend_smart_str.h" +#include "zend_inheritance.h" static void ptr_dtor(zval *zv) /* {{{ */ { @@ -1596,6 +1597,9 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce) /* {{{ */ /* verify that all abstract methods from traits have been implemented */ zend_verify_abstract_class(ce); + /* Emit E_DEPRECATED for PHP 4 constructors */ + zend_check_deprecated_constructor(ce); + /* now everything should be fine and an added ZEND_ACC_IMPLICIT_ABSTRACT_CLASS should be removed */ if (ce->ce_flags & ZEND_ACC_IMPLICIT_ABSTRACT_CLASS) { ce->ce_flags -= ZEND_ACC_IMPLICIT_ABSTRACT_CLASS; @@ -1603,6 +1607,29 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce) /* {{{ */ } /* }}} */ + +static zend_bool zend_has_deprecated_constructor(const zend_class_entry *ce) /* {{{ */ +{ + const zend_string *constructor_name; + if (!ce->constructor) { + return 0; + } + constructor_name = ce->constructor->common.function_name; + return !zend_binary_strcasecmp( + ce->name->val, ce->name->len, + constructor_name->val, constructor_name->len + ); +} +/* }}} */ + +void zend_check_deprecated_constructor(const zend_class_entry *ce) /* {{{ */ +{ + if (zend_has_deprecated_constructor(ce)) { + zend_error(E_DEPRECATED, "Methods with the same name as their class will not be constructors in a future version of PHP; %s has a deprecated constructor", ce->name->val); + } +} +/* }}} */ + /* * Local variables: * tab-width: 4 diff --git a/Zend/zend_inheritance.h b/Zend/zend_inheritance.h index 7ec6231cd2..f7ad6dc060 100644 --- a/Zend/zend_inheritance.h +++ b/Zend/zend_inheritance.h @@ -33,6 +33,8 @@ ZEND_API void zend_do_bind_traits(zend_class_entry *ce); ZEND_API void zend_do_inheritance(zend_class_entry *ce, zend_class_entry *parent_ce); void zend_do_early_binding(void); +void zend_check_deprecated_constructor(const zend_class_entry *ce); + END_EXTERN_C() #endif diff --git a/Zend/zend_object_handlers.c b/Zend/zend_object_handlers.c index a5c0bf0a03..8dcd81a99a 100644 --- a/Zend/zend_object_handlers.c +++ b/Zend/zend_object_handlers.c @@ -170,7 +170,7 @@ ZEND_API HashTable *zend_std_get_debug_info(zval *object, int *is_temp) /* {{{ * return ht; } - zend_error_noreturn(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array"); + zend_error(E_ERROR, ZEND_DEBUGINFO_FUNC_NAME "() must return an array"); return NULL; /* Compilers are dumb and don't understand that noreturn means that the function does NOT need a return value... */ } @@ -298,9 +298,9 @@ static zend_always_inline uint32_t zend_get_property_offset(zend_class_entry *ce if (UNEXPECTED(member->val[0] == '\0')) { if (!silent) { if (member->len == 0) { - zend_error_noreturn(E_ERROR, "Cannot access empty property"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access empty property"); } else { - zend_error_noreturn(E_ERROR, "Cannot access property started with '\\0'"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access property started with '\\0'"); } } return ZEND_WRONG_PROPERTY_OFFSET; @@ -354,7 +354,7 @@ exit_dynamic: } else if (UNEXPECTED(property_info == ZEND_WRONG_PROPERTY_INFO)) { /* Information was available, but we were denied access. Error out. */ if (!silent) { - zend_error_noreturn(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ce->name->val, member->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ce->name->val, member->val); } return ZEND_WRONG_PROPERTY_OFFSET; } @@ -376,9 +376,9 @@ ZEND_API zend_property_info *zend_get_property_info(zend_class_entry *ce, zend_s if (UNEXPECTED(member->val[0] == '\0')) { if (!silent) { if (member->len == 0) { - zend_error_noreturn(E_ERROR, "Cannot access empty property"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access empty property"); } else { - zend_error_noreturn(E_ERROR, "Cannot access property started with '\\0'"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access property started with '\\0'"); } } return ZEND_WRONG_PROPERTY_INFO; @@ -425,7 +425,7 @@ exit_dynamic: } else if (UNEXPECTED(property_info == ZEND_WRONG_PROPERTY_INFO)) { /* Information was available, but we were denied access. Error out. */ if (!silent) { - zend_error_noreturn(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ce->name->val, member->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(flags), ce->name->val, member->val); } return ZEND_WRONG_PROPERTY_INFO; } @@ -538,6 +538,9 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ retval = zend_hash_find(zobj->properties, Z_STR_P(member)); if (EXPECTED(retval)) goto exit; } + } else if (UNEXPECTED(EG(exception))) { + retval = &EG(uninitialized_zval); + goto exit; } /* magic get */ @@ -569,9 +572,13 @@ zval *zend_std_read_property(zval *object, zval *member, int type, void **cache_ } else { if (Z_STRVAL_P(member)[0] == '\0') { if (Z_STRLEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access empty property"); + retval = &EG(uninitialized_zval); + goto exit; } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access property started with '\\0'"); + retval = &EG(uninitialized_zval); + goto exit; } } } @@ -622,6 +629,8 @@ found: goto exit; } } + } else if (UNEXPECTED(EG(exception))) { + goto exit; } /* magic set */ @@ -643,9 +652,11 @@ found: } else { if (Z_STRVAL_P(member)[0] == '\0') { if (Z_STRLEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access empty property"); + goto exit; } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access property started with '\\0'"); + goto exit; } } } @@ -698,13 +709,13 @@ zval *zend_std_read_dimension(zval *object, zval *offset, int type, zval *rv) /* if (UNEXPECTED(Z_TYPE_P(rv) == IS_UNDEF)) { if (UNEXPECTED(!EG(exception))) { - zend_error_noreturn(E_ERROR, "Undefined offset for object of type %s used as array", ce->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Undefined offset for object of type %s used as array", ce->name->val); } return NULL; } return rv; } else { - zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot use object of type %s as array", ce->name->val); return NULL; } } @@ -725,7 +736,7 @@ static void zend_std_write_dimension(zval *object, zval *offset, zval *value) /* zend_call_method_with_2_params(object, ce, NULL, "offsetset", NULL, offset, value); zval_ptr_dtor(offset); } else { - zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot use object of type %s as array", ce->name->val); } } /* }}} */ @@ -754,7 +765,7 @@ static int zend_std_has_dimension(zval *object, zval *offset, int check_empty) / } zval_ptr_dtor(offset); } else { - zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot use object of type %s as array", ce->name->val); return 0; } return result; @@ -854,6 +865,8 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo EXPECTED(zend_hash_del(zobj->properties, Z_STR_P(member)) != FAILURE)) { goto exit; } + } else if (UNEXPECTED(EG(exception))) { + goto exit; } /* magic unset */ @@ -871,9 +884,11 @@ static void zend_std_unset_property(zval *object, zval *member, void **cache_slo } else { if (Z_STRVAL_P(member)[0] == '\0') { if (Z_STRLEN_P(member) == 0) { - zend_error(E_ERROR, "Cannot access empty property"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access empty property"); + goto exit; } else { - zend_error(E_ERROR, "Cannot access property started with '\\0'"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access property started with '\\0'"); + goto exit; } } } @@ -895,7 +910,7 @@ static void zend_std_unset_dimension(zval *object, zval *offset) /* {{{ */ zend_call_method_with_1_params(object, ce, NULL, "offsetunset", NULL, offset); zval_ptr_dtor(offset); } else { - zend_error_noreturn(E_ERROR, "Cannot use object of type %s as array", ce->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot use object of type %s as array", ce->name->val); } } /* }}} */ @@ -911,7 +926,7 @@ ZEND_API void zend_std_call_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ */ if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args) == FAILURE)) { zval_dtor(&method_args); - zend_error_noreturn(E_ERROR, "Cannot get arguments for __call"); + zend_error(E_EXCEPTION | E_ERROR, "Cannot get arguments for __call"); RETURN_FALSE; } @@ -1085,7 +1100,8 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str if (zobj->ce->__call) { fbc = zend_get_user_call_function(zobj->ce, method_name); } else { - zend_error_noreturn(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name->val, EG(scope) ? EG(scope)->name->val : ""); + zend_error(E_EXCEPTION | E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name->val, EG(scope) ? EG(scope)->name->val : ""); + fbc = NULL; } } } else { @@ -1111,7 +1127,8 @@ static union _zend_function *zend_std_get_method(zend_object **obj_ptr, zend_str if (zobj->ce->__call) { fbc = zend_get_user_call_function(zobj->ce, method_name); } else { - zend_error_noreturn(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name->val, EG(scope) ? EG(scope)->name->val : ""); + zend_error(E_EXCEPTION | E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), method_name->val, EG(scope) ? EG(scope)->name->val : ""); + fbc = NULL; } } } @@ -1135,7 +1152,7 @@ ZEND_API void zend_std_callstatic_user_call(INTERNAL_FUNCTION_PARAMETERS) /* {{{ if (UNEXPECTED(zend_copy_parameters_array(ZEND_NUM_ARGS(), &method_args) == FAILURE)) { zval_dtor(&method_args); - zend_error_noreturn(E_ERROR, "Cannot get arguments for " ZEND_CALLSTATIC_FUNC_NAME); + zend_error(E_EXCEPTION | E_ERROR, "Cannot get arguments for " ZEND_CALLSTATIC_FUNC_NAME); RETURN_FALSE; } @@ -1252,7 +1269,8 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st if (ce->__callstatic) { fbc = zend_get_user_callstatic_function(ce, function_name); } else { - zend_error_noreturn(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name->val, EG(scope) ? EG(scope)->name->val : ""); + zend_error(E_EXCEPTION | E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name->val, EG(scope) ? EG(scope)->name->val : ""); + fbc = NULL; } } } else if ((fbc->common.fn_flags & ZEND_ACC_PROTECTED)) { @@ -1262,7 +1280,8 @@ ZEND_API zend_function *zend_std_get_static_method(zend_class_entry *ce, zend_st if (ce->__callstatic) { fbc = zend_get_user_callstatic_function(ce, function_name); } else { - zend_error_noreturn(E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name->val, EG(scope) ? EG(scope)->name->val : ""); + zend_error(E_EXCEPTION | E_ERROR, "Call to %s method %s::%s() from context '%s'", zend_visibility_string(fbc->common.fn_flags), ZEND_FN_SCOPE_NAME(fbc), function_name->val, EG(scope) ? EG(scope)->name->val : ""); + fbc = NULL; } } } @@ -1286,7 +1305,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p if (UNEXPECTED(!zend_verify_property_access(property_info, ce))) { if (!silent) { - zend_error_noreturn(E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name->val, property_name->val); + zend_error(E_EXCEPTION | E_ERROR, "Cannot access %s property %s::$%s", zend_visibility_string(property_info->flags), ce->name->val, property_name->val); } return NULL; } @@ -1302,7 +1321,7 @@ ZEND_API zval *zend_std_get_static_property(zend_class_entry *ce, zend_string *p if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { undeclared_property: if (!silent) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, property_name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, property_name->val); } ret = NULL; } @@ -1313,7 +1332,7 @@ undeclared_property: ZEND_API zend_bool zend_std_unset_static_property(zend_class_entry *ce, zend_string *property_name) /* {{{ */ { - zend_error_noreturn(E_ERROR, "Attempt to unset static property %s::$%s", ce->name->val, property_name->val); + zend_error(E_EXCEPTION | E_ERROR, "Attempt to unset static property %s::$%s", ce->name->val, property_name->val); return 0; } /* }}} */ @@ -1330,9 +1349,11 @@ ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj) /* {{ */ if (UNEXPECTED(constructor->common.scope != EG(scope))) { if (EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name->val, constructor->common.function_name->val, EG(scope)->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Call to private %s::%s() from context '%s'", constructor->common.scope->name->val, constructor->common.function_name->val, EG(scope)->name->val); + constructor = NULL; } else { - zend_error_noreturn(E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name->val, constructor->common.function_name->val); + zend_error(E_EXCEPTION | E_ERROR, "Call to private %s::%s() from invalid context", constructor->common.scope->name->val, constructor->common.function_name->val); + constructor = NULL; } } } else if ((constructor->common.fn_flags & ZEND_ACC_PROTECTED)) { @@ -1342,9 +1363,11 @@ ZEND_API union _zend_function *zend_std_get_constructor(zend_object *zobj) /* {{ */ if (UNEXPECTED(!zend_check_protected(zend_get_function_root_class(constructor), EG(scope)))) { if (EG(scope)) { - zend_error_noreturn(E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name->val, constructor->common.function_name->val, EG(scope)->name->val); + zend_error(E_EXCEPTION | E_ERROR, "Call to protected %s::%s() from context '%s'", constructor->common.scope->name->val, constructor->common.function_name->val, EG(scope)->name->val); + constructor = NULL; } else { - zend_error_noreturn(E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name->val, constructor->common.function_name->val); + zend_error(E_EXCEPTION | E_ERROR, "Call to protected %s::%s() from invalid context", constructor->common.scope->name->val, constructor->common.function_name->val); + constructor = NULL; } } } @@ -1456,6 +1479,9 @@ found: } goto exit; } + } else if (UNEXPECTED(EG(exception))) { + result = 0; + goto exit; } result = 0; diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index 3475174513..daa3ada6ed 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -868,7 +868,7 @@ ZEND_API int ZEND_FASTCALL add_function(zval *result, zval *op1, zval *op2) /* { zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; } else { - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; /* unknown datatype */ } } @@ -921,7 +921,7 @@ ZEND_API int ZEND_FASTCALL sub_function(zval *result, zval *op1, zval *op2) /* { zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; } else { - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; /* unknown datatype */ } } @@ -968,7 +968,7 @@ ZEND_API int ZEND_FASTCALL mul_function(zval *result, zval *op1, zval *op2) /* { zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; } else { - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; /* unknown datatype */ } } @@ -1056,7 +1056,7 @@ ZEND_API int ZEND_FASTCALL pow_function(zval *result, zval *op1, zval *op2) /* { } converted = 1; } else { - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; } } @@ -1127,7 +1127,7 @@ ZEND_API int ZEND_FASTCALL div_function(zval *result, zval *op1, zval *op2) /* { zendi_convert_scalar_to_number(op2, op2_copy, result); converted = 1; } else { - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; /* unknown datatype */ } } @@ -1263,7 +1263,7 @@ try_again: default: ZEND_TRY_UNARY_OBJECT_OPERATION(ZEND_BW_NOT); - zend_error(E_ERROR, "Unsupported operand types"); + zend_error(E_EXCEPTION | E_ERROR, "Unsupported operand types"); return FAILURE; } } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 8c1f1b4a8f..666037631f 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1465,7 +1465,9 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + FREE_OP1(); + HANDLE_EXCEPTION(); } ZEND_VM_C_GOTO(fetch_var_return); @@ -1490,13 +1492,19 @@ ZEND_VM_HELPER_EX(zend_fetch_var_address_helper, CONST|TMPVAR|CV, UNUSED|CONST|V /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + FREE_OP1(); + HANDLE_EXCEPTION(); } ZEND_VM_C_GOTO(fetch_var_return); } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + FREE_OP1(); + HANDLE_EXCEPTION(); + } if (OP1_TYPE == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -2797,7 +2805,9 @@ ZEND_VM_HANDLER(112, ZEND_INIT_METHOD_CALL, TMPVAR|UNUSED|CV, CONST|TMPVAR|CV) /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } FREE_OP2(); FREE_OP1(); HANDLE_EXCEPTION(); @@ -2884,7 +2894,9 @@ ZEND_VM_HANDLER(113, ZEND_INIT_STATIC_METHOD_CALL, CONST|VAR, CONST|TMPVAR|UNUSE fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((OP2_TYPE == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } FREE_OP2(); HANDLE_EXCEPTION(); } @@ -3071,7 +3083,9 @@ ZEND_VM_C_LABEL(try_function_name): fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + } FREE_OP2(); HANDLE_EXCEPTION(); } @@ -3095,7 +3109,9 @@ ZEND_VM_C_LABEL(try_function_name): fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + } FREE_OP2(); HANDLE_EXCEPTION(); } @@ -6098,7 +6114,9 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR) /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + FREE_OP1(); + HANDLE_EXCEPTION(); } ZEND_VM_C_GOTO(is_var_return); @@ -6119,7 +6137,9 @@ ZEND_VM_HANDLER(114, ZEND_ISSET_ISEMPTY_VAR, CONST|TMPVAR|CV, UNUSED|CONST|VAR) /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + FREE_OP1(); + HANDLE_EXCEPTION(); } ZEND_VM_C_GOTO(is_var_return); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 31ee053ef4..a4c2f352e7 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1950,7 +1950,9 @@ try_function_name: fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + } HANDLE_EXCEPTION(); } @@ -1974,7 +1976,9 @@ try_function_name: fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + } HANDLE_EXCEPTION(); } @@ -2338,7 +2342,9 @@ try_function_name: fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + } HANDLE_EXCEPTION(); } @@ -2362,7 +2368,9 @@ try_function_name: fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + } HANDLE_EXCEPTION(); } @@ -2523,7 +2531,9 @@ try_function_name: fbc = zend_std_get_static_method(called_scope, Z_STR_P(method), NULL); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", called_scope->name->val, Z_STRVAL_P(method)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -2547,7 +2557,9 @@ try_function_name: fbc = Z_OBJ_HT_P(obj)->get_method(&object, Z_STR_P(method), NULL); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", object->ce->name->val, Z_STRVAL_P(method)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -4502,7 +4514,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -4527,13 +4541,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CONST == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -5016,7 +5036,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -5556,7 +5578,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_C /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -5577,7 +5601,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_C /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -6187,7 +6213,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -6212,13 +6240,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CONST == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -6448,7 +6482,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_V /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -6469,7 +6505,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_V /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -6675,7 +6713,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -6700,13 +6740,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CONST == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -6918,7 +6964,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -7283,7 +7331,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_U /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -7304,7 +7354,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CONST_U /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -8400,7 +8452,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -9949,7 +10003,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_C fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -15814,7 +15870,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -17389,7 +17447,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_UNUSED == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -19006,7 +19066,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); } @@ -20565,7 +20627,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_STATIC_METHOD_CALL_SPEC_V fbc = zend_std_get_static_method(ce, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); } if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); } @@ -21924,7 +21988,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); @@ -24212,7 +24278,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_C /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); @@ -25621,7 +25689,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_UNUSED_T /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -28735,7 +28805,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -28760,13 +28832,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CV == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -29569,7 +29647,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CONST /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); @@ -30026,7 +30106,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONS /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -30047,7 +30129,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_CONS /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -30760,7 +30844,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -30785,13 +30871,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CV == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -31117,7 +31209,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -31138,7 +31232,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_VAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -31676,7 +31772,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -31701,13 +31799,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + + HANDLE_EXCEPTION(); + } if (IS_CV == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -32301,7 +32405,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUS /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -32322,7 +32428,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_CV_UNUS /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + + HANDLE_EXCEPTION(); } goto is_var_return; @@ -34379,7 +34487,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_CV_HA /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } HANDLE_EXCEPTION(); @@ -36794,7 +36904,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_CV_TMPVA /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op2); HANDLE_EXCEPTION(); @@ -38428,7 +38540,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -38453,13 +38567,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); + } if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -38802,7 +38922,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CONST == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -39013,7 +39135,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -39034,7 +39158,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -39317,7 +39443,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -39342,13 +39470,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); + } if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -39579,7 +39713,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -39600,7 +39736,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -39712,7 +39850,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; @@ -39737,13 +39877,19 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_var_address_helper_SPEC_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, name->val); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto fetch_var_return; } } retval = zend_std_get_static_property(ce, name, 0); + if (UNEXPECTED(EG(exception))) { + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); + } if ((IS_TMP_VAR|IS_VAR) == IS_CONST && retval) { CACHE_POLYMORPHIC_PTR(Z_CACHE_SLOT_P(EX_CONSTANT(opline->op1)), ce, retval); } @@ -39974,7 +40120,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -39995,7 +40143,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_ISSET_ISEMPTY_VAR_SPEC_TMPVAR_ /* check if static properties were destoyed */ if (UNEXPECTED(CE_STATIC_MEMBERS(ce) == NULL)) { - zend_error_noreturn(E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zend_error(E_EXCEPTION | E_ERROR, "Access to undeclared static property: %s::$%s", ce->name->val, Z_STR_P(varname)); + zval_ptr_dtor_nogc(free_op1); + HANDLE_EXCEPTION(); } goto is_var_return; @@ -40759,7 +40909,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_C /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), ((IS_CV == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); @@ -41749,7 +41901,9 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_METHOD_CALL_SPEC_TMPVAR_T /* First, locate the function. */ fbc = obj->handlers->get_method(&obj, Z_STR_P(function_name), (((IS_TMP_VAR|IS_VAR) == IS_CONST) ? (EX_CONSTANT(opline->op2) + 1) : NULL)); if (UNEXPECTED(fbc == NULL)) { - zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + if (EXPECTED(!EG(exception))) { + zend_error(E_EXCEPTION | E_ERROR, "Call to undefined method %s::%s()", obj->ce->name->val, Z_STRVAL_P(function_name)); + } zval_ptr_dtor_nogc(free_op2); zval_ptr_dtor_nogc(free_op1); HANDLE_EXCEPTION(); diff --git a/ext/date/lib/parse_date.c b/ext/date/lib/parse_date.c index 9e0ca6edf3..84414e9aef 100644 --- a/ext/date/lib/parse_date.c +++ b/ext/date/lib/parse_date.c @@ -1,4 +1,4 @@ -/* Generated by re2c 0.13.5 on Thu Oct 30 18:16:16 2014 */ +/* Generated by re2c 0.13.5 on Tue Mar 31 16:32:03 2015 */ #line 1 "ext/date/lib/parse_date.re" /* +----------------------------------------------------------------------+ @@ -19864,9 +19864,9 @@ yy1315: /* skip "last day of" or "first day of" */ if (*ptr == 'l' || *ptr == 'L') { - s->time->relative.first_last_day_of = 2; + s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH; } else { - s->time->relative.first_last_day_of = 1; + s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH; } TIMELIB_DEINIT; diff --git a/ext/date/lib/parse_date.re b/ext/date/lib/parse_date.re index 0ac99a591e..9303eae01e 100644 --- a/ext/date/lib/parse_date.re +++ b/ext/date/lib/parse_date.re @@ -1030,9 +1030,9 @@ weekdayof = (reltextnumber|reltexttext) space (dayfull|dayabbr) space 'of /* skip "last day of" or "first day of" */ if (*ptr == 'l' || *ptr == 'L') { - s->time->relative.first_last_day_of = 2; + s->time->relative.first_last_day_of = TIMELIB_SPECIAL_LAST_DAY_OF_MONTH; } else { - s->time->relative.first_last_day_of = 1; + s->time->relative.first_last_day_of = TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH; } TIMELIB_DEINIT; diff --git a/ext/date/lib/timelib.h b/ext/date/lib/timelib.h index 51f3fbcfc4..a367ef36da 100644 --- a/ext/date/lib/timelib.h +++ b/ext/date/lib/timelib.h @@ -38,6 +38,9 @@ #define TIMELIB_SPECIAL_DAY_OF_WEEK_IN_MONTH 0x02 #define TIMELIB_SPECIAL_LAST_DAY_OF_WEEK_IN_MONTH 0x03 +#define TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH 0x01 +#define TIMELIB_SPECIAL_LAST_DAY_OF_MONTH 0x02 + #ifndef LONG_MAX #define LONG_MAX 2147483647L #endif diff --git a/ext/date/lib/tm2unixtime.c b/ext/date/lib/tm2unixtime.c index c058672f1e..2714c9a4da 100644 --- a/ext/date/lib/tm2unixtime.c +++ b/ext/date/lib/tm2unixtime.c @@ -205,15 +205,17 @@ static void do_adjust_relative(timelib_time* time) time->m += time->relative.m; time->y += time->relative.y; } + switch (time->relative.first_last_day_of) { - case 1: /* first */ + case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */ time->d = 1; break; - case 2: /* last */ + case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */ time->d = 0; time->m++; break; } + timelib_do_normalize(time); } @@ -296,6 +298,15 @@ static void do_adjust_special_early(timelib_time* time) break; } } + switch (time->relative.first_last_day_of) { + case TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH: /* first */ + time->d = 1; + break; + case TIMELIB_SPECIAL_LAST_DAY_OF_MONTH: /* last */ + time->d = 0; + time->m++; + break; + } timelib_do_normalize(time); } diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 94d3a19bcd..b3f6a27c9d 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -2967,7 +2967,7 @@ void php_date_do_return_parsed_time(INTERNAL_FUNCTION_PARAMETERS, timelib_time * add_assoc_long(&element, "weekdays", parsed_time->relative.special.amount); } if (parsed_time->relative.first_last_day_of) { - add_assoc_bool(&element, parsed_time->relative.first_last_day_of == 1 ? "first_day_of_month" : "last_day_of_month", 1); + add_assoc_bool(&element, parsed_time->relative.first_last_day_of == TIMELIB_SPECIAL_FIRST_DAY_OF_MONTH ? "first_day_of_month" : "last_day_of_month", 1); } add_assoc_zval(return_value, "relative", &element); } diff --git a/ext/date/php_date.h b/ext/date/php_date.h index 8492a41e77..e887093c39 100644 --- a/ext/date/php_date.h +++ b/ext/date/php_date.h @@ -225,6 +225,7 @@ PHPAPI timelib_tzinfo *get_timezone_info(void); /* Grabbing CE's so that other exts can use the date objects too */ PHPAPI zend_class_entry *php_date_get_date_ce(void); +PHPAPI zend_class_entry *php_date_get_immutable_ce(void); PHPAPI zend_class_entry *php_date_get_timezone_ce(void); /* Functions for creating DateTime objects, and initializing them from a string */ diff --git a/ext/date/tests/bug69336.phpt b/ext/date/tests/bug69336.phpt new file mode 100644 index 0000000000..8444aa30a3 --- /dev/null +++ b/ext/date/tests/bug69336.phpt @@ -0,0 +1,20 @@ +--TEST-- +Bug #69336 (Issues with "last day of <monthname>") +--INI-- +date.timezone=UTC +--FILE-- +<?php +var_dump(date('d.m.Y',strtotime('last day of april'))); +var_dump(date('d.m.Y',strtotime('last tuesday of march 2015'))); +var_dump(date('d.m.Y',strtotime('last wednesday of march 2015'))); +var_dump(date('d.m.Y',strtotime('last wednesday of april 2015'))); +var_dump(date('d.m.Y',strtotime('last wednesday of march 2014'))); +var_dump(date('d.m.Y',strtotime('last wednesday of april 2014'))); +?> +--EXPECTF-- +string(10) "30.04.%d" +string(10) "31.03.2015" +string(10) "25.03.2015" +string(10) "29.04.2015" +string(10) "26.03.2014" +string(10) "30.04.2014" diff --git a/ext/mbstring/tests/common.inc b/ext/mbstring/tests/common.inc index 1df6341077..a40dde0399 100644 --- a/ext/mbstring/tests/common.inc +++ b/ext/mbstring/tests/common.inc @@ -45,7 +45,7 @@ class tc public $s1 = 'ÆüËܸìEUC-JP¤Îʸ»úÎó'; public $s2 = 'English Text'; - function tc() + function __construct() { } } diff --git a/ext/mbstring/tests/mb_convert_variables.phpt b/ext/mbstring/tests/mb_convert_variables.phpt index 01ced05104..22253b5352 100644 --- a/ext/mbstring/tests/mb_convert_variables.phpt +++ b/ext/mbstring/tests/mb_convert_variables.phpt @@ -76,7 +76,7 @@ class foo public $s2; public $s3; - function foo() + function __construct() { global $sjis, $jis, $euc_jp; @@ -92,7 +92,7 @@ class bar public $s2; public $s3; - function bar() + function __construct() { global $sjis, $jis, $euc_jp; diff --git a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt index 91cb9d022b..58626be672 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_param_references.phpt @@ -177,7 +177,7 @@ require_once('skipifconnectfailure.inc'); class foo { public $foo; - function foo() { + function __construct() { $this->foo = &$this->bar; } } @@ -204,4 +204,4 @@ require_once('skipifconnectfailure.inc'); require_once("clean_table.inc"); ?> --EXPECTF-- -done!
\ No newline at end of file +done! diff --git a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt index ee659d4b4a..b8efec5eca 100644 --- a/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt +++ b/ext/mysqli/tests/mysqli_stmt_bind_result_references.phpt @@ -194,7 +194,7 @@ require_once('skipifconnectfailure.inc'); unset($bar); unset($id); unset($label_ref); class foo { public $foo; - public function foo() { + public function __construct() { $this->foo = &$this->bar; } } @@ -219,8 +219,8 @@ require_once('skipifconnectfailure.inc'); class mega_bar extends bar { private $id; public $id_ref; - public function mega_bar() { - $this->foo(); + public function __construct() { + parent::__construct(); $this->id_ref = &$this->id; } } @@ -311,4 +311,4 @@ object(mega_bar)#5 (4) { [%u|b%"foo"]=> &%unicode|string%(1) "a" } -done!
\ No newline at end of file +done! diff --git a/ext/odbc/config.w32 b/ext/odbc/config.w32 index 8a284e3258..3c238c66de 100644 --- a/ext/odbc/config.w32 +++ b/ext/odbc/config.w32 @@ -1,7 +1,7 @@ // $Id$ // vim:ft=javascript -ARG_ENABLE("odbc", "ODBC support", "yes"); +ARG_ENABLE("odbc", "ODBC support", "no"); ARG_WITH("odbcver", "Force support for the passed ODBC version. A hex number is expected, default 0x0300. Use the special value of 0 to prevent an explicit ODBCVER to be defined.", "0x0300"); if (PHP_ODBC == "yes") { diff --git a/ext/pcre/tests/bug21758.phpt b/ext/pcre/tests/bug21758.phpt index 78a1d6a747..db599196f2 100644 --- a/ext/pcre/tests/bug21758.phpt +++ b/ext/pcre/tests/bug21758.phpt @@ -3,7 +3,7 @@ Bug #21758 (preg_replace_callback() not working with class methods) --FILE-- <?php class Foo { - function foo() { + function __construct() { $s = 'preg_replace() is broken'; diff --git a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt index efcb2e7bcc..f7f3ce06bc 100644 --- a/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt +++ b/ext/pdo_sqlite/tests/pdo_fetch_func_001.phpt @@ -34,14 +34,14 @@ $st = $db->query('SELECT * FROM testing'); var_dump($st->fetchAll(PDO::FETCH_FUNC, array('self', 'foo'))); class foo { - public function foo($x) { + public function method($x) { return "--- $x ---"; } } class bar extends foo { public function __construct($db) { $st = $db->query('SELECT * FROM testing'); - var_dump($st->fetchAll(PDO::FETCH_FUNC, array($this, 'parent::foo'))); + var_dump($st->fetchAll(PDO::FETCH_FUNC, array($this, 'parent::method'))); } static public function test($x, $y) { diff --git a/ext/reflection/tests/004.phpt b/ext/reflection/tests/004.phpt index 2c81c506be..41632aa3ba 100644 --- a/ext/reflection/tests/004.phpt +++ b/ext/reflection/tests/004.phpt @@ -36,7 +36,8 @@ try { } echo "===DONE===\n";?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; a has a deprecated constructor in %s on line %d Non-object passed to Invoke() Given object is not an instance of the class this method was declared in ===DONE=== diff --git a/ext/reflection/tests/ReflectionClass_getConstructor_basic.phpt b/ext/reflection/tests/ReflectionClass_getConstructor_basic.phpt index 1f5ba432c3..c572796ae8 100644 --- a/ext/reflection/tests/ReflectionClass_getConstructor_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_getConstructor_basic.phpt @@ -64,7 +64,11 @@ foreach ($classes as $class) { ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OldCtor has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; B has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; C has a deprecated constructor in %s on line %d Constructor of NewCtor: __construct Constructor of ExtendsNewCtor: __construct Constructor of OldCtor: OldCtor diff --git a/ext/reflection/tests/ReflectionClass_isInstantiable_error.phpt b/ext/reflection/tests/ReflectionClass_isInstantiable_error.phpt index 52be239121..5263643023 100644 --- a/ext/reflection/tests/ReflectionClass_isInstantiable_error.phpt +++ b/ext/reflection/tests/ReflectionClass_isInstantiable_error.phpt @@ -12,6 +12,8 @@ var_dump($reflectionClass->IsInstantiable(0, null)); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d + Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 1 given in %s on line %d NULL diff --git a/ext/reflection/tests/ReflectionClass_isInstantiable_variation.phpt b/ext/reflection/tests/ReflectionClass_isInstantiable_variation.phpt index 1cf3e613e8..e334a90a72 100644 --- a/ext/reflection/tests/ReflectionClass_isInstantiable_variation.phpt +++ b/ext/reflection/tests/ReflectionClass_isInstantiable_variation.phpt @@ -41,6 +41,11 @@ foreach($classes as $class ) { ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; publicCtorOld has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; protectedCtorOld has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d Is noCtor instantiable? bool(true) Is publicCtorNew instantiable? bool(true) Is protectedCtorNew instantiable? bool(false) diff --git a/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt b/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt index 981d67519a..d3a426de4c 100644 --- a/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt +++ b/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt @@ -71,6 +71,7 @@ try { } ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d In constructor of class A In constructor of class A object(A)#%d (0) { @@ -95,4 +96,4 @@ Access to non-public constructor of class C Access to non-public constructor of class D object(E)#%d (0) { } -Class E does not have a constructor, so you cannot pass any constructor arguments
\ No newline at end of file +Class E does not have a constructor, so you cannot pass any constructor arguments diff --git a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt index 3cdb5d76b7..afa278a9a1 100644 --- a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt +++ b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt @@ -71,6 +71,7 @@ try { } ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d In constructor of class A In constructor of class A object(A)#%d (0) { @@ -95,4 +96,4 @@ Access to non-public constructor of class C Access to non-public constructor of class D object(E)#%d (0) { } -Class E does not have a constructor, so you cannot pass any constructor arguments
\ No newline at end of file +Class E does not have a constructor, so you cannot pass any constructor arguments diff --git a/ext/reflection/tests/ReflectionMethod_constructor_basic.phpt b/ext/reflection/tests/ReflectionMethod_constructor_basic.phpt index 2a2f02ffe0..243c59504b 100644 --- a/ext/reflection/tests/ReflectionMethod_constructor_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_constructor_basic.phpt @@ -85,7 +85,7 @@ var_dump($methodInfo->isConstructor()); ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OldCtor has a deprecated constructor in %s on line %d New-style constructor: bool(true) diff --git a/ext/reflection/tests/ReflectionObject_getConstructor_basic.phpt b/ext/reflection/tests/ReflectionObject_getConstructor_basic.phpt index 5a0c36f9ee..2fb43562bb 100644 --- a/ext/reflection/tests/ReflectionObject_getConstructor_basic.phpt +++ b/ext/reflection/tests/ReflectionObject_getConstructor_basic.phpt @@ -64,7 +64,11 @@ foreach ($classes as $class) { ?> --EXPECTF-- -Strict Standards: Redefining already defined constructor for class OldAndNewCtor in %s on line %d +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; OldCtor has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; B has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; C has a deprecated constructor in %s on line %d Constructor of NewCtor: __construct Constructor of ExtendsNewCtor: __construct Constructor of OldCtor: OldCtor diff --git a/ext/reflection/tests/ReflectionObject_isInstantiable_error.phpt b/ext/reflection/tests/ReflectionObject_isInstantiable_error.phpt index f993367b2d..c77c039d4d 100644 --- a/ext/reflection/tests/ReflectionObject_isInstantiable_error.phpt +++ b/ext/reflection/tests/ReflectionObject_isInstantiable_error.phpt @@ -15,6 +15,8 @@ var_dump($reflectionObject->IsInstantiable(0, null)); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d + Warning: ReflectionClass::isInstantiable() expects exactly 0 parameters, 1 given in %s on line %d NULL diff --git a/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt b/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt index ac7199c096..1e5be59299 100644 --- a/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt +++ b/ext/reflection/tests/ReflectionObject_isInstantiable_variation.phpt @@ -69,6 +69,11 @@ foreach($reflectionObjects as $reflectionObject ) { } ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; publicCtorOld has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; protectedCtorOld has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; privateCtorOld has a deprecated constructor in %s on line %d Is noCtor instantiable? bool(true) Is publicCtorNew instantiable? bool(true) Is protectedCtorNew instantiable? bool(false) diff --git a/ext/reflection/tests/bug30148.phpt b/ext/reflection/tests/bug30148.phpt index aa5841ee5b..27c31ca6ae 100644 --- a/ext/reflection/tests/bug30148.phpt +++ b/ext/reflection/tests/bug30148.phpt @@ -26,7 +26,8 @@ var_dump($d->isConstructor()); var_dump($e->isConstructor()); ?> ===DONE=== ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Root has a deprecated constructor in %s on line %d bool(true) bool(false) bool(true) diff --git a/ext/reflection/tests/bug36434.phpt b/ext/reflection/tests/bug36434.phpt index 218055d546..9598a40b7b 100644 --- a/ext/reflection/tests/bug36434.phpt +++ b/ext/reflection/tests/bug36434.phpt @@ -4,16 +4,16 @@ Reflection Bug #36434 (Properties from parent class fail to indetify their true <?php class ancester { -public $ancester = 0; - function ancester() + public $ancester = 0; + function __construct() { return $this->ancester; } } class foo extends ancester { -public $bar = "1"; - function foo() + public $bar = "1"; + function __construct() { return $this->bar; } diff --git a/ext/reflection/tests/bug38942.phpt b/ext/reflection/tests/bug38942.phpt index 817190c997..59666607cb 100644 --- a/ext/reflection/tests/bug38942.phpt +++ b/ext/reflection/tests/bug38942.phpt @@ -11,6 +11,7 @@ class bar extends foo { ReflectionClass::export("bar"); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; foo has a deprecated constructor in %s on line %d Class [ <user> class bar extends foo ] { @@ %sbug38942.php 6-7 diff --git a/ext/reflection/tests/bug47254.phpt b/ext/reflection/tests/bug47254.phpt index 83593a4ff2..38cdcd62b4 100644 --- a/ext/reflection/tests/bug47254.phpt +++ b/ext/reflection/tests/bug47254.phpt @@ -23,7 +23,10 @@ $m = $R->getMethods(); print_r($m); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; B has a deprecated constructor in %s on line %d Array ( [0] => ReflectionMethod Object diff --git a/ext/reflection/tests/parameters_002.phpt b/ext/reflection/tests/parameters_002.phpt index a86191042f..ae924323a0 100644 --- a/ext/reflection/tests/parameters_002.phpt +++ b/ext/reflection/tests/parameters_002.phpt @@ -3,13 +3,15 @@ ReflectionParameter::getClass(), getDeclaringClass(), getDeclaringFunction() --FILE-- <?php -function test($nix, Array $ar, &$ref, stdClass $std, NonExistingClass $na, stdClass &$opt = NULL, $def = "FooBar") +function test($nix, Array $ar, &$ref, stdClass $std, + NonExistingClass $na, stdClass &$opt = NULL, $def = "FooBar") { } class test { - function test($nix, Array $ar, &$ref, stdClass $std, NonExistingClass $na, stdClass $opt = NULL, $def = "FooBar") + function method($nix, Array $ar, &$ref, stdClass $std, + NonExistingClass $na, stdClass $opt = NULL, $def = "FooBar") { } } @@ -17,7 +19,8 @@ class test function check_params_decl_func($r, $f) { $c = $r->$f(); - echo $f . ': ' . ($c ? ($c instanceof ReflectionMethod ? $c->class . '::' : '') . $c->name : 'NULL') . "()\n"; + $sep = $c instanceof ReflectionMethod ? $c->class . '::' : ''; + echo $f . ': ' . ($c ? $sep . $c->name : 'NULL') . "()\n"; } function check_params_decl_class($r, $f) @@ -66,7 +69,7 @@ function check_params($r) check_params(new ReflectionFunction('test')); -check_params(new ReflectionMethod('test::test')); +check_params(new ReflectionMethod('test::method')); ?> ===DONE=== @@ -138,7 +141,7 @@ allowsNull: bool(true) isOptional: bool(true) isDefaultValueAvailable: bool(true) getDefaultValue: string(6) "FooBar" -#####test::test()##### +#####test::method()##### ===0=== getName: string(3) "nix" isPassedByReference: bool(false) diff --git a/ext/session/tests/006.phpt b/ext/session/tests/006.phpt index c9a11d3337..7653b8c167 100644 --- a/ext/session/tests/006.phpt +++ b/ext/session/tests/006.phpt @@ -21,7 +21,7 @@ class a { class b { public $a; - function b(&$a) { + function __construct(&$a) { $this->a = &$a; } } diff --git a/ext/session/tests/017.phpt b/ext/session/tests/017.phpt index dbe53f5698..baf7df8c57 100644 --- a/ext/session/tests/017.phpt +++ b/ext/session/tests/017.phpt @@ -13,7 +13,7 @@ session.save_handler=files error_reporting(E_ALL); class Kill { - function Kill() { + function __construct() { global $HTTP_SESSION_VARS; session_start(); } diff --git a/ext/session/tests/019.phpt b/ext/session/tests/019.phpt index 0f06add5a1..5825007000 100644 --- a/ext/session/tests/019.phpt +++ b/ext/session/tests/019.phpt @@ -15,7 +15,7 @@ error_reporting(E_ALL); class TFoo { public $c; - function TFoo($c) { + function __construct($c) { $this->c = $c; } function inc() { diff --git a/ext/session/tests/026.phpt b/ext/session/tests/026.phpt index f797286bf6..d29d6b57d2 100644 --- a/ext/session/tests/026.phpt +++ b/ext/session/tests/026.phpt @@ -21,7 +21,7 @@ class a { class b { public $a; - function b(&$a) { + function __construct(&$a) { $this->a = &$a; } } diff --git a/ext/soap/soap.c b/ext/soap/soap.c index ec4a5fd4c4..a452b631f3 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -2595,7 +2595,18 @@ static int do_request(zval *this_ptr, xmlDoc *request, char *location, char *act add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() failed", NULL, NULL); ret = FALSE; } else if (Z_TYPE_P(response) != IS_STRING) { - if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) == NULL) { + if (EG(exception) && instanceof_function(EG(exception)->ce, zend_get_engine_exception())) { + zval rv; + zend_string *msg; + zval exception_object; + + ZVAL_OBJ(&exception_object, EG(exception)); + msg = zval_get_string(zend_read_property(zend_exception_get_base(), &exception_object, "message", sizeof("message")-1, 0, &rv)); + /* change class */ + EG(exception)->ce = soap_fault_class_entry; + set_soap_fault(&exception_object, NULL, "Client", msg->val, NULL, NULL, NULL); + zend_string_release(msg); + } else if ((fault = zend_hash_str_find(Z_OBJPROP_P(this_ptr), "__soap_fault", sizeof("__soap_fault")-1)) == NULL) { add_soap_fault(this_ptr, "Client", "SoapClient::__doRequest() returned non string value", NULL, NULL); } ret = FALSE; diff --git a/ext/soap/tests/any.phpt b/ext/soap/tests/any.phpt index 93a0e6693a..7c0b7ff252 100644 --- a/ext/soap/tests/any.phpt +++ b/ext/soap/tests/any.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt index 61a2213ef0..b78142d44e 100644 --- a/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt +++ b/ext/soap/tests/interop/Round2/Base/r2_base_014p.phpt @@ -7,7 +7,7 @@ precision=14 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt index b03cc1969a..da78659a13 100644 --- a/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt +++ b/ext/soap/tests/interop/Round2/Base/r2_base_014w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt index 930c277149..bb532f46d0 100644 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt +++ b/ext/soap/tests/interop/Round2/Base/r2_base_015p.phpt @@ -7,7 +7,7 @@ precision=14 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt index e1052dfa9a..efbad5a121 100644 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt +++ b/ext/soap/tests/interop/Round2/Base/r2_base_015s.phpt @@ -7,7 +7,7 @@ precision=14 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt index 46b8d7d780..f4e24ad17b 100644 --- a/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt +++ b/ext/soap/tests/interop/Round2/Base/r2_base_015w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt index edff0a4d9b..c27c783b35 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound1_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class Person { - function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { + function __construct($a=NULL, $i=NULL, $n=NULL, $m=NULL) { $this->Age = $a; $this->ID = $i; $this->Name = $n; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt index b1a60df774..8e418e1c00 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_compound2_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class Person { - function Person($a=NULL, $i=NULL, $n=NULL, $m=NULL) { + function __construct($a=NULL, $i=NULL, $n=NULL, $m=NULL) { $this->Age = $a; $this->ID = $i; $this->Name = $n; @@ -16,7 +16,7 @@ class Person { } } class Employee { - function Employee($person=NULL,$id=NULL,$salary=NULL) { + function __construct($person=NULL,$id=NULL,$salary=NULL) { $this->person = $person; $this->ID = $id; $this->salary = $salary; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt index 2e74e7cfda..74f0ec0728 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclit_003w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt index 26ce8de282..e788ffefa3 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_doclitparams_003w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt index 270b30fc92..ed0387a17e 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import2_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt index 892ef45615..f732115b76 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt index e4279fc883..b2f740ce09 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_import3_002w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt index cc27d6f7b8..63bd4c7cf1 100644 --- a/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt +++ b/ext/soap/tests/interop/Round3/GroupD/r3_groupD_rpcenc_003w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt index 07b087ef46..11039c0f32 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_001w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt index efc25e272c..053581dfa0 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_002w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt index 705e2036ee..982114cded 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_003w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt index ade6d8329e..1c798aaf97 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_004w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt index 8d149a3048..4a0e047856 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_005w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt index 9726f848e3..694eb1a7f2 100644 --- a/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt +++ b/ext/soap/tests/interop/Round3/GroupE/r3_groupE_list_006w.phpt @@ -7,7 +7,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPList { - function SOAPList($s, $i, $c) { + function __construct($s, $i, $c) { $this->varString = $s; $this->varInt = $i; $this->child = $c; diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt index 27a0c9333c..3e1593382b 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt index 1ed1fe721c..b2cb8161f6 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_002w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt index fde7d75e47..3cf1236fc2 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_003w.phpt @@ -8,21 +8,21 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt index d448974f2d..1c07c32009 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_004w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt index 52451acffc..c2710fc742 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_005w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt index c9ad1c5f5d..31976b740f 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_006w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt index fac6c3b069..9db050ad67 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_007w.phpt @@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt index c020790b48..d420abe183 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_008w.phpt @@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt index f3a07d75e6..53c6b7fbc7 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_009w.phpt @@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt index 55d62c1db2..2e966e9a36 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_doclit_010w.phpt @@ -7,29 +7,29 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->structMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt index bf867d9c12..c1695268d7 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_001w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt index 6ac7641e2b..4bcdf1f441 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_002w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt index dda5b69e29..ec52aece46 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_003w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt index e4b29176cb..07cde239e8 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_004w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt index 074b258ab6..a68957441f 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_005w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt index 8fd9b3948b..bc0cef2ea2 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_006w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPStruct { - function SOAPStruct($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt index f54c18842d..fd2df8f425 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_007w.phpt @@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt index d6f16a7bbc..cc1fc72b9c 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_008w.phpt @@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt index 2bf73412ec..1a2d950577 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_009w.phpt @@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt index f1eeac2f26..906812e6b7 100644 --- a/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt +++ b/ext/soap/tests/interop/Round4/GroupH/r4_groupH_complex_rpcenc_010w.phpt @@ -8,22 +8,22 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class BaseStruct { - function BaseStruct($f, $s) { + function __construct($f, $s) { $this->floatMessage = $f; $this->shortMessage = $s; } } class ExtendedStruct extends BaseStruct { - function ExtendedStruct($f, $s, $x1, $x2, $x3) { - $this->BaseStruct($f,$s); + function __construct($f, $s, $x1, $x2, $x3) { + parent::__construct($f,$s); $this->stringMessage = $x1; $this->intMessage = $x2; $this->anotherIntMessage = $x3; } } class MoreExtendedStruct extends ExtendedStruct { - function MoreExtendedStruct($f, $s, $x1, $x2, $x3, $b) { - $this->ExtendedStruct($f, $s, $x1, $x2, $x3); + function __construct($f, $s, $x1, $x2, $x3, $b) { + parent::__construct($f, $s, $x1, $x2, $x3); $this->booleanMessage = $b; } } diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt index d9dbed46bc..2ebcabd1db 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_008w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt index 41bf371202..af0040f783 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_009w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt index f3150b5740..4bcda95e38 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_014w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt index 6f07000572..490d903e5a 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_015w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt index ea9bb0fe9c..4630add1c4 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_019w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt index 1b6382c447..0034ba82b0 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_020w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt index d312dbfac7..4afa56485b 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_023w.phpt @@ -8,14 +8,14 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; } } class SOAPComplexTypeComplexType { - function SOAPComplexTypeComplexType($s, $i, $f, $c) { + function __construct($s, $i, $f, $c) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt index dc4cdce636..f30f1afb31 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_024w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexTypeComplexType { - function SOAPComplexTypeComplexType($s, $i, $f, $c) { + function __construct($s, $i, $f, $c) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt index 9ff683188d..7b6d8eceb2 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_025w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPMultiOccursComplexType { - function SOAPMultiOccursComplexType($s, $i, $f, $c) { + function __construct($s, $i, $f, $c) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt index 5751a46e2c..a5ff11a7b3 100644 --- a/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt +++ b/ext/soap/tests/interop/Round4/GroupI/r4_groupI_xsd_028w.phpt @@ -8,7 +8,7 @@ soap.wsdl_cache_enabled=0 --FILE-- <?php class SOAPComplexType { - function SOAPComplexType($s, $i, $f) { + function __construct($s, $i, $f) { $this->varString = $s; $this->varInt = $i; $this->varFloat = $f; diff --git a/ext/soap/tests/server006.phpt b/ext/soap/tests/server006.phpt index da328ebfee..0c94fb2993 100644 --- a/ext/soap/tests/server006.phpt +++ b/ext/soap/tests/server006.phpt @@ -7,7 +7,7 @@ SOAP Server 6: setclass with constructor class Foo { private $str = ""; - function Foo($str) { + function __construct($str) { $this->str = $str . " World"; } diff --git a/ext/soap/tests/server008.phpt b/ext/soap/tests/server008.phpt index 87fb69d25f..d299a3ae9b 100644 --- a/ext/soap/tests/server008.phpt +++ b/ext/soap/tests/server008.phpt @@ -6,7 +6,7 @@ SOAP Server 8: setclass and getfunctions <?php class Foo { - function Foo() { + function __construct() { } function test() { @@ -22,7 +22,7 @@ echo "ok\n"; --EXPECT-- array(2) { [0]=> - string(3) "Foo" + string(11) "__construct" [1]=> string(4) "test" } diff --git a/ext/soap/tests/server027.phpt b/ext/soap/tests/server027.phpt index 9fee4a6087..188b94f10e 100644 --- a/ext/soap/tests/server027.phpt +++ b/ext/soap/tests/server027.phpt @@ -6,7 +6,7 @@ SOAP Server 27: setObject and getFunctions <?php class Foo { - function Foo() { + function __construct() { } function test() { @@ -23,7 +23,7 @@ echo "ok\n"; --EXPECT-- array(2) { [0]=> - string(3) "Foo" + string(11) "__construct" [1]=> string(4) "test" } diff --git a/ext/standard/tests/array/007.phpt b/ext/standard/tests/array/007.phpt index e30b8fe2c1..4a1270eca6 100644 --- a/ext/standard/tests/array/007.phpt +++ b/ext/standard/tests/array/007.phpt @@ -53,7 +53,7 @@ error_reporting(E_ALL); class cr { private $priv_member; public $public_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; $this->public_member = $val; } diff --git a/ext/standard/tests/array/array_intersect_1.phpt b/ext/standard/tests/array/array_intersect_1.phpt index 41f20330fd..ce8fdd1cac 100644 --- a/ext/standard/tests/array/array_intersect_1.phpt +++ b/ext/standard/tests/array/array_intersect_1.phpt @@ -6,7 +6,7 @@ error_reporting(E_ALL); class cr { private $priv_member; public $public_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; $this->public_member = $val; } diff --git a/ext/standard/tests/array/array_udiff_assoc_basic.phpt b/ext/standard/tests/array/array_udiff_assoc_basic.phpt index 769bafb76b..d115bcc326 100644 --- a/ext/standard/tests/array/array_udiff_assoc_basic.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_basic.phpt @@ -8,7 +8,7 @@ array_udiff_assoc(): Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -38,4 +38,4 @@ array(3) { ["priv_member":"cr":private]=> int(23) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/array_udiff_basic.phpt b/ext/standard/tests/array/array_udiff_basic.phpt index 3da1b60c5c..5dbece34cc 100644 --- a/ext/standard/tests/array/array_udiff_basic.phpt +++ b/ext/standard/tests/array/array_udiff_basic.phpt @@ -8,7 +8,7 @@ array_udiff():Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -33,4 +33,4 @@ array(2) { ["priv_member":"cr":private]=> int(23) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/array_udiff_uassoc_basic.phpt b/ext/standard/tests/array/array_udiff_uassoc_basic.phpt index 6095696f41..51b4bc1759 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_basic.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_basic.phpt @@ -8,7 +8,7 @@ array_udiff_uassoc(): Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -42,4 +42,4 @@ array(3) { ["priv_member":"cr":private]=> int(23) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/array_uintersect_assoc_basic.phpt b/ext/standard/tests/array/array_uintersect_assoc_basic.phpt index 7e9fff7875..d3645c7cea 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_basic.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_basic.phpt @@ -8,7 +8,7 @@ array_uintersect_assoc(): Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -33,4 +33,4 @@ array(2) { ["priv_member":"cr":private]=> int(-15) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/array_uintersect_basic.phpt b/ext/standard/tests/array/array_uintersect_basic.phpt index 8d4b803589..4965d599ba 100644 --- a/ext/standard/tests/array/array_uintersect_basic.phpt +++ b/ext/standard/tests/array/array_uintersect_basic.phpt @@ -8,7 +8,7 @@ array_uintersect(): Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -38,4 +38,4 @@ array(3) { ["priv_member":"cr":private]=> int(-15) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/array_uintersect_uassoc_basic.phpt b/ext/standard/tests/array/array_uintersect_uassoc_basic.phpt index a474bc7ff5..5e1ea1a7d9 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_basic.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_basic.phpt @@ -8,7 +8,7 @@ array_uintersect_uassoc(): Test return type and value for expected input */ class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { @@ -37,4 +37,4 @@ array(2) { ["priv_member":"cr":private]=> int(-15) } -}
\ No newline at end of file +} diff --git a/ext/standard/tests/array/bug45312.phpt b/ext/standard/tests/array/bug45312.phpt index 017defefae..858bdfa4bf 100644 --- a/ext/standard/tests/array/bug45312.phpt +++ b/ext/standard/tests/array/bug45312.phpt @@ -4,7 +4,7 @@ Bug #45312 (Segmentation fault on second request for array functions) <?php class cr { private $priv_member; - function cr($val) { + function __construct($val) { $this->priv_member = $val; } static function comp_func_cr($a, $b) { diff --git a/ext/standard/tests/file/bug38450.phpt b/ext/standard/tests/file/bug38450.phpt index d108897988..07e413b92b 100644 --- a/ext/standard/tests/file/bug38450.phpt +++ b/ext/standard/tests/file/bug38450.phpt @@ -7,7 +7,7 @@ class VariableStream { var $position; var $varname; - function VariableStream($var) { + function __construct($var) { var_dump("constructor!"); } @@ -102,7 +102,7 @@ var_dump($myvar); echo "Done\n"; ?> --EXPECTF-- -Warning: Missing argument 1 for VariableStream::VariableStream() in %s on line %d +Warning: Missing argument 1 for VariableStream::__construct() in %s on line %d string(12) "constructor!" line1 line2 diff --git a/ext/standard/tests/file/lstat_stat_variation18.phpt b/ext/standard/tests/file/lstat_stat_variation18.phpt index fc98739fa7..6ee563d684 100644 --- a/ext/standard/tests/file/lstat_stat_variation18.phpt +++ b/ext/standard/tests/file/lstat_stat_variation18.phpt @@ -30,7 +30,7 @@ echo "*** Testing stat() with filename & directory name stored inside an object class names { public $var_name; - public function names($name) { + public function __construct($name) { $this->var_name = $name; } } diff --git a/ext/standard/tests/file/lstat_stat_variation20.phpt b/ext/standard/tests/file/lstat_stat_variation20.phpt index 30b81ad8b1..8dcd70c798 100644 --- a/ext/standard/tests/file/lstat_stat_variation20.phpt +++ b/ext/standard/tests/file/lstat_stat_variation20.phpt @@ -29,7 +29,7 @@ symlink("$file_path/lstat_stat_variation20.tmp", "$file_path/lstat_stat_variatio echo "*** Testing lstat() with linkname stored inside an object/array ***\n"; class names { public $var_name; - public function names($name) { + public function __construct($name) { $this->var_name = $name; } } diff --git a/ext/standard/tests/file/readlink_realpath_variation1.phpt b/ext/standard/tests/file/readlink_realpath_variation1.phpt index 9c795e9794..341e39a9de 100644 --- a/ext/standard/tests/file/readlink_realpath_variation1.phpt +++ b/ext/standard/tests/file/readlink_realpath_variation1.phpt @@ -28,7 +28,7 @@ fclose($file_handle); // creating object with members as linkname class object_temp { public $linkname; - function object_temp($link) { + function __construct($link) { $this->linkname = $link; } } diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt index e3185c4036..b1b1afc740 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_variation1.phpt @@ -36,7 +36,7 @@ fclose($fp); echo "*** Testing symlink(), link(), linkinfo() and is_link() with linknames stored as members in an object ***\n"; class object_temp { var $linkname; - function object_temp($link) { + function __construct($link) { $this->linkname = $link; } } diff --git a/ext/standard/tests/filters/read.phpt b/ext/standard/tests/filters/read.phpt index a2372cf8f9..af915e370d 100644 --- a/ext/standard/tests/filters/read.phpt +++ b/ext/standard/tests/filters/read.phpt @@ -3,7 +3,7 @@ stream filter - reading --FILE-- <?php echo "-TEST\n"; -class filter extends php_user_filter { +class strtoupper_filter extends php_user_filter { function filter($in, $out, &$consumed, $closing) { $output = 0; @@ -21,7 +21,7 @@ class filter extends php_user_filter { return $output ? PSFS_PASS_ON : PSFS_FEED_ME; } } -stream_filter_register("strtoupper", "filter") +stream_filter_register("strtoupper", "strtoupper_filter") or die("Failed to register filter"); if ($f = fopen(__FILE__, "rb")) { @@ -37,7 +37,7 @@ echo "Done\n"; %sTEST <?PHP ECHO "-TEST\N"; -CLASS FILTER EXTENDS PHP_USER_FILTER { +CLASS STRTOUPPER_FILTER EXTENDS PHP_USER_FILTER { FUNCTION FILTER($IN, $OUT, &$CONSUMED, $CLOSING) { $OUTPUT = 0; @@ -55,7 +55,7 @@ CLASS FILTER EXTENDS PHP_USER_FILTER { RETURN $OUTPUT ? PSFS_PASS_ON : PSFS_FEED_ME; } } -STREAM_FILTER_REGISTER("STRTOUPPER", "FILTER") +STREAM_FILTER_REGISTER("STRTOUPPER", "STRTOUPPER_FILTER") OR DIE("FAILED TO REGISTER FILTER"); IF ($F = FOPEN(__FILE__, "RB")) { diff --git a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt index 4f286ec606..1f2b7e155d 100644 --- a/ext/standard/tests/general_functions/debug_zval_dump_o.phpt +++ b/ext/standard/tests/general_functions/debug_zval_dump_o.phpt @@ -39,7 +39,7 @@ class object_class { } public $array_var = array( "key1" => 1, "key2 " => 3); - function object_class () { + function __construct () { $this->value1 = 5; $this->object_class1 = $this; } @@ -65,7 +65,7 @@ class contains_object_class echo "func() is called \n"; } - function contains_object_class () { + function __construct () { $this->class_object1 = new object_class(); $this->class_object2 = new object_class(); $this->class_object3 = $this->class_object1; diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt index 43454733e8..b2762fd83a 100644 --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt @@ -38,7 +38,7 @@ class point var $x; var $y; - function point($x, $y) { + function __construct($x, $y) { $this->x = $x; $this->y = $y; } diff --git a/ext/standard/tests/general_functions/is_callable_basic2.phpt b/ext/standard/tests/general_functions/is_callable_basic2.phpt index c900032fea..d842534124 100644 --- a/ext/standard/tests/general_functions/is_callable_basic2.phpt +++ b/ext/standard/tests/general_functions/is_callable_basic2.phpt @@ -71,7 +71,7 @@ class contains_object_class echo "func() is called \n"; } - function contains_object_class () { + function __construct () { $this->class_object1 = new object_class(); $this->no_member_class_object = new no_member_class(); } @@ -784,4 +784,4 @@ bool(true) object_class::foo1 bool(true) object_class::foo1 -===DONE===
\ No newline at end of file +===DONE=== diff --git a/ext/standard/tests/general_functions/is_object.phpt b/ext/standard/tests/general_functions/is_object.phpt index 33fd422e76..89b5081fae 100644 --- a/ext/standard/tests/general_functions/is_object.phpt +++ b/ext/standard/tests/general_functions/is_object.phpt @@ -61,7 +61,7 @@ class myClass private $private_var; protected $protected_var; - function myClass ( ) { + function __construct ( ) { $this->foo_object = new foo(); $this->public_var = 10; $this->public_var1 = new foo(); diff --git a/ext/standard/tests/general_functions/print_r_64bit.phpt b/ext/standard/tests/general_functions/print_r_64bit.phpt index f3ebd58cc5..d62b3f9790 100644 --- a/ext/standard/tests/general_functions/print_r_64bit.phpt +++ b/ext/standard/tests/general_functions/print_r_64bit.phpt @@ -155,7 +155,7 @@ class object_class protected $protected_var1 = "string_1"; protected $protected_var2; - function object_class ( ) { + function __construct ( ) { $this->value = 50; $this->public_var2 = 11; $this->private_var2 = 21; @@ -191,7 +191,7 @@ class contains_object_class echo "func() is called \n"; } - function contains_object_class () { + function __construct () { $this->class_object1 = new object_class(); $this->class_object2 = new object_class(); $this->class_object3 = $this->class_object1; diff --git a/ext/standard/tests/general_functions/var_dump_64bit.phpt b/ext/standard/tests/general_functions/var_dump_64bit.phpt index a81980c02b..3672357936 100644 --- a/ext/standard/tests/general_functions/var_dump_64bit.phpt +++ b/ext/standard/tests/general_functions/var_dump_64bit.phpt @@ -148,7 +148,7 @@ class object_class protected $protected_var1 = "string_1"; protected $protected_var2; - function object_class ( ) { + function __construct ( ) { $this->value = 50; $this->public_var2 = 11; $this->private_var2 = 21; @@ -184,7 +184,7 @@ class contains_object_class echo "func() is called \n"; } - function contains_object_class () { + function __construct () { $this->class_object1 = new object_class(); $this->class_object2 = new object_class(); $this->class_object3 = $this->class_object1; diff --git a/ext/standard/tests/general_functions/var_export-locale.phpt b/ext/standard/tests/general_functions/var_export-locale.phpt index 76a18ac3a7..1cadb4aa55 100644 --- a/ext/standard/tests/general_functions/var_export-locale.phpt +++ b/ext/standard/tests/general_functions/var_export-locale.phpt @@ -233,7 +233,7 @@ class myClass private $private_var; protected $protected_var; - function myClass ( ) { + function __construct ( ) { $this->foo_object = new foo(); $this->public_var = 10; $this->public_var1 = new foo(); diff --git a/ext/standard/tests/general_functions/var_export_basic6.phpt b/ext/standard/tests/general_functions/var_export_basic6.phpt index 8935d0e79d..38fdb373df 100644 --- a/ext/standard/tests/general_functions/var_export_basic6.phpt +++ b/ext/standard/tests/general_functions/var_export_basic6.phpt @@ -61,7 +61,7 @@ class myClass private $private_var; protected $protected_var; - function myClass ( ) { + function __construct ( ) { $this->foo_object = new foo(); $this->public_var = 10; $this->public_var1 = new foo(); diff --git a/ext/standard/tests/serialize/001.phpt b/ext/standard/tests/serialize/001.phpt index 600c9b706d..e83b9af002 100644 --- a/ext/standard/tests/serialize/001.phpt +++ b/ext/standard/tests/serialize/001.phpt @@ -6,7 +6,7 @@ serialize_precision=100 <?php class t { - function t() + function __construct() { $this->a = "hallo"; } @@ -18,7 +18,7 @@ class s public $b; public $c; - function s() + function __construct() { $this->a = "hallo"; $this->b = "php"; diff --git a/ext/standard/tests/serialize/bug14293.phpt b/ext/standard/tests/serialize/bug14293.phpt index 3fca7e406e..8e7b8a9d7d 100644 --- a/ext/standard/tests/serialize/bug14293.phpt +++ b/ext/standard/tests/serialize/bug14293.phpt @@ -4,7 +4,7 @@ Bug #14293 (serialize() and __sleep()) <?php class t { - function t() + function __construct() { $this->a = 'hello'; } diff --git a/ext/standard/tests/serialize/bug21957.phpt b/ext/standard/tests/serialize/bug21957.phpt index 29eeb2ee6c..2084503d24 100644 --- a/ext/standard/tests/serialize/bug21957.phpt +++ b/ext/standard/tests/serialize/bug21957.phpt @@ -6,7 +6,7 @@ class test { public $a, $b; - function test() + function __construct() { $this->a = 7; $this->b = 2; diff --git a/ext/standard/tests/serialize/serialization_objects_003.phpt b/ext/standard/tests/serialize/serialization_objects_003.phpt index 2313ffab88..5e6773a2ae 100644 --- a/ext/standard/tests/serialize/serialization_objects_003.phpt +++ b/ext/standard/tests/serialize/serialization_objects_003.phpt @@ -19,7 +19,7 @@ echo "\n--- Testing Abstract Class ---\n"; // abstract class abstract class Name { - public function Name() { + public function __construct() { $this->a = 10; $this->b = 12.222; $this->c = "string"; diff --git a/ext/tidy/tests/027.phpt b/ext/tidy/tests/027.phpt index 8d9f66eaf7..cd984dd9e7 100644 --- a/ext/tidy/tests/027.phpt +++ b/ext/tidy/tests/027.phpt @@ -10,7 +10,7 @@ Bug: tidy segfaults with markup=false abstract class BaseClass { private static $tidyconfig; - public function BaseClass() { + public function __construct() { $this->tidyconfig = array( 'indent' => false, 'clean' => true, @@ -38,7 +38,7 @@ abstract class BaseClass { } class ChildClass extends BaseClass { - public function ChildClass() { + public function __construct() { parent::__construct(); } diff --git a/ext/xml/tests/bug32001.phpt b/ext/xml/tests/bug32001.phpt index 0853b3ab1c..b5d2a7b0bd 100644 --- a/ext/xml/tests/bug32001.phpt +++ b/ext/xml/tests/bug32001.phpt @@ -14,7 +14,7 @@ class testcase { private $tags; private $chunk_size; - function testcase($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { + function __construct($enc, $chunk_size = 0, $bom = 0, $omit_prologue = 0) { $this->encoding = $enc; $this->chunk_size = $chunk_size; $this->bom = $bom; diff --git a/ext/xsl/tests/xslt011.phpt b/ext/xsl/tests/xslt011.phpt index efa2dd7550..5ddb3dbbe6 100644 --- a/ext/xsl/tests/xslt011.phpt +++ b/ext/xsl/tests/xslt011.phpt @@ -6,7 +6,7 @@ Test 11: php:function Support <?php print "Test 11: php:function Support\n"; Class foo { - function foo() {} + function __construct() {} function __toString() { return "not a DomNode object";} } diff --git a/tests/classes/clone_006.phpt b/tests/classes/clone_006.phpt index de22fec151..15f0a5ec52 100644 --- a/tests/classes/clone_006.phpt +++ b/tests/classes/clone_006.phpt @@ -10,7 +10,7 @@ error_reporting=2047 class MyCloneable { static $id = 0; - function MyCloneable() { + function __construct() { $this->id = self::$id++; } diff --git a/tests/classes/ctor_dtor.phpt b/tests/classes/ctor_dtor.phpt index ea6813cc96..6af863e576 100644 --- a/tests/classes/ctor_dtor.phpt +++ b/tests/classes/ctor_dtor.phpt @@ -6,7 +6,7 @@ ZE2 The new constructor/destructor is called <?php class early { - function early() { + function __construct() { echo __CLASS__ . "::" . __FUNCTION__ . "\n"; } function __destruct() { @@ -24,7 +24,7 @@ class late { } $t = new early(); -$t->early(); +$t->__construct(); unset($t); $t = new late(); //unset($t); delay to end of script @@ -32,8 +32,8 @@ $t = new late(); echo "Done\n"; ?> --EXPECTF-- -early::early -early::early +early::__construct +early::__construct early::__destruct late::__construct Done diff --git a/tests/classes/ctor_name_clash.phpt b/tests/classes/ctor_name_clash.phpt index 1a1d6fa511..e6518775ff 100644 --- a/tests/classes/ctor_name_clash.phpt +++ b/tests/classes/ctor_name_clash.phpt @@ -18,5 +18,6 @@ $obj = new derived(); $obj->base(); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; base has a deprecated constructor in %s on line %d base::base derived::base diff --git a/tests/classes/dereferencing_001.phpt b/tests/classes/dereferencing_001.phpt index dd2aba78e5..886baeb288 100644 --- a/tests/classes/dereferencing_001.phpt +++ b/tests/classes/dereferencing_001.phpt @@ -6,7 +6,7 @@ ZE2 dereferencing of objects from methods <?php class Name { - function Name($_name) { + function __construct($_name) { $this->name = $_name; } @@ -18,7 +18,7 @@ class Name { class Person { private $name; - function person($_name, $_address) { + function __construct($_name, $_address) { $this->name = new Name($_name); } diff --git a/tests/classes/final_ctor1.phpt b/tests/classes/final_ctor1.phpt index ebfa08081e..acf20918fd 100644 --- a/tests/classes/final_ctor1.phpt +++ b/tests/classes/final_ctor1.phpt @@ -25,5 +25,6 @@ ReflectionClass::export('Extended'); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Extended has a deprecated constructor in %s on line %d Fatal error: Cannot override final Base::__construct() with Extended::Extended() in %sfinal_ctor1.php on line %d diff --git a/tests/classes/final_ctor2.phpt b/tests/classes/final_ctor2.phpt index 905337b408..37fcac29a9 100644 --- a/tests/classes/final_ctor2.phpt +++ b/tests/classes/final_ctor2.phpt @@ -25,5 +25,6 @@ ReflectionClass::export('Extended'); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Base has a deprecated constructor in %s on line %d Fatal error: Cannot override final Base::Base() with Extended::__construct() in %sfinal_ctor2.php on line %d diff --git a/tests/classes/final_ctor3.phpt b/tests/classes/final_ctor3.phpt index 3a61ecf902..b34996c979 100644 --- a/tests/classes/final_ctor3.phpt +++ b/tests/classes/final_ctor3.phpt @@ -10,4 +10,6 @@ Ensure implicit final inherited old-style constructor cannot be overridden. } ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d + Fatal error: Cannot override final method A::A() in %s on line %d diff --git a/tests/classes/inheritance_002.phpt b/tests/classes/inheritance_002.phpt index 0b8cf2650e..7669f735e5 100644 --- a/tests/classes/inheritance_002.phpt +++ b/tests/classes/inheritance_002.phpt @@ -17,13 +17,13 @@ class Child_php4 extends Base_php4 { } } -class Base_php7 { +class Base_php5 { function __construct() { var_dump('Base constructor'); } } -class Child_php7 extends Base_php7 { +class Child_php5 extends Base_php5 { function __construct() { var_dump('Child constructor'); parent::__construct(); @@ -37,7 +37,7 @@ class Child_mx1 extends Base_php4 { } } -class Child_mx2 extends Base_php7 { +class Child_mx2 extends Base_php5 { function Child_mx2() { var_dump('Child constructor'); parent::__construct(); @@ -47,8 +47,8 @@ class Child_mx2 extends Base_php7 { echo "### PHP 4 style\n"; $c4= new Child_php4(); -echo "### PHP 7 style\n"; -$c5= new Child_php7(); +echo "### PHP 5 style\n"; +$c5= new Child_php5(); echo "### Mixed style 1\n"; $cm= new Child_mx1(); @@ -56,11 +56,16 @@ $cm= new Child_mx1(); echo "### Mixed style 2\n"; $cm= new Child_mx2(); ?> ---EXPECT-- +--EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Base_php4 has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Child_php4 has a deprecated constructor in %s on line %d + +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Child_mx2 has a deprecated constructor in %s on line %d ### PHP 4 style string(17) "Child constructor" string(16) "Base constructor" -### PHP 7 style +### PHP 5 style string(17) "Child constructor" string(16) "Base constructor" ### Mixed style 1 diff --git a/tests/classes/inheritance_005.phpt b/tests/classes/inheritance_005.phpt index 8990264d92..7399bf1168 100644 --- a/tests/classes/inheritance_005.phpt +++ b/tests/classes/inheritance_005.phpt @@ -41,6 +41,7 @@ Check for inherited old-style constructor. var_dump(is_callable(array($c, "C"))); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d About to construct new B: In A::A Is B::B() callable? diff --git a/tests/classes/inheritance_007.phpt b/tests/classes/inheritance_007.phpt index 46100449c4..c87fbde344 100644 --- a/tests/classes/inheritance_007.phpt +++ b/tests/classes/inheritance_007.phpt @@ -18,6 +18,7 @@ $b->b(); ?> --EXPECTF-- +Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; A has a deprecated constructor in %s on line %d array(2) { [0]=> object(ReflectionMethod)#%d (2) { diff --git a/tests/classes/object_reference_001.phpt b/tests/classes/object_reference_001.phpt index 74acb5de13..f114d1aa95 100644 --- a/tests/classes/object_reference_001.phpt +++ b/tests/classes/object_reference_001.phpt @@ -8,7 +8,7 @@ ZE2 object references class Foo { public $name; - function Foo() { + function __construct() { $this->name = "I'm Foo!\n"; } } diff --git a/tests/lang/028.phpt b/tests/lang/028.phpt index bd4525ee60..2c51b79cb2 100644 --- a/tests/lang/028.phpt +++ b/tests/lang/028.phpt @@ -28,7 +28,7 @@ function dafna() class dafna_class { - function dafna_class() { + function __construct() { $this->myname = "Dafna"; } function GetMyName() { diff --git a/tests/lang/030.phpt b/tests/lang/030.phpt index 758369bf08..9ee40ea5aa 100644 --- a/tests/lang/030.phpt +++ b/tests/lang/030.phpt @@ -3,7 +3,7 @@ $this in constructor test --FILE-- <?php class foo { - function foo($name) { + function __construct($name) { $GLOBALS['List']= &$this; $this->Name = $name; $GLOBALS['List']->echoName(); diff --git a/tests/lang/035.phpt b/tests/lang/035.phpt index 9472999f47..a5e3a7f4cc 100644 --- a/tests/lang/035.phpt +++ b/tests/lang/035.phpt @@ -5,7 +5,7 @@ ZE2: set_exception_handler() --FILE-- <?php class MyException extends Exception { - function MyException($_error) { + function __construct($_error) { $this->error = $_error; } diff --git a/tests/lang/bug20175.phpt b/tests/lang/bug20175.phpt index bee3688d66..a3fdd297e1 100644 --- a/tests/lang/bug20175.phpt +++ b/tests/lang/bug20175.phpt @@ -95,7 +95,7 @@ $oop_global = 0; class oop_class { var $oop_name; - function oop_class() { + function __construct() { global $oop_global; echo "oop_class()\n"; $this->oop_name = 'oop:' . ++$oop_global; @@ -105,7 +105,7 @@ class oop_class { class oop_test { static $oop_value; - function oop_test() { + function __construct() { echo "oop_test()\n"; } diff --git a/tests/lang/bug21849.phpt b/tests/lang/bug21849.phpt index 30b311320b..2ce99769d9 100644 --- a/tests/lang/bug21849.phpt +++ b/tests/lang/bug21849.phpt @@ -5,7 +5,7 @@ Bug #21849 (self::constant doesn't work as method's default parameter) class foo { const bar = "fubar\n"; - function foo($arg = self::bar) { + function __construct($arg = self::bar) { echo $arg; } } diff --git a/tests/lang/bug21961.phpt b/tests/lang/bug21961.phpt index 24581d663e..9b7199208d 100644 --- a/tests/lang/bug21961.phpt +++ b/tests/lang/bug21961.phpt @@ -8,7 +8,7 @@ Bug #21961 (get_parent_class() segfault) class man { public $name, $bars; - function man() + function __construct() { $this->name = 'Mr. X'; $this->bars = array(); @@ -29,7 +29,7 @@ class bar extends man { public $name; - function bar($w) + function __construct($w) { $this->name = $w; } diff --git a/tests/lang/bug23489.phpt b/tests/lang/bug23489.phpt index 645bb1b7df..c8535c5123 100644 --- a/tests/lang/bug23489.phpt +++ b/tests/lang/bug23489.phpt @@ -3,7 +3,7 @@ Bug #23489 (ob_start() is broken with method callbacks) --FILE-- <?php class Test { - function Test() { + function __construct() { ob_start( array( $this, 'transform' diff --git a/tests/lang/bug24926.phpt b/tests/lang/bug24926.phpt index 3d2cc7008b..8f853dba47 100644 --- a/tests/lang/bug24926.phpt +++ b/tests/lang/bug24926.phpt @@ -9,7 +9,7 @@ class foo { public $functions = array(); - function foo() + function __construct() { $function = create_function('', 'return "FOO\n";'); print($function()); diff --git a/tests/lang/bug27535.phpt b/tests/lang/bug27535.phpt index a6ceae7463..29fd033469 100644 --- a/tests/lang/bug27535.phpt +++ b/tests/lang/bug27535.phpt @@ -12,7 +12,7 @@ class Class2 { public $storage = ''; - function Class2() + function __construct() { $this->storage = new Class1(); diff --git a/tests/lang/error_2_exception_001.phpt b/tests/lang/error_2_exception_001.phpt index 61f45d47d5..9596ba2331 100644 --- a/tests/lang/error_2_exception_001.phpt +++ b/tests/lang/error_2_exception_001.phpt @@ -6,7 +6,7 @@ ZE2 errors caught as exceptions <?php class MyException extends Exception { - function MyException($_errno, $_errmsg) { + function __construct($_errno, $_errmsg) { $this->errno = $_errno; $this->errmsg = $_errmsg; } |