From fd2db1192997f5778139ea8e9d25189c7c08af2c Mon Sep 17 00:00:00 2001 From: Nikita Popov Date: Wed, 27 Mar 2019 16:58:30 +0100 Subject: [PATCH] Always generate fatal error for LSP failures RFC: https://wiki.php.net/rfc/lsp_errors --- UPGRADING | 4 ++ Zend/tests/argument_restriction_001.phpt | 2 +- Zend/tests/argument_restriction_002.phpt | 2 +- Zend/tests/argument_restriction_003.phpt | 2 +- Zend/tests/argument_restriction_006.phpt | 2 +- Zend/tests/bug47981.phpt | 17 ----- Zend/tests/bug60573.phpt | 30 +-------- Zend/tests/bug60573_2.phpt | 64 +++++++++++++++++++ Zend/tests/bug63336.phpt | 22 ------- Zend/tests/bug64988.phpt | 3 +- Zend/tests/bug65322.phpt | 4 +- Zend/tests/bug67436/b.inc | 4 +- Zend/tests/bug67436/bug67436.phpt | 4 ++ Zend/tests/bug67436/bug67436_nohandler.phpt | 2 +- Zend/tests/bug70957.phpt | 2 +- Zend/tests/bug71428.1.phpt | 2 +- Zend/tests/bug71428.3.phpt | 2 +- Zend/tests/errmsg_045.phpt | 4 +- Zend/tests/objects_002.phpt | 4 +- Zend/tests/objects_003.phpt | 4 +- Zend/tests/objects_004.phpt | 4 +- Zend/tests/objects_005.phpt | 4 +- Zend/tests/objects_006.phpt | 4 +- Zend/tests/objects_007.phpt | 4 +- Zend/tests/objects_008.phpt | 4 +- Zend/tests/return_types/bug71978.phpt | 10 +-- .../tests/type_declarations/iterable_004.phpt | 2 +- .../parameter_type_variance.phpt | 16 +---- .../parameter_type_variance_2.phpt | 22 +++++++ Zend/zend_inheritance.c | 24 +------ ext/date/tests/ExtendDateTime.phpt | 2 +- ext/pdo_mysql/tests/pdo_mysql_subclass.phpt | 6 +- .../tests/filters/php_user_filter_01.phpt | 2 +- .../tests/filters/php_user_filter_02.phpt | 2 +- .../tests/filters/php_user_filter_03.phpt | 2 +- tests/classes/inheritance_003.phpt | 4 +- tests/classes/inheritance_004.phpt | 6 +- .../method_override_optional_arg_001.phpt | 4 +- .../method_override_optional_arg_002.phpt | 3 +- tests/classes/type_hinting_005a.phpt | 10 +-- tests/classes/type_hinting_005c.phpt | 7 +- tests/classes/type_hinting_005d.phpt | 7 +- 42 files changed, 143 insertions(+), 186 deletions(-) delete mode 100644 Zend/tests/bug47981.phpt create mode 100644 Zend/tests/bug60573_2.phpt delete mode 100644 Zend/tests/bug63336.phpt create mode 100644 Zend/tests/type_declarations/parameter_type_variance_2.phpt diff --git a/UPGRADING b/UPGRADING index 93376b6fa4e..8dbcbc93110 100644 --- a/UPGRADING +++ b/UPGRADING @@ -66,6 +66,10 @@ PHP 8.0 UPGRADE NOTES Additionally, care should be taken that error messages are not displayed in production environments, which can result in information leaks. Please ensure that display_errors=Off is used in conjunction with error logging. + . Inheritance errors due to incompatible method signatures (LSP violations) + will now always generate a fatal error. Previously a warning was generated + in some cases. + RFC: https://wiki.php.net/rfc/lsp_errors - COM: . Removed the ability to import case-insensitive constants from type diff --git a/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt index 9c21dc2ccea..2cd527f4fa9 100644 --- a/Zend/tests/argument_restriction_001.phpt +++ b/Zend/tests/argument_restriction_001.phpt @@ -13,4 +13,4 @@ class Sub extends Base { } ?> --EXPECTF-- -Warning: Declaration of & Sub::test() should be compatible with & Base::test($foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_001.php on line %d +Fatal error: Declaration of & Sub::test() must be compatible with & Base::test($foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_001.php on line %d diff --git a/Zend/tests/argument_restriction_002.phpt b/Zend/tests/argument_restriction_002.phpt index 4deb2d206b1..511e4d33320 100644 --- a/Zend/tests/argument_restriction_002.phpt +++ b/Zend/tests/argument_restriction_002.phpt @@ -13,4 +13,4 @@ class Sub extends Base { } ?> --EXPECTF-- -Warning: Declaration of Sub::test($foo, array &$bar) should be compatible with Base::test($foo, array &$bar, $option = NULL, $extra = 3.1415926535898) in %sargument_restriction_002.php on line %d +Fatal error: Declaration of Sub::test($foo, array &$bar) must be compatible with Base::test($foo, array &$bar, $option = NULL, $extra = 3.1415926535898) in %sargument_restriction_002.php on line %d diff --git a/Zend/tests/argument_restriction_003.phpt b/Zend/tests/argument_restriction_003.phpt index c24e0ba852b..fb602194bb5 100644 --- a/Zend/tests/argument_restriction_003.phpt +++ b/Zend/tests/argument_restriction_003.phpt @@ -16,4 +16,4 @@ class Sub extends Base { } ?> --EXPECTF-- -Warning: Declaration of Sub::test() should be compatible with Base::test(Foo $foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_003.php on line %d +Fatal error: Declaration of Sub::test() must be compatible with Base::test(Foo $foo, array $bar, $option = NULL, $extra = 'llllllllll...') in %sargument_restriction_003.php on line %d diff --git a/Zend/tests/argument_restriction_006.phpt b/Zend/tests/argument_restriction_006.phpt index 2df0e1e90d8..788670cd517 100644 --- a/Zend/tests/argument_restriction_006.phpt +++ b/Zend/tests/argument_restriction_006.phpt @@ -13,4 +13,4 @@ class Sub extends Base { } ?> --EXPECTF-- -Warning: Declaration of Sub::test($foo, $extra) should be compatible with Base::test($foo, $extra = Array) in %sargument_restriction_006.php on line %d +Fatal error: Declaration of Sub::test($foo, $extra) must be compatible with Base::test($foo, $extra = Array) in %sargument_restriction_006.php on line %d diff --git a/Zend/tests/bug47981.phpt b/Zend/tests/bug47981.phpt deleted file mode 100644 index fba320bb134..00000000000 --- a/Zend/tests/bug47981.phpt +++ /dev/null @@ -1,17 +0,0 @@ ---TEST-- -Bug #47981 (error handler not called regardless) ---INI-- -error_reporting=0 ---FILE-- - ---EXPECT-- -string(60) "Declaration of c::f() should be compatible with b::f($a = 1)" diff --git a/Zend/tests/bug60573.phpt b/Zend/tests/bug60573.phpt index 871be56a160..50650f54197 100644 --- a/Zend/tests/bug60573.phpt +++ b/Zend/tests/bug60573.phpt @@ -53,32 +53,6 @@ public function setSelf(self $s) { } } -class Foo5 extends Base { - -public function setSelf(parent $s) { } - -} - -class Bar5 extends Foo5 { - -public function setSelf(parent $s) { } - -} - -abstract class Foo6 extends Base { - -abstract public function setSelf(parent $s); - -} - -class Bar6 extends Foo6 { - -public function setSelf(Foo6 $s) { } - -} +?> --EXPECTF-- -Warning: Declaration of Bar4::setSelf(Bar4 $s) should be compatible with Foo4::setSelf(Foo4 $s) in %sbug60573.php on line %d - -Warning: Declaration of Bar5::setSelf(Foo5 $s) should be compatible with Foo5::setSelf(Base $s) in %sbug60573.php on line %d - -Fatal error: Declaration of Bar6::setSelf(Foo6 $s) must be compatible with Foo6::setSelf(Base $s) in %sbug60573.php on line %d +Fatal error: Declaration of Bar4::setSelf(Bar4 $s) must be compatible with Foo4::setSelf(Foo4 $s) in %s on line %d diff --git a/Zend/tests/bug60573_2.phpt b/Zend/tests/bug60573_2.phpt new file mode 100644 index 00000000000..221745316a8 --- /dev/null +++ b/Zend/tests/bug60573_2.phpt @@ -0,0 +1,64 @@ +--TEST-- +Bug #60573 (type hinting with "self" keyword causes weird errors) -- variation 2 +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of Bar5::setSelf(Foo5 $s) must be compatible with Foo5::setSelf(Base $s) in %sbug60573_2.php on line %d diff --git a/Zend/tests/bug63336.phpt b/Zend/tests/bug63336.phpt deleted file mode 100644 index 271d3e82a97..00000000000 --- a/Zend/tests/bug63336.phpt +++ /dev/null @@ -1,22 +0,0 @@ ---TEST-- -Bug #63336 (invalid E_NOTICE error occur) ---FILE-- - ---EXPECTF-- -Warning: Declaration of Child::foo($var = TEST, array $more = Array) should be compatible with Base::foo($var = TEST, $more = NULL) in %sbug63336.php on line %d - -Warning: Declaration of Child::bar($var, $more = self::DUMMY) should be compatible with Base::bar($more = self::DUMMY) in %sbug63336.php on line %d diff --git a/Zend/tests/bug64988.phpt b/Zend/tests/bug64988.phpt index 671d69de3b1..7ca642d6bf5 100644 --- a/Zend/tests/bug64988.phpt +++ b/Zend/tests/bug64988.phpt @@ -26,5 +26,4 @@ $o = new Smooth1(); echo "okey"; ?> --EXPECTF-- -Warning: Declaration of Smooth1::insert(array $data) should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 17 -okey +Fatal error: Declaration of Smooth1::insert(array $data) must be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 17 diff --git a/Zend/tests/bug65322.phpt b/Zend/tests/bug65322.phpt index 4985ae55d66..2ae2780bb62 100644 --- a/Zend/tests/bug65322.phpt +++ b/Zend/tests/bug65322.phpt @@ -15,10 +15,10 @@ set_error_handler(function($_, $msg, $file) { /* 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('class A { function test() { } } class B extends A { function test($a) { } }'); +eval('class A { private function __invoke() { } }'); ?> --EXPECTF-- -string(62) "Declaration of B::test($a) should be compatible with A::test()" +string(76) "The magic method __invoke() must have public visibility and cannot be static" string(%d) "%s(%d) : eval()'d code" string(1) "X" diff --git a/Zend/tests/bug67436/b.inc b/Zend/tests/bug67436/b.inc index 793a1394d67..bb2521f61f7 100644 --- a/Zend/tests/bug67436/b.inc +++ b/Zend/tests/bug67436/b.inc @@ -1,7 +1,9 @@ --FILE-- test(); --EXPECT-- +string(76) "The magic method __invoke() must have public visibility and cannot be static" b::test() a::test(c::TESTCONSTANT) diff --git a/Zend/tests/bug67436/bug67436_nohandler.phpt b/Zend/tests/bug67436/bug67436_nohandler.phpt index 74ea394f5d8..242073a965f 100644 --- a/Zend/tests/bug67436/bug67436_nohandler.phpt +++ b/Zend/tests/bug67436/bug67436_nohandler.phpt @@ -14,6 +14,6 @@ a::staticTest(); $b = new b(); $b->test(); --EXPECTF-- -Warning: Declaration of b::test() should be compatible with a::test($arg = c::TESTCONSTANT) in %s%ebug67436%eb.inc on line %d +Warning: The magic method __invoke() must have public visibility and cannot be static in %s on line %d b::test() a::test(c::TESTCONSTANT) diff --git a/Zend/tests/bug70957.phpt b/Zend/tests/bug70957.phpt index 7db7d7d0236..ad2115e4a0b 100644 --- a/Zend/tests/bug70957.phpt +++ b/Zend/tests/bug70957.phpt @@ -19,4 +19,4 @@ class B extends Foo } ?> --EXPECTF-- -Warning: Declaration of T::bar() should be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d +Fatal error: Declaration of T::bar() must be compatible with Foo::bar($a = 'Foo') in %sbug70957.php on line %d diff --git a/Zend/tests/bug71428.1.phpt b/Zend/tests/bug71428.1.phpt index 490fc30070f..acecd85fc57 100644 --- a/Zend/tests/bug71428.1.phpt +++ b/Zend/tests/bug71428.1.phpt @@ -9,4 +9,4 @@ class B extends A { public function m(array $a = []) {} } --EXPECTF-- -Warning: Declaration of B::m(array $a = Array) should be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 6 +Fatal error: Declaration of B::m(array $a = Array) must be compatible with A::m(?array $a = NULL) in %sbug71428.1.php on line 6 diff --git a/Zend/tests/bug71428.3.phpt b/Zend/tests/bug71428.3.phpt index 78fff6e70d1..ab3cc9ae160 100644 --- a/Zend/tests/bug71428.3.phpt +++ b/Zend/tests/bug71428.3.phpt @@ -7,4 +7,4 @@ class B { public function m(A $a = NULL, $n) { echo "B.m";} }; class C extends B { public function m(A $a , $n) { echo "C.m";} }; ?> --EXPECTF-- -Warning: Declaration of C::m(A $a, $n) should be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4 +Fatal error: Declaration of C::m(A $a, $n) must be compatible with B::m(?A $a, $n) in %sbug71428.3.php on line 4 diff --git a/Zend/tests/errmsg_045.phpt b/Zend/tests/errmsg_045.phpt index fbb2528e28c..5a4deadb592 100644 --- a/Zend/tests/errmsg_045.phpt +++ b/Zend/tests/errmsg_045.phpt @@ -10,11 +10,11 @@ set_error_handler(function($_, $msg, $file) { /* 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('class A { function test() { } } class B extends A { function test($a) { } }'); +eval('class A { private function __invoke() { } }'); ?> --EXPECTF-- -string(62) "Declaration of B::test($a) should be compatible with A::test()" +string(76) "The magic method __invoke() must have public visibility and cannot be static" string(%d) "%s(%d) : eval()'d code" Notice: Undefined variable: undefined in %s on line %d diff --git a/Zend/tests/objects_002.phpt b/Zend/tests/objects_002.phpt index 1c45b2230c9..66cc09129f9 100644 --- a/Zend/tests/objects_002.phpt +++ b/Zend/tests/objects_002.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo($arg) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo($arg) should be compatible with test::foo() in %s on line %d -Done +Fatal error: Declaration of test3::foo($arg) must be compatible with test::foo() in %s on line %d diff --git a/Zend/tests/objects_003.phpt b/Zend/tests/objects_003.phpt index 4486888c40c..300cda0cd90 100644 --- a/Zend/tests/objects_003.phpt +++ b/Zend/tests/objects_003.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo($arg, $arg2) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo($arg, $arg2) should be compatible with test::foo($arg) in %s on line %d -Done +Fatal error: Declaration of test3::foo($arg, $arg2) must be compatible with test::foo($arg) in %s on line %d diff --git a/Zend/tests/objects_004.phpt b/Zend/tests/objects_004.phpt index 1cc90384a7a..7c9ca452c8e 100644 --- a/Zend/tests/objects_004.phpt +++ b/Zend/tests/objects_004.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo(&$arg) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo(&$arg) should be compatible with test::foo($arg) in %s on line %d -Done +Fatal error: Declaration of test3::foo(&$arg) must be compatible with test::foo($arg) in %s on line %d diff --git a/Zend/tests/objects_005.phpt b/Zend/tests/objects_005.phpt index a2369b731a3..6007ccbbc9f 100644 --- a/Zend/tests/objects_005.phpt +++ b/Zend/tests/objects_005.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo() {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with & test::foo() in %s on line %d -Done +Fatal error: Declaration of test3::foo() must be compatible with & test::foo() in %s on line %d diff --git a/Zend/tests/objects_006.phpt b/Zend/tests/objects_006.phpt index ed6ea6047af..e5203421800 100644 --- a/Zend/tests/objects_006.phpt +++ b/Zend/tests/objects_006.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo($arg, $arg2) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo($arg, $arg2) should be compatible with test::foo($arg, $arg2 = NULL) in %s on line %d -Done +Fatal error: Declaration of test3::foo($arg, $arg2) must be compatible with test::foo($arg, $arg2 = NULL) in %s on line %d diff --git a/Zend/tests/objects_007.phpt b/Zend/tests/objects_007.phpt index 3094d60e8e2..2df30b9068f 100644 --- a/Zend/tests/objects_007.phpt +++ b/Zend/tests/objects_007.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo($arg, &$arg2) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo($arg, &$arg2) should be compatible with test::foo($arg, &$arg2 = NULL) in %s on line %d -Done +Fatal error: Declaration of test3::foo($arg, &$arg2) must be compatible with test::foo($arg, &$arg2 = NULL) in %s on line %d diff --git a/Zend/tests/objects_008.phpt b/Zend/tests/objects_008.phpt index 6554be99eba..b563061051f 100644 --- a/Zend/tests/objects_008.phpt +++ b/Zend/tests/objects_008.phpt @@ -17,8 +17,6 @@ class test3 extends test { function foo(Test3 $arg) {} } -echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo(Test3 $arg) should be compatible with test::foo(Test $arg) in %s on line %d -Done +Fatal error: Declaration of test3::foo(Test3 $arg) must be compatible with test::foo(Test $arg) in %s on line %d diff --git a/Zend/tests/return_types/bug71978.phpt b/Zend/tests/return_types/bug71978.phpt index e3c84402123..cfe8905dece 100644 --- a/Zend/tests/return_types/bug71978.phpt +++ b/Zend/tests/return_types/bug71978.phpt @@ -2,12 +2,6 @@ Bug #71978 (Existence of return type hint affects other compatibility rules) --FILE-- --EXPECTF-- -Warning: Declaration of B::foo(string $a) should be compatible with A::foo(int $a) in %s on line %d - -Warning: Declaration of B1::foo(string $a): int should be compatible with A1::foo(int $a): int in %s on line %d +Fatal error: Declaration of B1::foo(string $a): int must be compatible with A1::foo(int $a): int in %s on line %d diff --git a/Zend/tests/type_declarations/iterable_004.phpt b/Zend/tests/type_declarations/iterable_004.phpt index 58b3f67f400..fe9d4461b98 100644 --- a/Zend/tests/type_declarations/iterable_004.phpt +++ b/Zend/tests/type_declarations/iterable_004.phpt @@ -21,4 +21,4 @@ class Bar extends Foo { ?> --EXPECTF-- -Warning: Declaration of Bar::testScalar(iterable $iterable) should be compatible with Foo::testScalar(int $int) in %s on line %d +Fatal error: Declaration of Bar::testScalar(iterable $iterable) must be compatible with Foo::testScalar(int $int) in %s on line %d diff --git a/Zend/tests/type_declarations/parameter_type_variance.phpt b/Zend/tests/type_declarations/parameter_type_variance.phpt index 61915a2e6c0..e4e54009575 100644 --- a/Zend/tests/type_declarations/parameter_type_variance.phpt +++ b/Zend/tests/type_declarations/parameter_type_variance.phpt @@ -1,5 +1,5 @@ --TEST-- -Parameter variance with no type +Parameter variance with no type (class) --FILE-- --EXPECTF-- -Warning: Declaration of Bar::testChildClass(Foo $foo) should be compatible with Foo::testChildClass($foo) in %s on line %d - -Warning: Declaration of Bar::testChildBuiltin(int $foo) should be compatible with Foo::testChildBuiltin($foo) in %s on line %d +Fatal error: Declaration of Bar::testChildClass(Foo $foo) must be compatible with Foo::testChildClass($foo) in %s on line %d diff --git a/Zend/tests/type_declarations/parameter_type_variance_2.phpt b/Zend/tests/type_declarations/parameter_type_variance_2.phpt new file mode 100644 index 00000000000..59f10b28f51 --- /dev/null +++ b/Zend/tests/type_declarations/parameter_type_variance_2.phpt @@ -0,0 +1,22 @@ +--TEST-- +Parameter variance with no type (builtin) +--FILE-- + +--EXPECTF-- +Fatal error: Declaration of Bar::testChildBuiltin(int $foo) must be compatible with Foo::testChildBuiltin($foo) in %s on line %d diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index a4e437f2712..48e277d5d83 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -633,29 +633,11 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * } if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) { - int error_level; - const char *error_verb; zend_string *method_prototype = zend_get_function_declaration(parent); zend_string *child_prototype = zend_get_function_declaration(child); - - if (child->common.prototype && ( - child->common.prototype->common.fn_flags & ZEND_ACC_ABSTRACT - )) { - error_level = E_COMPILE_ERROR; - error_verb = "must"; - } else if ((parent->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) && - (!(child->common.fn_flags & ZEND_ACC_HAS_RETURN_TYPE) || - !zend_do_perform_type_hint_check(child, child->common.arg_info - 1, parent, parent->common.arg_info - 1) || - (ZEND_TYPE_ALLOW_NULL(child->common.arg_info[-1].type) && !ZEND_TYPE_ALLOW_NULL(parent->common.arg_info[-1].type)))) { - error_level = E_COMPILE_ERROR; - error_verb = "must"; - } else { - error_level = E_WARNING; - error_verb = "should"; - } - zend_error_at(error_level, NULL, func_lineno(child), - "Declaration of %s %s be compatible with %s", - ZSTR_VAL(child_prototype), error_verb, ZSTR_VAL(method_prototype)); + zend_error_at(E_COMPILE_ERROR, NULL, func_lineno(child), + "Declaration of %s must be compatible with %s", + ZSTR_VAL(child_prototype), ZSTR_VAL(method_prototype)); zend_string_efree(child_prototype); zend_string_efree(method_prototype); } diff --git a/ext/date/tests/ExtendDateTime.phpt b/ext/date/tests/ExtendDateTime.phpt index 164221709c4..212d44ab822 100644 --- a/ext/date/tests/ExtendDateTime.phpt +++ b/ext/date/tests/ExtendDateTime.phpt @@ -9,4 +9,4 @@ class MyDateTime extends DateTime { } ?> --EXPECTF-- -Warning: Declaration of MyDateTime::__set_state() should be compatible with DateTime::__set_state(array $array) in %s on line %d +Fatal error: Declaration of MyDateTime::__set_state() must be compatible with DateTime::__set_state(array $array) in %s on line %d diff --git a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt index 915df7d69f7..abbb2f04bea 100644 --- a/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt +++ b/ext/pdo_mysql/tests/pdo_mysql_subclass.phpt @@ -10,10 +10,6 @@ MySQLPDOTest::skip(); protocol(); return call_user_func_array(array($this, 'parent::exec'), func_get_args()); } diff --git a/ext/standard/tests/filters/php_user_filter_01.phpt b/ext/standard/tests/filters/php_user_filter_01.phpt index ff5a51f5bec..fb47177f4c6 100644 --- a/ext/standard/tests/filters/php_user_filter_01.phpt +++ b/ext/standard/tests/filters/php_user_filter_01.phpt @@ -14,4 +14,4 @@ class bar extends php_user_filter { } ?> --EXPECTF-- -Warning: Declaration of bar::filter($in, $out, &$consumed) should be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d +Fatal error: Declaration of bar::filter($in, $out, &$consumed) must be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d diff --git a/ext/standard/tests/filters/php_user_filter_02.phpt b/ext/standard/tests/filters/php_user_filter_02.phpt index bdd73c01a80..fd0822153b1 100644 --- a/ext/standard/tests/filters/php_user_filter_02.phpt +++ b/ext/standard/tests/filters/php_user_filter_02.phpt @@ -9,4 +9,4 @@ class foo extends php_user_filter { } ?> --EXPECTF-- -Warning: Declaration of foo::filter($in, $out, $consumed, $closing) should be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d +Fatal error: Declaration of foo::filter($in, $out, $consumed, $closing) must be compatible with php_user_filter::filter($in, $out, &$consumed, $closing) in %s on line %d diff --git a/ext/standard/tests/filters/php_user_filter_03.phpt b/ext/standard/tests/filters/php_user_filter_03.phpt index 867b74eb89a..a89637d4cca 100644 --- a/ext/standard/tests/filters/php_user_filter_03.phpt +++ b/ext/standard/tests/filters/php_user_filter_03.phpt @@ -9,4 +9,4 @@ class foo extends php_user_filter { } ?> --EXPECTF-- -Warning: Declaration of foo::onCreate($var) should be compatible with php_user_filter::onCreate() in %s on line %d +Fatal error: Declaration of foo::onCreate($var) must be compatible with php_user_filter::onCreate() in %s on line %d diff --git a/tests/classes/inheritance_003.phpt b/tests/classes/inheritance_003.phpt index bcbead1be74..925544e7547 100644 --- a/tests/classes/inheritance_003.phpt +++ b/tests/classes/inheritance_003.phpt @@ -14,7 +14,5 @@ class B extends A } ?> -===DONE=== --EXPECTF-- -Warning: Declaration of B::f() should be compatible with A::f($x) in %sinheritance_003.php on line %d -===DONE=== +Fatal error: Declaration of B::f() must be compatible with A::f($x) in %sinheritance_003.php on line %d diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt index 7eb57b27708..682bee7a1b0 100644 --- a/tests/classes/inheritance_004.phpt +++ b/tests/classes/inheritance_004.phpt @@ -5,7 +5,7 @@ ZE2 method inheritance without interfaces class A { - function f() {} +function f() {} } class B extends A @@ -14,7 +14,5 @@ class B extends A } ?> -===DONE=== --EXPECTF-- -Warning: Declaration of B::f($x) should be compatible with A::f() in %sinheritance_004.php on line %d -===DONE=== +Fatal error: Declaration of B::f($x) must be compatible with A::f() in %sinheritance_004.php on line %d diff --git a/tests/classes/method_override_optional_arg_001.phpt b/tests/classes/method_override_optional_arg_001.phpt index 897a2c2b93b..ac1a6892384 100644 --- a/tests/classes/method_override_optional_arg_001.phpt +++ b/tests/classes/method_override_optional_arg_001.phpt @@ -26,6 +26,4 @@ $b->foo(1); ?> --EXPECTF-- -Warning: Declaration of C::foo() should be compatible with A::foo($arg1 = 1) in %s on line %d -int(1) -int(3) +Fatal error: Declaration of C::foo() must be compatible with A::foo($arg1 = 1) in %s on line %d diff --git a/tests/classes/method_override_optional_arg_002.phpt b/tests/classes/method_override_optional_arg_002.phpt index 254392718b8..df12251e6c5 100644 --- a/tests/classes/method_override_optional_arg_002.phpt +++ b/tests/classes/method_override_optional_arg_002.phpt @@ -18,5 +18,4 @@ $b->foo(); ?> --EXPECTF-- -Warning: Declaration of B::foo() should be compatible with A::foo($arg = 1) in %s on line %d -foo +Fatal error: Declaration of B::foo() must be compatible with A::foo($arg = 1) in %s on line %d diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt index 54af0e8c96b..065ba70e8a5 100644 --- a/tests/classes/type_hinting_005a.phpt +++ b/tests/classes/type_hinting_005a.phpt @@ -4,15 +4,11 @@ Check type hint compatibility in overrides with array hints. -==DONE== --EXPECTF-- -Warning: Declaration of D2::f(SomeClass $a) should be compatible with C::f(array $a) in %s on line 8 -Compatible hint. -Class hint, should be array. -==DONE== +Fatal error: Declaration of D2::f(SomeClass $a) must be compatible with C::f(array $a) in %s on line 8 diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt index 00048c3ef97..6cc3e3e369e 100644 --- a/tests/classes/type_hinting_005c.phpt +++ b/tests/classes/type_hinting_005c.phpt @@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints. -==DONE== --EXPECTF-- -Warning: Declaration of D::f(array $a) should be compatible with C::f(SomeClass $a) in %s on line 5 -Array hint, should be class. -==DONE== +Fatal error: Declaration of D::f(array $a) must be compatible with C::f(SomeClass $a) in %s on line 5 diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt index a1ce30950c2..51c2a5a995a 100644 --- a/tests/classes/type_hinting_005d.phpt +++ b/tests/classes/type_hinting_005d.phpt @@ -4,11 +4,8 @@ Check type hint compatibility in overrides with array hints. -==DONE== --EXPECTF-- -Warning: Declaration of D::f(array $a) should be compatible with C::f($a) in %s on line 5 -Array hint, should be nothing. -==DONE== +Fatal error: Declaration of D::f(array $a) must be compatible with C::f($a) in %s on line 5