From bc1eaaf162e0d662aed20ce9ae2a8b20f61009e7 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 --- 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 | 3 +- Zend/tests/objects_003.phpt | 3 +- Zend/tests/objects_004.phpt | 3 +- Zend/tests/objects_005.phpt | 3 +- Zend/tests/objects_006.phpt | 3 +- Zend/tests/objects_007.phpt | 3 +- Zend/tests/objects_008.phpt | 3 +- 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 | 3 +- tests/classes/inheritance_004.phpt | 5 +- .../method_override_optional_arg_001.phpt | 4 +- .../method_override_optional_arg_002.phpt | 3 +- tests/classes/type_hinting_005a.phpt | 9 +-- tests/classes/type_hinting_005c.phpt | 6 +- tests/classes/type_hinting_005d.phpt | 6 +- 41 files changed, 139 insertions(+), 174 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/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt index 9c21dc2cceab0..2cd527f4fa97d 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 4deb2d206b124..511e4d33320d3 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 c24e0ba852b35..fb602194bb581 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 2df0e1e90d808..788670cd517d4 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 fba320bb1347e..0000000000000 --- 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 871be56a16054..50650f54197f1 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 0000000000000..221745316a83d --- /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 271d3e82a9742..0000000000000 --- 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 671d69de3b1e1..7ca642d6bf5b5 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 4985ae55d6667..2ae2780bb628d 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 793a1394d67b1..3945a497a6a39 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 74ea394f5d823..242073a965fe0 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 7db7d7d02367f..ad2115e4a0b70 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 490fc30070fe9..acecd85fc576c 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 78fff6e70d116..ab3cc9ae1601a 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 fbb2528e28cda..5a4deadb5926a 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 1c45b2230c953..dacdcbb862aeb 100644 --- a/Zend/tests/objects_002.phpt +++ b/Zend/tests/objects_002.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 4486888c40cb4..6774cb9c5be72 100644 --- a/Zend/tests/objects_003.phpt +++ b/Zend/tests/objects_003.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 1cc90384a7aab..076fe92eaa1a8 100644 --- a/Zend/tests/objects_004.phpt +++ b/Zend/tests/objects_004.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 a2369b731a320..cc337a9f1b0da 100644 --- a/Zend/tests/objects_005.phpt +++ b/Zend/tests/objects_005.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 ed6ea6047af11..6889ed227c30d 100644 --- a/Zend/tests/objects_006.phpt +++ b/Zend/tests/objects_006.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 3094d60e8e2df..489f4b65ebffa 100644 --- a/Zend/tests/objects_007.phpt +++ b/Zend/tests/objects_007.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 6554be99eba13..64dd86120702e 100644 --- a/Zend/tests/objects_008.phpt +++ b/Zend/tests/objects_008.phpt @@ -20,5 +20,4 @@ class test3 extends test { 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 e3c8440212388..cfe8905dece26 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 58b3f67f4001d..fe9d4461b98b7 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 61915a2e6c0f0..e4e5400957522 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 0000000000000..59f10b28f511c --- /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 9626434f05321..ba0c63fb49a3c 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 164221709c424..212d44ab82215 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 915df7d69f710..abbb2f04beafd 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 ff5a51f5bec6c..fb47177f4c65c 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 bdd73c01a80e2..fd0822153b1a8 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 867b74eb89a52..a89637d4ccab3 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 bcbead1be74f7..7f064148d43a4 100644 --- a/tests/classes/inheritance_003.phpt +++ b/tests/classes/inheritance_003.phpt @@ -16,5 +16,4 @@ 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 7eb57b27708b0..9a29b32d5a12a 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 @@ -16,5 +16,4 @@ 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 897a2c2b93bfd..ac1a689238472 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 254392718b81e..df12251e6c595 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 54af0e8c96b4c..8bae28d300faf 100644 --- a/tests/classes/type_hinting_005a.phpt +++ b/tests/classes/type_hinting_005a.phpt @@ -4,15 +4,12 @@ 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 00048c3ef97b4..5b011828155b4 100644 --- a/tests/classes/type_hinting_005c.phpt +++ b/tests/classes/type_hinting_005c.phpt @@ -4,11 +4,9 @@ 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 a1ce30950c200..52a065bdf5483 100644 --- a/tests/classes/type_hinting_005d.phpt +++ b/tests/classes/type_hinting_005d.phpt @@ -4,11 +4,9 @@ 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