}
?>
--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
}
?>
--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
}
?>
--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
}
--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
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";
}
?>
--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
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
?>
--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"
?>
--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
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
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
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
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
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
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
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
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
}
--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
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
}
--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
}
--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
}
--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
}
--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
}
--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
}
--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
}
--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
?>
--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
?>
--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
?>
--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
?>
--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
?>
--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
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, ' ');
}
}
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, "::");
}
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);
}
}
?>
--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
?>
--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
?>
--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
===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===
?>
==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==
?>
==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==
?>
==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==
?>
==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==