com php-src: Show full signature upon inheritance mismatch: Zend/tests/argument_restriction_001.phpt Zend/tes ts/argument_restriction_002.phpt
Zend/tests/argum ent_restriction_006.phpt Zend/tests/bug605 73.phpt Zend/tests/bug63336.phpt Zend/tes ts/bug64988.phpt Zend/tests/bug65322. phpt
Zend/tests/errmsg_045.phpt Zend/tests/object s_002.phpt Zend/tests/objects_003.phpt Zend/tests/objects_004.phpt Zend/tests/objects_ 006.phpt
Zend/tests/objects_007.phpt

From: Date: Sun, 28 Jun 2015 23:00:12 +0000
Subject: com php-src: Show full signature upon inheritance mismatch: Zend/tests/argument_restriction_001.phpt Zend/tes ts/argument_restriction_002.phpt
Zend/tests/argum ent_restriction_006.phpt Zend/tests/bug605 73.phpt Zend/tests/bug63336.phpt Zend/tes ts/bug64988.phpt Zend/tests/bug65322. phpt
Zend/tests/errmsg_045.phpt Zend/tests/object s_002.phpt Zend/tests/objects_003.phpt Zend/tests/objects_004.phpt Zend/tests/objects_ 006.phpt
Zend/tests/objects_007.phpt
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-87582@lists.php.net to get a copy of this message
Commit: e5fae77969c4f7879c0f7e805c267a1448aef922 Author: Bob Weinand <bobwei9@hotmail.com> Mon, 29 Jun 2015 00:28:52 +0200 Parents: 9f77c44d47cc9727865473684d8914153bf53b40 Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e5fae77969c4f7879c0f7e805c267a1448aef922 Log: Show full signature upon inheritance mismatch Changed paths: M Zend/tests/argument_restriction_001.phpt M Zend/tests/argument_restriction_002.phpt M Zend/tests/argument_restriction_006.phpt M Zend/tests/bug60573.phpt M Zend/tests/bug63336.phpt M Zend/tests/bug64988.phpt M Zend/tests/bug65322.phpt M Zend/tests/errmsg_045.phpt M Zend/tests/objects_002.phpt M Zend/tests/objects_003.phpt M Zend/tests/objects_004.phpt M Zend/tests/objects_006.phpt M Zend/tests/objects_007.phpt M Zend/tests/objects_008.phpt M Zend/tests/objects_009.phpt M Zend/tests/return_types/008.phpt M Zend/tests/return_types/009.phpt M Zend/tests/return_types/generators003.phpt M Zend/tests/return_types/inheritance001.phpt M Zend/tests/return_types/inheritance002.phpt M Zend/tests/return_types/inheritance003.phpt M Zend/tests/return_types/inheritance005.phpt M Zend/tests/return_types/inheritance006.phpt M Zend/tests/return_types/inheritance007.phpt M Zend/tests/return_types/rfc004.phpt M Zend/tests/variadic/adding_additional_optional_parameter_error.phpt M Zend/tests/variadic/non_variadic_implements_variadic_error.phpt M Zend/tests/variadic/removing_parameter_error.phpt M Zend/tests/variadic/variadic_changed_byref_error.phpt M Zend/tests/variadic/variadic_changed_typehint_error.phpt M Zend/zend_inheritance.c M tests/classes/ctor_in_interface_01.phpt M tests/classes/ctor_in_interface_03.phpt M tests/classes/ctor_in_interface_04.phpt M tests/classes/inheritance_004.phpt M tests/classes/type_hinting_005a.phpt M tests/classes/type_hinting_005b.phpt M tests/classes/type_hinting_005c.phpt M tests/classes/type_hinting_005d.phpt

diff --git a/Zend/tests/argument_restriction_001.phpt b/Zend/tests/argument_restriction_001.phpt index abb27e2..be4c734 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 921c28e..cbb3ec9 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 abef1cd..dd744d5 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 5cd576e..871be56 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 b47a770..271d3e8 100644 --- a/Zend/tests/bug63336.phpt +++ b/Zend/tests/bug63336.phpt @@ -2,7 +2,7 @@ Bug #63336 (invalid E_NOTICE error occur) --FILE-- <?php -error_reporting(E_ALL & ~E_WARNING ); +error_reporting(E_ALL & ~E_WARNING); define("TEST", "123"); class Base { const DUMMY = "XXX"; @@ -17,6 +17,6 @@ class Child extends Base { } ?> --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 cb657ac..971c864 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 9095a91..4985ae5 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 9f3b855..fbb2528 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 83d3dc7..8907c1b 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 59ab9a3..13ebd33 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 cb0445f..5dd31ea 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 7ed0781..4198b97 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 cc51799..f283b88 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 0f7e99e..aae162c 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 b16fe98..353266b 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 68262af..47343d0 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 0c2b437..b83703e 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 b90f67a..0ff2524 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 ce33d97..8e0523e 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 f63a8eb..8cb63b6 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 e627363..0b22dd5 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 6ab5236..31e0e11 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 521c983..86c11aa 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 8de2778..86d0bd9 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 13bfe72..654fb92 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 2f31d47..da96264 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 f447837..0d9cd8b 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 a189e5c..cf483c7 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 14fb6ae..96410d8 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 00df33a..b0184e4 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 608af74..1559d02 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 e5ad30e..fc97371 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 ac73331..25d7f9d 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 94be655..0b07f9a 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 d783f74..d92ed83 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 5fe1097..54af0e8 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 8a7b446..b9fb198 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 3378dcb..00048c3 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 ab86c68..a1ce309 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==
« previous php.cvs (#87582) next »