Skip to content

Switch the format of argument error messages #5211

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion Zend/tests/008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var_dump(constant("test const"));
echo "Done\n";
?>
--EXPECTF--
TypeError: define() expects argument #1 ($constant_name) to be of type string, array given
TypeError: define(): Argument #1 ($constant_name) must be of type string, array given

Notice: Constant TRUE already defined in %s on line %d
bool(false)
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ string(3) "foo"

Warning: get_class() called without object from outside a class in %s on line %d
bool(false)
get_class() expects argument #1 ($object) to be of type object, string given
get_class(): Argument #1 ($object) must be of type object, string given
string(3) "foo"
string(4) "foo2"
get_class() expects argument #1 ($object) to be of type object, null given
get_class(): Argument #1 ($object) must be of type object, null given
Done
4 changes: 2 additions & 2 deletions Zend/tests/arrow_functions/006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ try {
--EXPECTF--
int(2)
int(10)
{closure}() expects argument #1 ($x) to be of type int, string given, called in %s on line %d
{closure}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d
array(3) {
[0]=>
int(20)
Expand All @@ -41,4 +41,4 @@ array(3) {
[2]=>
int(30)
}
{closure}() expects argument #2 ($args) to be of type ?int, string given, called in %s on line %d
{closure}(): Argument #2 ($args) must be of type ?int, string given, called in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/bug31720.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ try {
?>
--EXPECTF--
Warning: Undefined variable: nonesuchvar in %s on line %d
array_walk() expects argument #2 ($funcname) to be a valid callback, first array member is not a valid class name or object
array_walk(): Argument #2 ($funcname) must be a valid callback, first array member is not a valid class name or object
2 changes: 1 addition & 1 deletion Zend/tests/bug39003.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ test($obj);
echo "Done\n";
?>
--EXPECTF--
Fatal error: Uncaught TypeError: test() expects argument #1 ($object) to be of type OtherClassName, ClassName given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: test(): Argument #1 ($object) must be of type OtherClassName, ClassName given, called in %s:%d
Stack trace:
#0 %s(%d): test(Object(ClassName))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug42802.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ ok
ok
ok

Fatal error: Uncaught TypeError: foo\test5() expects argument #1 ($bar) to be of type bar, foo\bar given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: foo\test5(): Argument #1 ($bar) must be of type bar, foo\bar given, called in %s:%d
Stack trace:
#0 %s(%d): foo\test5(Object(foo\bar))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug43332_1.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $foo = new foo;
$foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok!
--EXPECTF--
Fatal error: Uncaught TypeError: foobar\foo::bar() expects argument #1 ($a) to be of type foobar\foo, stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php:5
Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d
Stack trace:
#0 %s(%d): foobar\foo->bar(Object(stdClass))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug45186.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,4 @@ string(1) "y"
ok
__callstatic:
string(3) "www"
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active
4 changes: 2 additions & 2 deletions Zend/tests/bug45186_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,5 +52,5 @@ string(1) "y"
__call:
string(1) "y"
ok
call_user_func() expects argument #1 ($function) to be a valid callback, class 'bar' does not have a method 'www'
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active
call_user_func(): Argument #1 ($function) must be a valid callback, class 'bar' does not have a method 'www'
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active
4 changes: 2 additions & 2 deletions Zend/tests/bug48770_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,5 @@ $c->func('This should work!');
--EXPECT--
string(27) "A::func2: This should work!"
string(27) "A::func3: This should work!"
call_user_func_array() expects argument #1 ($function) to be a valid callback, cannot access private method A::func22()
call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'A' does not have a method 'inexistent'
call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method A::func22()
call_user_func_array(): Argument #1 ($function) must be a valid callback, class 'A' does not have a method 'inexistent'
2 changes: 1 addition & 1 deletion Zend/tests/bug48770_3.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,4 @@ $c->func('This should work!');
--EXPECT--
string(27) "B::func2: This should work!"
string(27) "B::func3: This should work!"
call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'B' does not have a method 'inexistent'
call_user_func_array(): Argument #1 ($function) must be a valid callback, class 'B' does not have a method 'inexistent'
2 changes: 1 addition & 1 deletion Zend/tests/bug61273.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ $args = array_fill(0, 64 * 1024 - 64, 0);
call_user_func_array(function(&$a) {}, $args);
echo strval("okey");
--EXPECTF--
Warning: {closure}() expects argument #1 ($a) to be passed by reference, value given in %s on line %d
Warning: {closure}(): Argument #1 ($a) must be passed by reference, value given in %s on line %d
okey
2 changes: 1 addition & 1 deletion Zend/tests/bug68446.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ array(1) {
int(1)
}

Fatal error: Uncaught TypeError: a() expects argument #1 ($a) to be of type array, null given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: a(): Argument #1 ($a) must be of type array, null given, called in %s:%d
Stack trace:
#0 %s(%d): a(NULL)
#1 {main}
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/bug70895.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ try {
}
?>
--EXPECT--
array_map() expects argument #1 ($callback) to be a valid callback, function '%n' not found or invalid function name
array_map() expects argument #1 ($callback) to be a valid callback, function '%n %i' not found or invalid function name
array_map() expects argument #1 ($callback) to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function '%n' not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function '%n %i' not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name
2 changes: 1 addition & 1 deletion Zend/tests/bug70898.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ try {
}
?>
--EXPECT--
array_map() expects argument #1 ($callback) to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name
array_map(): Argument #1 ($callback) must be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name
4 changes: 2 additions & 2 deletions Zend/tests/bug72598.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ new class {
};
?>
--EXPECTF--
Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
object(class@anonymous)#1 (0) {
}

Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
object(class@anonymous)#1 (0) {
}
4 changes: 2 additions & 2 deletions Zend/tests/bug72598_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ new class {
};
?>
--EXPECTF--
Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(0)

Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(0)
2 changes: 1 addition & 1 deletion Zend/tests/bug73954.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ takes_int(log(tan(3.14)));
float(NAN)
bool(true)

Fatal error: Uncaught TypeError: takes_int() expects argument #1 ($int) to be of type int, float given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: takes_int(): Argument #1 ($int) must be of type int, float given, called in %s:%d
Stack trace:
#0 %s(9): takes_int(NAN)
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/bug74164.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ set_error_handler(function ($type, $msg) {
call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
?>
--EXPECTF--
Fatal error: Uncaught Exception: Foo\{closure}() expects argument #1 ($ref) to be passed by reference, value given in %s:%d
Fatal error: Uncaught Exception: Foo\{closure}(): Argument #1 ($ref) must be passed by reference, value given in %s:%d
Stack trace:
#0 [internal function]: Foo\{closure}(%s)
#1 %sbug74164.php(%d): call_user_func(%s)
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/call_user_func_001.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ namespace testing {
?>
--EXPECT--
string(6) "foobar"
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access private method testing\foo::priv()
call_user_func() expects argument #1 ($function) to be a valid callback, cannot access protected method testing\foo::prot()
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access private method testing\foo::priv()
call_user_func(): Argument #1 ($function) must be a valid callback, cannot access protected method testing\foo::prot()
8 changes: 4 additions & 4 deletions Zend/tests/call_user_func_002.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ try {
?>
--EXPECTF--
string(3) "foo"
call_user_func() expects argument #1 ($function) to be a valid callback, class 'foo' not found
call_user_func() expects argument #1 ($function) to be a valid callback, class '' not found
call_user_func(): Argument #1 ($function) must be a valid callback, class 'foo' not found
call_user_func(): Argument #1 ($function) must be a valid callback, class '' not found

Warning: Undefined variable: foo in %s on line %d
call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object

Warning: Undefined variable: foo in %s on line %d
call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
4 changes: 2 additions & 2 deletions Zend/tests/call_user_func_006.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ var_dump($y);

?>
--EXPECTF--
Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(42)

Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
int(42)
2 changes: 1 addition & 1 deletion Zend/tests/call_user_func_007.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ Notice: Undefined offset: 0 in %s on line %d

Warning: Trying to access array offset on value of type null in %s on line %d

Warning: foo() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
Warning: foo(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d
array(0) {
}
16 changes: 8 additions & 8 deletions Zend/tests/call_user_func_008.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -25,30 +25,30 @@ var_dump($i, $j);

?>
--EXPECTF--
Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d

Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d
bool(true)
int(0)
int(0)

Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d

Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d
bool(true)
int(0)
int(0)

Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d

Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d
bool(true)
int(0)
int(0)

Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d

Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d
Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d
bool(true)
int(0)
int(0)
4 changes: 2 additions & 2 deletions Zend/tests/call_user_func_009.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ var_dump(\call_user_func('sort', []));

?>
--EXPECTF--
Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d
Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d
bool(true)

Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d
Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d
bool(true)
2 changes: 1 addition & 1 deletion Zend/tests/call_user_func_array_invalid_type.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ try {
}
?>
--EXPECT--
call_user_func_array() expects argument #2 ($args) to be of type array, null given
call_user_func_array(): Argument #2 ($args) must be of type array, null given
2 changes: 1 addition & 1 deletion Zend/tests/closure_027.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NULL
Warning: Undefined variable: y in %s on line %d
Exception: Too few arguments to function {closure}(), 0 passed in %s on line %d and exactly 1 expected

Fatal error: Uncaught TypeError: test() expects argument #1 ($a) to be of type Closure, stdClass given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: test(): Argument #1 ($a) must be of type Closure, stdClass given, called in %s:%d
Stack trace:
#0 %s(%d): test(Object(stdClass))
#1 {main}
Expand Down
6 changes: 3 additions & 3 deletions Zend/tests/closure_059.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ try {
echo "Exception: " . $e->getMessage() . "\n";
}
--EXPECTF--
Exception: {closure}() expects argument #1 ($a) to be of type A, B given, called in %s on line %d
Exception: {closure}() expects argument #1 ($a) to be of type A, B given
Exception: {closure}() expects argument #1 ($a) to be of type A, B given
Exception: {closure}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d
Exception: {closure}(): Argument #1 ($a) must be of type A, B given
Exception: {closure}(): Argument #1 ($a) must be of type A, B given
2 changes: 1 addition & 1 deletion Zend/tests/exception_017.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Error: Cannot call abstract method C::foo() in %s:%d
Stack trace:
#0 {main}

TypeError: foo() expects argument #1 ($x) to be of type callable, string given, called in %s on line %d and defined in %s:%d
TypeError: foo(): Argument #1 ($x) must be of type callable, string given, called in %s:%d
Stack trace:
#0 %s(%d): foo('C::foo')
#1 {main}
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/exception_handler_004.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set_exception_handler(array("", ""));
echo "Done\n";
?>
--EXPECTF--
Warning: set_exception_handler() expects argument #1 ($exception_handler) to be a valid callback in %s on line %d
Warning: set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback in %s on line %d

Warning: set_exception_handler() expects argument #1 ($exception_handler) to be a valid callback in %s on line %d
Warning: set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback in %s on line %d
Done
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,6 @@ Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
TypeError
bat() expects argument #1 ($foo) to be of type int, string given, called in %s on line %d
bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d
TypeError
bat() expects argument #2 ($bar) to be of type string, int given, called in %s on line %d
bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ try {
}

--EXPECTF--
foo() expects argument #2 ($bar) to be of type int, array given, called in %s on line %d
foo() expects argument #4 ($bar) to be of type int, array given, called in %s on line %d
foo(): Argument #2 ($bar) must be of type int, array given, called in %s on line %d
foo(): Argument #4 ($bar) must be of type int, array given, called in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/generators/generator_with_type_check.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ function gen(array $a) { yield; }
gen(42);
?>
--EXPECTF--
Fatal error: Uncaught TypeError: gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s:%d
Stack trace:
#0 %sgenerator_with_type_check.php(3): gen(42)
#1 {main}
Expand Down
4 changes: 2 additions & 2 deletions Zend/tests/generators/generator_with_type_check_2.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,5 @@ try {
}
?>
--EXPECTF--
gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d
gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d
gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d
2 changes: 1 addition & 1 deletion Zend/tests/generators/throw_not_an_exception.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ $gen->throw(new stdClass);

?>
--EXPECTF--
Fatal error: Uncaught TypeError: Generator::throw() expects argument #1 ($exception) to be of type Throwable, object given in %s:%d
Fatal error: Uncaught TypeError: Generator::throw(): Argument #1 ($exception) must be of type Throwable, object given in %s:%d
Stack trace:
#0 %s(%d): Generator->throw(Object(stdClass))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/methods-on-non-objects-call-user-func.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ try {
}
?>
--EXPECT--
call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object
call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object
2 changes: 1 addition & 1 deletion Zend/tests/ns_071.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ new bar(new \stdclass);
--EXPECTF--
NULL

Fatal error: Uncaught TypeError: foo\bar::__construct() expects argument #1 ($x) to be of type ?array, object given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: foo\bar::__construct(): Argument #1 ($x) must be of type ?array, object given, called in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/ns_072.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ object(foo\test)#%d (0) {
}
NULL

Fatal error: Uncaught TypeError: foo\bar::__construct() expects argument #1 ($x) to be of type ?foo\foo, stdClass given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: foo\bar::__construct(): Argument #1 ($x) must be of type ?foo\foo, stdClass given, called in %s:%d
Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/object_types/type_hint_in_class_method.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $one = new One();
$one->a(new One());
$one->a(123);
--EXPECTF--
Fatal error: Uncaught TypeError: One::a() expects argument #1 ($obj) to be of type object, int given, called in %s:%d
Fatal error: Uncaught TypeError: One::a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d
Stack trace:
#0 %s(9): One->a(123)
#1 {main}
Expand Down
2 changes: 1 addition & 1 deletion Zend/tests/object_types/type_hint_in_function.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ function a(object $obj) {}
a(new A());
a(123);
--EXPECTF--
Fatal error: Uncaught TypeError: a() expects argument #1 ($obj) to be of type object, int given, called in %s on line %d and defined in %s:%d
Fatal error: Uncaught TypeError: a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d
Stack trace:
#0 %s(7): a(123)
#1 {main}
Expand Down
Loading