From e5fae77969c4f7879c0f7e805c267a1448aef922 Mon Sep 17 00:00:00 2001 From: Bob Weinand Date: Mon, 29 Jun 2015 00:28:52 +0200 Subject: [PATCH] Show full signature upon inheritance mismatch --- Zend/tests/argument_restriction_001.phpt | 2 +- Zend/tests/argument_restriction_002.phpt | 2 +- Zend/tests/argument_restriction_006.phpt | 2 +- Zend/tests/bug60573.phpt | 6 +++--- Zend/tests/bug63336.phpt | 6 +++--- Zend/tests/bug64988.phpt | 2 +- Zend/tests/bug65322.phpt | 2 +- Zend/tests/errmsg_045.phpt | 2 +- Zend/tests/objects_002.phpt | 2 +- Zend/tests/objects_003.phpt | 2 +- Zend/tests/objects_004.phpt | 2 +- Zend/tests/objects_006.phpt | 2 +- Zend/tests/objects_007.phpt | 2 +- Zend/tests/objects_008.phpt | 2 +- Zend/tests/objects_009.phpt | 2 +- Zend/tests/return_types/008.phpt | 2 +- Zend/tests/return_types/009.phpt | 2 +- Zend/tests/return_types/generators003.phpt | 2 +- Zend/tests/return_types/inheritance001.phpt | 2 +- Zend/tests/return_types/inheritance002.phpt | 2 +- Zend/tests/return_types/inheritance003.phpt | 2 +- Zend/tests/return_types/inheritance005.phpt | 2 +- Zend/tests/return_types/inheritance006.phpt | 2 +- Zend/tests/return_types/inheritance007.phpt | 2 +- Zend/tests/return_types/rfc004.phpt | 2 +- ...g_additional_optional_parameter_error.phpt | 2 +- ...on_variadic_implements_variadic_error.phpt | 2 +- .../variadic/removing_parameter_error.phpt | 2 +- .../variadic_changed_byref_error.phpt | 2 +- .../variadic_changed_typehint_error.phpt | 2 +- Zend/zend_inheritance.c | 19 ++++++++++++++----- tests/classes/ctor_in_interface_01.phpt | 2 +- tests/classes/ctor_in_interface_03.phpt | 2 +- tests/classes/ctor_in_interface_04.phpt | 2 +- tests/classes/inheritance_004.phpt | 2 +- tests/classes/type_hinting_005a.phpt | 2 +- tests/classes/type_hinting_005b.phpt | 2 +- tests/classes/type_hinting_005c.phpt | 2 +- tests/classes/type_hinting_005d.phpt | 2 +- 39 files changed, 56 insertions(+), 47 deletions(-) diff --git a/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt index abb27e20e0..be4c734b59 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 +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 diff --git a/Zend/tests/argument_restriction_002.phpt b/Zend/tests/argument_restriction_002.phpt index 921c28e2b2..cbb3ec97d0 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() should be compatible with Base::test($foo, array &$bar, $option = NULL, $extra = 3.1415926535898) in %sargument_restriction_002.php on line %d +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 diff --git a/Zend/tests/argument_restriction_006.phpt b/Zend/tests/argument_restriction_006.phpt index abef1cde0b..dd744d5ea9 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() should be compatible with Base::test($foo, $extra = Array) in %sargument_restriction_006.php on line %d +Warning: Declaration of Sub::test($foo, $extra) should be compatible with Base::test($foo, $extra = Array) in %sargument_restriction_006.php on line %d diff --git a/Zend/tests/bug60573.phpt b/Zend/tests/bug60573.phpt index 5cd576e8f1..871be56a16 100644 --- a/Zend/tests/bug60573.phpt +++ b/Zend/tests/bug60573.phpt @@ -77,8 +77,8 @@ public function setSelf(Foo6 $s) { } } --EXPECTF-- -Warning: Declaration of Bar4::setSelf() should be compatible with Foo4::setSelf(Foo4 $s) in %sbug60573.php on line %d +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() should be compatible with Foo5::setSelf(Base $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() must be compatible with Foo6::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 diff --git a/Zend/tests/bug63336.phpt b/Zend/tests/bug63336.phpt index b47a770a4d..271d3e82a9 100644 --- a/Zend/tests/bug63336.phpt +++ b/Zend/tests/bug63336.phpt @@ -2,7 +2,7 @@ Bug #63336 (invalid E_NOTICE error occur) --FILE-- --EXPECTF-- -Warning: Declaration of Child::foo() should be compatible with Base::foo($var = TEST, $more = NULL) in %sbug63336.php on line %d +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() should be compatible with Base::bar($more = self::DUMMY) 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 cb657ace6e..971c864d65 100644 --- a/Zend/tests/bug64988.phpt +++ b/Zend/tests/bug64988.phpt @@ -26,5 +26,5 @@ $o = new Smooth1(); echo "okey"; ?> --EXPECTF-- -Warning: Declaration of Smooth1::insert() should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20 +Warning: Declaration of Smooth1::insert(array $data) should be compatible with Noisy1::insert(array $data, $option1 = NULL) in %sbug64988.php on line 20 okey diff --git a/Zend/tests/bug65322.phpt b/Zend/tests/bug65322.phpt index 9095a91ae4..4985ae55d6 100644 --- a/Zend/tests/bug65322.phpt +++ b/Zend/tests/bug65322.phpt @@ -19,6 +19,6 @@ eval('class A { function test() { } } class B extends A { function test($a) { } ?> --EXPECTF-- -string(60) "Declaration of B::test() should be compatible with A::test()" +string(62) "Declaration of B::test($a) should be compatible with A::test()" string(%d) "%s(%d) : eval()'d code" string(1) "X" diff --git a/Zend/tests/errmsg_045.phpt b/Zend/tests/errmsg_045.phpt index 9f3b8558fd..fbb2528e28 100644 --- a/Zend/tests/errmsg_045.phpt +++ b/Zend/tests/errmsg_045.phpt @@ -14,7 +14,7 @@ eval('class A { function test() { } } class B extends A { function test($a) { } ?> --EXPECTF-- -string(60) "Declaration of B::test() should be compatible with A::test()" +string(62) "Declaration of B::test($a) should be compatible with A::test()" 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 83d3dc7758..8907c1b48c 100644 --- a/Zend/tests/objects_002.phpt +++ b/Zend/tests/objects_002.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo() in %s on line %d +Warning: Declaration of test3::foo($arg) should be compatible with test::foo() in %s on line %d Done diff --git a/Zend/tests/objects_003.phpt b/Zend/tests/objects_003.phpt index 59ab9a3a18..13ebd33d68 100644 --- a/Zend/tests/objects_003.phpt +++ b/Zend/tests/objects_003.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo($arg) in %s on line %d +Warning: Declaration of test3::foo($arg, $arg2) should be compatible with test::foo($arg) in %s on line %d Done diff --git a/Zend/tests/objects_004.phpt b/Zend/tests/objects_004.phpt index cb0445f35e..5dd31eabf2 100644 --- a/Zend/tests/objects_004.phpt +++ b/Zend/tests/objects_004.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo($arg) in %s on line %d +Warning: Declaration of test3::foo(&$arg) should be compatible with test::foo($arg) in %s on line %d Done diff --git a/Zend/tests/objects_006.phpt b/Zend/tests/objects_006.phpt index 7ed0781794..4198b9749d 100644 --- a/Zend/tests/objects_006.phpt +++ b/Zend/tests/objects_006.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo($arg, $arg2 = NULL) in %s on line %d +Warning: Declaration of test3::foo($arg, $arg2) should be compatible with test::foo($arg, $arg2 = NULL) in %s on line %d Done diff --git a/Zend/tests/objects_007.phpt b/Zend/tests/objects_007.phpt index cc51799368..f283b888f4 100644 --- a/Zend/tests/objects_007.phpt +++ b/Zend/tests/objects_007.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo($arg, &$arg2 = NULL) in %s on line %d +Warning: Declaration of test3::foo($arg, &$arg2) should be compatible with test::foo($arg, &$arg2 = NULL) in %s on line %d Done diff --git a/Zend/tests/objects_008.phpt b/Zend/tests/objects_008.phpt index 0f7e99e4a6..aae162ca9a 100644 --- a/Zend/tests/objects_008.phpt +++ b/Zend/tests/objects_008.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in %s on line %d +Warning: Declaration of test3::foo(Test3 $arg) should be compatible with test::foo(Test $arg) in %s on line %d Done diff --git a/Zend/tests/objects_009.phpt b/Zend/tests/objects_009.phpt index b16fe98767..353266b093 100644 --- a/Zend/tests/objects_009.phpt +++ b/Zend/tests/objects_009.phpt @@ -20,5 +20,5 @@ class test3 extends test { echo "Done\n"; ?> --EXPECTF-- -Warning: Declaration of test3::foo() should be compatible with test::foo(Test $arg) in %s on line %d +Warning: Declaration of test3::foo($arg) should be compatible with test::foo(Test $arg) in %s on line %d Done diff --git a/Zend/tests/return_types/008.phpt b/Zend/tests/return_types/008.phpt index 68262af9da..47343d0564 100644 --- a/Zend/tests/return_types/008.phpt +++ b/Zend/tests/return_types/008.phpt @@ -18,4 +18,4 @@ $qux = new qux(); var_dump($qux->bar()); --EXPECTF-- -Fatal error: Declaration of qux::bar() must be compatible with foo::bar(): foo in %s008.php on line 7 +Fatal error: Declaration of qux::bar(): qux must be compatible with foo::bar(): foo in %s008.php on line 7 diff --git a/Zend/tests/return_types/009.phpt b/Zend/tests/return_types/009.phpt index 0c2b4376a1..b83703ede5 100644 --- a/Zend/tests/return_types/009.phpt +++ b/Zend/tests/return_types/009.phpt @@ -16,4 +16,4 @@ class qux implements foo { } --EXPECTF-- -Fatal error: Declaration of qux::bar() must be compatible with foo::bar(): foo in %s on line %d +Fatal error: Declaration of qux::bar(): biz must be compatible with foo::bar(): foo in %s on line %d diff --git a/Zend/tests/return_types/generators003.phpt b/Zend/tests/return_types/generators003.phpt index b90f67a268..0ff2524f47 100644 --- a/Zend/tests/return_types/generators003.phpt +++ b/Zend/tests/return_types/generators003.phpt @@ -19,4 +19,4 @@ $some = new SomeCollection(); var_dump($some->getIterator()); --EXPECTF-- -Fatal error: Declaration of SomeCollection::getIterator() must be compatible with Collection::getIterator(): Iterator in %sgenerators003.php on line 6 +Fatal error: Declaration of SomeCollection::getIterator(): Generator must be compatible with Collection::getIterator(): Iterator in %sgenerators003.php on line 6 diff --git a/Zend/tests/return_types/inheritance001.phpt b/Zend/tests/return_types/inheritance001.phpt index ce33d97995..8e0523eb70 100644 --- a/Zend/tests/return_types/inheritance001.phpt +++ b/Zend/tests/return_types/inheritance001.phpt @@ -13,4 +13,4 @@ class B extends A { } --EXPECTF-- -Fatal error: Declaration of B::foo() must be compatible with A::foo(): A in %s on line %d +Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance002.phpt b/Zend/tests/return_types/inheritance002.phpt index f63a8ebe89..8cb63b6fc8 100644 --- a/Zend/tests/return_types/inheritance002.phpt +++ b/Zend/tests/return_types/inheritance002.phpt @@ -13,4 +13,4 @@ class B extends A { } --EXPECTF-- -Fatal error: Declaration of B::foo() must be compatible with A::foo(): A in %s on line %d +Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance003.phpt b/Zend/tests/return_types/inheritance003.phpt index e627363426..0b22dd55d4 100644 --- a/Zend/tests/return_types/inheritance003.phpt +++ b/Zend/tests/return_types/inheritance003.phpt @@ -13,4 +13,4 @@ class B implements A { } --EXPECTF-- -Fatal error: Declaration of B::foo() must be compatible with A::foo(): A in %s on line %d +Fatal error: Declaration of B::foo(): StdClass must be compatible with A::foo(): A in %s on line %d diff --git a/Zend/tests/return_types/inheritance005.phpt b/Zend/tests/return_types/inheritance005.phpt index 6ab52363c3..31e0e11dd8 100644 --- a/Zend/tests/return_types/inheritance005.phpt +++ b/Zend/tests/return_types/inheritance005.phpt @@ -16,4 +16,4 @@ class Bar extends Foo { } --EXPECTF-- -Fatal error: Declaration of Bar::test() must be compatible with Foo::test(): Foo in %sinheritance005.php on line 12 +Fatal error: Declaration of Bar::test(): Bar must be compatible with Foo::test(): Foo in %sinheritance005.php on line 12 diff --git a/Zend/tests/return_types/inheritance006.phpt b/Zend/tests/return_types/inheritance006.phpt index 521c983040..86c11aa57a 100644 --- a/Zend/tests/return_types/inheritance006.phpt +++ b/Zend/tests/return_types/inheritance006.phpt @@ -21,4 +21,4 @@ class Bar extends Foo { } --EXPECTF-- -Fatal error: Declaration of Bar::test() must be compatible with Foo::test(): A in %sinheritance006.php on line 14 +Fatal error: Declaration of Bar::test(): B must be compatible with Foo::test(): A in %sinheritance006.php on line 14 diff --git a/Zend/tests/return_types/inheritance007.phpt b/Zend/tests/return_types/inheritance007.phpt index 8de277817e..86d0bd9d69 100644 --- a/Zend/tests/return_types/inheritance007.phpt +++ b/Zend/tests/return_types/inheritance007.phpt @@ -19,4 +19,4 @@ class Bar extends Foo { } --EXPECTF-- -Fatal error: Declaration of Bar::test() must be compatible with Foo::test(): Traversable in %sinheritance007.php on line 12 +Fatal error: Declaration of Bar::test(): ArrayObject must be compatible with Foo::test(): Traversable in %sinheritance007.php on line 12 diff --git a/Zend/tests/return_types/rfc004.phpt b/Zend/tests/return_types/rfc004.phpt index 13bfe72747..654fb92321 100644 --- a/Zend/tests/return_types/rfc004.phpt +++ b/Zend/tests/return_types/rfc004.phpt @@ -18,4 +18,4 @@ class UserGateway_MySql implements UserGateway { } --EXPECTF-- -Fatal error: Declaration of UserGateway_MySql::find() must be compatible with UserGateway::find($id): User in %s on line 9 +Fatal error: Declaration of UserGateway_MySql::find($id) must be compatible with UserGateway::find($id): User in %s on line 9 diff --git a/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt index 2f31d47dc6..da96264609 100644 --- a/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt +++ b/Zend/tests/variadic/adding_additional_optional_parameter_error.phpt @@ -13,4 +13,4 @@ class MySQL implements DB { ?> --EXPECTF-- -Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d +Fatal error: Declaration of MySQL::query($query, int $extraParam = NULL, string ...$params) must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt index f447837ca4..0d9cd8b81d 100644 --- a/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt +++ b/Zend/tests/variadic/non_variadic_implements_variadic_error.phpt @@ -13,4 +13,4 @@ class MySQL implements DB { ?> --EXPECTF-- -Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d +Fatal error: Declaration of MySQL::query($query, $params) must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/removing_parameter_error.phpt b/Zend/tests/variadic/removing_parameter_error.phpt index a189e5cf09..cf483c7fec 100644 --- a/Zend/tests/variadic/removing_parameter_error.phpt +++ b/Zend/tests/variadic/removing_parameter_error.phpt @@ -17,4 +17,4 @@ class MySQL implements DB { ?> --EXPECTF-- -Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, ...$params) in %s on line %d +Fatal error: Declaration of MySQL::query(...$params) must be compatible with DB::query($query, ...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_changed_byref_error.phpt b/Zend/tests/variadic/variadic_changed_byref_error.phpt index 14fb6ae5eb..96410d8127 100644 --- a/Zend/tests/variadic/variadic_changed_byref_error.phpt +++ b/Zend/tests/variadic/variadic_changed_byref_error.phpt @@ -13,4 +13,4 @@ class MySQL implements DB { ?> --EXPECTF-- -Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, &...$params) in %s on line %d +Fatal error: Declaration of MySQL::query($query, ...$params) must be compatible with DB::query($query, &...$params) in %s on line %d diff --git a/Zend/tests/variadic/variadic_changed_typehint_error.phpt b/Zend/tests/variadic/variadic_changed_typehint_error.phpt index 00df33a042..b0184e445f 100644 --- a/Zend/tests/variadic/variadic_changed_typehint_error.phpt +++ b/Zend/tests/variadic/variadic_changed_typehint_error.phpt @@ -13,4 +13,4 @@ class MySQL implements DB { ?> --EXPECTF-- -Fatal error: Declaration of MySQL::query() must be compatible with DB::query($query, string ...$params) in %s on line %d +Fatal error: Declaration of MySQL::query($query, int ...$params) must be compatible with DB::query($query, string ...$params) in %s on line %d diff --git a/Zend/zend_inheritance.c b/Zend/zend_inheritance.c index 608af74353..1559d02047 100644 --- a/Zend/zend_inheritance.c +++ b/Zend/zend_inheritance.c @@ -372,8 +372,12 @@ static void zend_append_type_hint(smart_str *str, const zend_function *fptr, zen smart_str_appendc(str, ' '); } } else if (arg_info->type_hint) { - const char *type_name = zend_get_type_by_const(arg_info->type_hint); - smart_str_appends(str, type_name); + if (arg_info->type_hint == IS_LONG) { + smart_str_appendl(str, "int", 3); + } else { + const char *type_name = zend_get_type_by_const(arg_info->type_hint); + smart_str_appends(str, type_name); + } if (!return_hint) { smart_str_appendc(str, ' '); } @@ -390,7 +394,8 @@ static zend_string *zend_get_function_declaration(const zend_function *fptr) /* } if (fptr->common.scope) { - smart_str_append(&str, fptr->common.scope->name); + /* cut off on NULL byte ... class@anonymous */ + smart_str_appendl(&str, fptr->common.scope->name->val, strlen(fptr->common.scope->name->val)); smart_str_appends(&str, "::"); } @@ -563,11 +568,15 @@ static void do_inheritance_check_on_method(zend_function *child, zend_function * child->common.prototype->common.fn_flags & (ZEND_ACC_ABSTRACT | ZEND_ACC_HAS_RETURN_TYPE) )) { if (UNEXPECTED(!zend_do_perform_implementation_check(child, child->common.prototype))) { - zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s::%s() must be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, zend_get_function_declaration(child->common.prototype)->val); + zend_string *method_prototype = zend_get_function_declaration(parent); + zend_string *child_prototype = zend_get_function_declaration(child); + zend_error_noreturn(E_COMPILE_ERROR, "Declaration of %s must be compatible with %s", child_prototype->val, method_prototype->val); } } else if (UNEXPECTED(!zend_do_perform_implementation_check(child, parent))) { zend_string *method_prototype = zend_get_function_declaration(parent); - zend_error(E_WARNING, "Declaration of %s::%s() should be compatible with %s", ZEND_FN_SCOPE_NAME(child), child->common.function_name->val, method_prototype->val); + zend_string *child_prototype = zend_get_function_declaration(child); + zend_error(E_WARNING, "Declaration of %s should be compatible with %s", child_prototype->val, method_prototype->val); + zend_string_free(child_prototype); zend_string_free(method_prototype); } } diff --git a/tests/classes/ctor_in_interface_01.phpt b/tests/classes/ctor_in_interface_01.phpt index e5ad30ebcd..fc97371f6f 100644 --- a/tests/classes/ctor_in_interface_01.phpt +++ b/tests/classes/ctor_in_interface_01.phpt @@ -16,4 +16,4 @@ class implem implements constr ?> --EXPECTF-- -Fatal error: Declaration of implem::__construct() must be compatible with constr::__construct() in %s on line %d +Fatal error: Declaration of implem::__construct($a) must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_03.phpt b/tests/classes/ctor_in_interface_03.phpt index ac73331207..25d7f9dc82 100644 --- a/tests/classes/ctor_in_interface_03.phpt +++ b/tests/classes/ctor_in_interface_03.phpt @@ -20,4 +20,4 @@ class derived extends implem ?> --EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d +Fatal error: Declaration of derived::__construct($a) must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/ctor_in_interface_04.phpt b/tests/classes/ctor_in_interface_04.phpt index 94be655b83..0b07f9a1ca 100644 --- a/tests/classes/ctor_in_interface_04.phpt +++ b/tests/classes/ctor_in_interface_04.phpt @@ -23,4 +23,4 @@ class derived extends implem ?> --EXPECTF-- -Fatal error: Declaration of derived::__construct() must be compatible with constr::__construct() in %s on line %d +Fatal error: Declaration of derived::__construct($a) must be compatible with constr::__construct() in %s on line %d diff --git a/tests/classes/inheritance_004.phpt b/tests/classes/inheritance_004.phpt index d783f7437a..d92ed830e8 100644 --- a/tests/classes/inheritance_004.phpt +++ b/tests/classes/inheritance_004.phpt @@ -17,5 +17,5 @@ class B extends A ===DONE=== --EXPECTF-- -Warning: Declaration of B::f() should be compatible with A::f() in %sinheritance_004.php on line %d +Warning: Declaration of B::f($x) should be compatible with A::f() in %sinheritance_004.php on line %d ===DONE=== diff --git a/tests/classes/type_hinting_005a.phpt b/tests/classes/type_hinting_005a.phpt index 5fe1097a5d..54af0e8c96 100644 --- a/tests/classes/type_hinting_005a.phpt +++ b/tests/classes/type_hinting_005a.phpt @@ -12,7 +12,7 @@ Class D2 extends C { function f(SomeClass $a) {} } ?> ==DONE== --EXPECTF-- -Warning: Declaration of D2::f() should be compatible with C::f(array $a) in %s on line 8 +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== diff --git a/tests/classes/type_hinting_005b.phpt b/tests/classes/type_hinting_005b.phpt index 8a7b4466f7..b9fb198fc5 100644 --- a/tests/classes/type_hinting_005b.phpt +++ b/tests/classes/type_hinting_005b.phpt @@ -9,6 +9,6 @@ Class D extends C { function f($a) {} } ?> ==DONE== --EXPECTF-- -Warning: Declaration of D::f() should be compatible with C::f(array $a) in %s on line 5 +Warning: Declaration of D::f($a) should be compatible with C::f(array $a) in %s on line 5 No hint, should be array. ==DONE== diff --git a/tests/classes/type_hinting_005c.phpt b/tests/classes/type_hinting_005c.phpt index 3378dcb398..00048c3ef9 100644 --- a/tests/classes/type_hinting_005c.phpt +++ b/tests/classes/type_hinting_005c.phpt @@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} } ?> ==DONE== --EXPECTF-- -Warning: Declaration of D::f() should be compatible with C::f(SomeClass $a) in %s on line 5 +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== diff --git a/tests/classes/type_hinting_005d.phpt b/tests/classes/type_hinting_005d.phpt index ab86c68eea..a1ce30950c 100644 --- a/tests/classes/type_hinting_005d.phpt +++ b/tests/classes/type_hinting_005d.phpt @@ -9,6 +9,6 @@ Class D extends C { function f(array $a) {} } ?> ==DONE== --EXPECTF-- -Warning: Declaration of D::f() should be compatible with C::f($a) in %s on line 5 +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== -- 2.40.0