Make type error messages more consistent

Closes GH-5092
This commit is contained in:
Máté Kocsis 2020-01-29 20:06:13 +01:00
parent 72bd55902d
commit ac0853eb26
No known key found for this signature in database
GPG key ID: FD055E41728BF310
389 changed files with 1680 additions and 1693 deletions

View file

@ -25,7 +25,7 @@ var_dump(constant("test const"));
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
TypeError: define() expects parameter 1 to be string, array given TypeError: define() expects argument #1 ($constant_name) to be of type string, array given
Notice: Constant TRUE already defined in %s on line %d Notice: Constant TRUE already defined in %s on line %d
bool(false) bool(false)

View file

@ -46,8 +46,8 @@ string(3) "foo"
Warning: get_class() called without object from outside a class in %s on line %d Warning: get_class() called without object from outside a class in %s on line %d
bool(false) bool(false)
get_class() expects parameter 1 to be object, string given get_class() expects argument #1 ($object) to be of type object, string given
string(3) "foo" string(3) "foo"
string(4) "foo2" string(4) "foo2"
get_class() expects parameter 1 to be object, null given get_class() expects argument #1 ($object) to be of type object, null given
Done Done

View file

@ -32,7 +32,7 @@ try {
--EXPECTF-- --EXPECTF--
int(2) int(2)
int(10) int(10)
Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d {closure}() expects argument #1 ($x) to be of type int, string given, called in %s on line %d
array(3) { array(3) {
[0]=> [0]=>
int(20) int(20)
@ -41,4 +41,4 @@ array(3) {
[2]=> [2]=>
int(30) int(30)
} }
Argument 2 passed to {closure}() must be of the type int or null, string given, called in %s on line %d {closure}() expects argument #2 ($args) to be of type ?int, string given, called in %s on line %d

View file

@ -12,4 +12,4 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Undefined variable: nonesuchvar in %s on line %d Warning: Undefined variable: nonesuchvar in %s on line %d
array_walk() expects parameter 2 to be a valid callback, first array member is not a valid class name or object array_walk() expects argument #2 ($funcname) to be a valid callback, first array member is not a valid class name or object

View file

@ -20,7 +20,7 @@ test($obj);
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of OtherClassName, instance of ClassName given, called in %s on line %d and defined in %s:%d 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
Stack trace: Stack trace:
#0 %s(%d): test(Object(ClassName)) #0 %s(%d): test(Object(ClassName))
#1 {main} #1 {main}

View file

@ -37,7 +37,7 @@ ok
ok ok
ok ok
Fatal error: Uncaught TypeError: Argument 1 passed to foo\test5() must be an instance of bar, instance of foo\bar given, called in %sbug42802.php on line %d and defined in %sbug42802.php:%d 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
Stack trace: Stack trace:
#0 %s(%d): foo\test5(Object(foo\bar)) #0 %s(%d): foo\test5(Object(foo\bar))
#1 {main} #1 {main}

View file

@ -12,7 +12,7 @@ $foo = new foo;
$foo->bar($foo); // Ok! $foo->bar($foo); // Ok!
$foo->bar(new \stdclass); // Error, ok! $foo->bar(new \stdclass); // Error, ok!
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to foobar\foo::bar() must be an instance of foobar\foo, instance of stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php:5 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
Stack trace: Stack trace:
#0 %s(%d): foobar\foo->bar(Object(stdClass)) #0 %s(%d): foobar\foo->bar(Object(stdClass))
#1 {main} #1 {main}

View file

@ -54,4 +54,4 @@ string(1) "y"
ok ok
__callstatic: __callstatic:
string(3) "www" string(3) "www"
call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active

View file

@ -52,5 +52,5 @@ string(1) "y"
__call: __call:
string(1) "y" string(1) "y"
ok ok
call_user_func() expects parameter 1 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, class 'bar' does not have a method 'www'
call_user_func() expects parameter 1 to be a valid callback, cannot access self:: when no class scope is active call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active

View file

@ -24,13 +24,13 @@ class B extends A {
public function func($str) { public function func($str) {
call_user_func_array(array($this, 'parent::func2'), array($str)); call_user_func_array(array($this, 'parent::func2'), array($str));
call_user_func_array(array($this, 'parent::func3'), array($str)); call_user_func_array(array($this, 'parent::func3'), array($str));
try { try {
call_user_func_array(array($this, 'parent::func22'), array($str)); call_user_func_array(array($this, 'parent::func22'), array($str));
} catch (\TypeError $e) { } catch (\TypeError $e) {
echo $e->getMessage() . \PHP_EOL; echo $e->getMessage() . \PHP_EOL;
} }
try { try {
call_user_func_array(array($this, 'parent::inexistent'), array($str)); call_user_func_array(array($this, 'parent::inexistent'), array($str));
} catch (\TypeError $e) { } catch (\TypeError $e) {
@ -58,5 +58,5 @@ $c->func('This should work!');
--EXPECT-- --EXPECT--
string(27) "A::func2: This should work!" string(27) "A::func2: This should work!"
string(27) "A::func3: This should work!" string(27) "A::func3: This should work!"
call_user_func_array() expects parameter 1 to be a valid callback, cannot access private method A::func22() call_user_func_array() expects argument #1 ($function) to be a valid callback, cannot access private method A::func22()
call_user_func_array() expects parameter 1 to be a valid callback, class 'A' does not have a method 'inexistent' call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'A' does not have a method 'inexistent'

View file

@ -24,7 +24,7 @@ class B extends A {
public function func($str) { public function func($str) {
call_user_func_array(array($this, 'self::func2'), array($str)); call_user_func_array(array($this, 'self::func2'), array($str));
call_user_func_array(array($this, 'self::func3'), array($str)); call_user_func_array(array($this, 'self::func3'), array($str));
try { try {
call_user_func_array(array($this, 'self::inexistent'), array($str)); call_user_func_array(array($this, 'self::inexistent'), array($str));
} catch (\TypeError $e) { } catch (\TypeError $e) {
@ -52,4 +52,4 @@ $c->func('This should work!');
--EXPECT-- --EXPECT--
string(27) "B::func2: This should work!" string(27) "B::func2: This should work!"
string(27) "B::func3: This should work!" string(27) "B::func3: This should work!"
call_user_func_array() expects parameter 1 to be a valid callback, class 'B' does not have a method 'inexistent' call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'B' does not have a method 'inexistent'

View file

@ -11,5 +11,5 @@ $args = array_fill(0, 64 * 1024 - 64, 0);
call_user_func_array(function(&$a) {}, $args); call_user_func_array(function(&$a) {}, $args);
echo strval("okey"); echo strval("okey");
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to {closure}() expected to be a reference, value given in %sbug61273.php on line %d Warning: {closure}() expects argument #1 ($a) to be passed by reference, value given in %s on line %d
okey okey

View file

@ -32,7 +32,7 @@ array(1) {
int(1) int(1)
} }
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be of the type array, null given, called in %s on line %d and defined in %s:%d 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
Stack trace: Stack trace:
#0 %s(%d): a(NULL) #0 %s(%d): a(NULL)
#1 {main} #1 {main}

View file

@ -20,6 +20,6 @@ try {
} }
?> ?>
--EXPECT-- --EXPECT--
array_map() expects parameter 1 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' not found or invalid function name
array_map() expects parameter 1 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' not found or invalid function name
array_map() expects parameter 1 to be a valid callback, function '%n %i aoeu %f aoeu %p' 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

View file

@ -13,4 +13,4 @@ try {
} }
?> ?>
--EXPECT-- --EXPECT--
array_map() expects parameter 1 to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name array_map() expects argument #1 ($callback) to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name

View file

@ -76,7 +76,7 @@ $foo->bar($a, $b, $c);
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61 Fatal error: Uncaught Error: Class 'DoesNotExists' not found in %sbug72101.php:61
Stack trace: Stack trace:
#0 %sbug72101.php(8): {closure}(2, 'Parameter 1 to ...', '%s', 8) #0 %sbug72101.php(8): {closure}(2, 'MethodCallbackB...', '%s', 8)
#1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static)) #1 %sbug72101.php(27): PHPUnit_Framework_MockObject_Stub_ReturnCallback->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static)) #2 %sbug72101.php(19): PHPUnit_Framework_MockObject_Matcher->invoked(Object(PHPUnit_Framework_MockObject_Invocation_Static))
#3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static)) #3 %sbug72101.php(52): PHPUnit_Framework_MockObject_InvocationMocker->invoke(Object(PHPUnit_Framework_MockObject_Invocation_Static))

View file

@ -17,10 +17,10 @@ new class {
}; };
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11 Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
object(class@anonymous)#1 (0) { object(class@anonymous)#1 (0) {
} }
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598.php on line 11 Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
object(class@anonymous)#1 (0) { object(class@anonymous)#1 (0) {
} }

View file

@ -20,8 +20,8 @@ new class {
}; };
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14 Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
int(0) int(0)
Warning: Parameter 1 to ref() expected to be a reference, value given in %sbug72598_2.php on line 14 Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
int(0) int(0)

View file

@ -16,7 +16,7 @@ takes_int(log(tan(3.14)));
float(NAN) float(NAN)
bool(true) bool(true)
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, float given, called in %s on line 9 and defined in %s:6 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
Stack trace: Stack trace:
#0 %s(9): takes_int(NAN) #0 %s(9): takes_int(NAN)
#1 {main} #1 {main}

View file

@ -12,7 +12,7 @@ set_error_handler(function ($type, $msg) {
call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable'); call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable');
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught Exception: Parameter 1 to Foo\{closure}() expected to be a reference, value given in %sbug74164.php:%d Fatal error: Uncaught Exception: Foo\{closure}() expects argument #1 ($ref) to be passed by reference, value given in %s:%d
Stack trace: Stack trace:
#0 [internal function]: Foo\{closure}(%s) #0 [internal function]: Foo\{closure}(%s)
#1 %sbug74164.php(%d): call_user_func(%s) #1 %sbug74164.php(%d): call_user_func(%s)

View file

@ -37,5 +37,5 @@ namespace testing {
?> ?>
--EXPECT-- --EXPECT--
string(6) "foobar" string(6) "foobar"
call_user_func() expects parameter 1 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 private method testing\foo::priv()
call_user_func() expects parameter 1 to be a valid callback, cannot access protected method testing\foo::prot() call_user_func() expects argument #1 ($function) to be a valid callback, cannot access protected method testing\foo::prot()

View file

@ -31,11 +31,11 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
string(3) "foo" string(3) "foo"
call_user_func() expects parameter 1 to be a valid callback, class 'foo' not found call_user_func() expects argument #1 ($function) to be a valid callback, class 'foo' not found
call_user_func() expects parameter 1 to be a valid callback, class '' not found call_user_func() expects argument #1 ($function) to be a valid callback, class '' not found
Warning: Undefined variable: foo in %s on line %d Warning: Undefined variable: foo in %s on line %d
call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object
Warning: Undefined variable: foo in %s on line %d Warning: Undefined variable: foo in %s on line %d
call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object

View file

@ -21,8 +21,8 @@ var_dump($y);
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
int(42) int(42)
Warning: Parameter 1 to Foo\bar() expected to be a reference, value given in %s on line %d Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
int(42) int(42)

View file

@ -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: Trying to access array offset on value of type null in %s on line %d
Warning: Parameter 1 to foo() expected to be a reference, value given in %s on line %d Warning: foo() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d
array(0) { array(0) {
} }

View file

@ -25,30 +25,30 @@ var_dump($i, $j);
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a 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
bool(true) bool(true)
int(0) int(0)
int(0) int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a 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
bool(true) bool(true)
int(0) int(0)
int(0) int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a 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
bool(true) bool(true)
int(0) int(0)
int(0) int(0)
Warning: Parameter 1 to test() expected to be a reference, value given in %s on line %d Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d
Warning: Parameter 2 to test() expected to be a 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
bool(true) bool(true)
int(0) int(0)
int(0) int(0)

View file

@ -10,8 +10,8 @@ var_dump(\call_user_func('sort', []));
?> ?>
--EXPECTF-- --EXPECTF--
Warning: Parameter 1 to sort() expected to be a reference, value given in %s on line %d Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d
bool(true) bool(true)
Warning: Parameter 1 to sort() expected to be a reference, value given in %s on line %d Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d
bool(true) bool(true)

View file

@ -15,4 +15,4 @@ try {
} }
?> ?>
--EXPECT-- --EXPECT--
call_user_func_array() expects parameter 2 to be array, null given call_user_func_array() expects argument #2 ($args) to be of type array, null given

View file

@ -3,7 +3,7 @@ Closure 027: Testing Closure type-hint
--FILE-- --FILE--
<?php <?php
function test(closure $a) { function test(Closure $a) {
var_dump($a()); var_dump($a());
} }
@ -30,7 +30,7 @@ NULL
Warning: Undefined variable: y in %s on line %d 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 Exception: Too few arguments to function {closure}(), 0 passed in %s on line %d and exactly 1 expected
Fatal error: Uncaught TypeError: Argument 1 passed to test() must be an instance of Closure, instance of stdClass given, called in %s on line %d and defined in %s:%d 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
Stack trace: Stack trace:
#0 %s(%d): test(Object(stdClass)) #0 %s(%d): test(Object(stdClass))
#1 {main} #1 {main}

View file

@ -33,6 +33,6 @@ try {
echo "Exception: " . $e->getMessage() . "\n"; echo "Exception: " . $e->getMessage() . "\n";
} }
--EXPECTF-- --EXPECTF--
Exception: Argument 1 passed to {closure}() must be an instance of A, instance of B %s Exception: {closure}() expects argument #1 ($a) to be of type A, B given, called in %s on line %d
Exception: Argument 1 passed to {closure}() must be an instance of A, instance of B %s Exception: {closure}() expects argument #1 ($a) to be of type A, B given
Exception: Argument 1 passed to {closure}() must be an instance of A, instance of B %s Exception: {closure}() expects argument #1 ($a) to be of type A, B given

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
errmsg: default value for parameters with array type can only be an array or NULL errmsg: default value for parameters with array type can only be an array or null
--FILE-- --FILE--
<?php <?php

View file

@ -28,7 +28,7 @@ Error: Cannot call abstract method C::foo() in %s:%d
Stack trace: Stack trace:
#0 {main} #0 {main}
TypeError: Argument 1 passed to foo() must be callable, string given, called in %s on line %d and defined in %s:%d TypeError: foo() expects argument #1 ($x) to be of type callable, string given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo('C::foo') #0 %s(%d): foo('C::foo')
#1 {main} #1 {main}

View file

@ -9,7 +9,7 @@ set_exception_handler(array("", ""));
echo "Done\n"; echo "Done\n";
?> ?>
--EXPECTF-- --EXPECTF--
Warning: set_exception_handler() expects the argument (fo) to 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() expects the argument (::) to 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
Done Done

View file

@ -49,6 +49,6 @@ Too few arguments to function bar(), 1 passed in %s and exactly 2 expected
ArgumentCountError ArgumentCountError
Too few arguments to function bat(), 1 passed in %s and exactly 2 expected Too few arguments to function bat(), 1 passed in %s and exactly 2 expected
TypeError TypeError
Argument 1 passed to bat() must be of the type int, string given, called in %s bat() expects argument #1 ($foo) to be of type int, string given, called in %s on line %d
TypeError TypeError
Argument 2 passed to bat() must be of the type string, int given, called in %s bat() expects argument #2 ($bar) to be of type string, int given, called in %s on line %d

View file

@ -0,0 +1,22 @@
--TEST--
Call userland function with incorrect variadic argument type
--FILE--
<?php
function foo($foo, int ...$bar) {}
try {
foo(1, []);
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
}
try {
foo(1, 1, 1, []);
} catch (TypeError $exception) {
echo $exception->getMessage() . "\n";
}
--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

View file

@ -6,7 +6,7 @@ function gen(array $a) { yield; }
gen(42); gen(42);
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check.php on line 3 and defined in %sgenerator_with_type_check.php:2 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
Stack trace: Stack trace:
#0 %sgenerator_with_type_check.php(3): gen(42) #0 %sgenerator_with_type_check.php(3): gen(42)
#1 {main} #1 {main}

View file

@ -18,5 +18,5 @@ try {
} }
?> ?>
--EXPECTF-- --EXPECTF--
Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check_2.php on line 4 gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d
Argument 1 passed to gen() must be of the type array, int given, called in %sgenerator_with_type_check_2.php on line 10 gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d

View file

@ -12,7 +12,7 @@ $gen->throw(new stdClass);
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Generator::throw() expects parameter 1 to be Throwable, object given in %s:%d Fatal error: Uncaught TypeError: Generator::throw() expects argument #1 ($exception) to be of type Throwable, object given in %s:%d
Stack trace: Stack trace:
#0 %s(%d): Generator->throw(Object(stdClass)) #0 %s(%d): Generator->throw(Object(stdClass))
#1 {main} #1 {main}

View file

@ -10,4 +10,4 @@ try {
} }
?> ?>
--EXPECT-- --EXPECT--
call_user_func() expects parameter 1 to be a valid callback, first array member is not a valid class name or object call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object

View file

@ -18,7 +18,7 @@ new bar(new \stdclass);
--EXPECTF-- --EXPECTF--
NULL NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must be of the type array or null, object given, called in %s on line %d and defined in %s:%d 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
Stack trace: Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass)) #0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main} #1 {main}

View file

@ -30,7 +30,7 @@ object(foo\test)#%d (0) {
} }
NULL NULL
Fatal error: Uncaught TypeError: Argument 1 passed to foo\bar::__construct() must implement interface foo\foo or be null, instance of stdClass given, called in %s on line %d and defined in %s:%d 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
Stack trace: Stack trace:
#0 %s(%d): foo\bar->__construct(Object(stdClass)) #0 %s(%d): foo\bar->__construct(Object(stdClass))
#1 {main} #1 {main}

View file

@ -18,7 +18,7 @@ $three = new class extends Two {
}; };
$three->a(); $three->a();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be an object, int returned in %s:%d Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): Two@anonymous->a() #0 %s(%d): Two@anonymous->a()
#1 {main} #1 {main}

View file

@ -8,7 +8,7 @@ function a() : object {
} }
a(); a();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of a() must be an object, int returned in %s:4 Fatal error: Uncaught TypeError: Return value of a() must be of type object, int returned in %s:4
Stack trace: Stack trace:
#0 %s(6): a() #0 %s(6): a()
#1 {main} #1 {main}

View file

@ -18,7 +18,7 @@ $three = new class extends Two {
}; };
$three->a(); $three->a();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be an object, int returned in %s:%d Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): Two@anonymous->a() #0 %s(%d): Two@anonymous->a()
#1 {main} #1 {main}

View file

@ -18,7 +18,7 @@ $three = new class implements Two {
}; };
$three->a(); $three->a();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be an object, int returned in %s:%d Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): Two@anonymous->a() #0 %s(%d): Two@anonymous->a()
#1 {main} #1 {main}

View file

@ -11,7 +11,7 @@ $one = new One();
$one->a(new One()); $one->a(new One());
$one->a(123); $one->a(123);
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to One::a() must be an object, int given, called in %s:4 Fatal error: Uncaught TypeError: One::a() expects argument #1 ($obj) to be of type object, int given, called in %s:%d
Stack trace: Stack trace:
#0 %s(9): One->a(123) #0 %s(9): One->a(123)
#1 {main} #1 {main}

View file

@ -9,7 +9,7 @@ function a(object $obj) {}
a(new A()); a(new A());
a(123); a(123);
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to a() must be an object, int given, called in %s.php on line 7 and defined in %s:4 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
Stack trace: Stack trace:
#0 %s(7): a(123) #0 %s(7): a(123)
#1 {main} #1 {main}

View file

@ -36,7 +36,7 @@ object(bar)#%d (0) {
object(baz)#%d (0) { object(baz)#%d (0) {
} }
Fatal error: Uncaught TypeError: Argument 1 passed to foo::testFoo() must be an instance of foo, instance of stdClass given, called in %s on line %d and defined in %s:%d Fatal error: Uncaught TypeError: foo::testFoo() expects argument #1 ($obj) to be of type foo, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo->testFoo(Object(stdClass)) #0 %s(%d): foo->testFoo(Object(stdClass))
#1 {main} #1 {main}

View file

@ -7,7 +7,7 @@ function test1() : array {
test1(); test1();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, none returned in %s:%d Fatal error: Uncaught TypeError: Return value of test1() must be of type array, none returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): test1() #0 %s(%d): test1()
#1 {main} #1 {main}

View file

@ -8,7 +8,7 @@ function test1() : array {
test1(); test1();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, null returned in %s:%d Fatal error: Uncaught TypeError: Return value of test1() must be of type array, null returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): test1() #0 %s(%d): test1()
#1 {main} #1 {main}

View file

@ -7,7 +7,7 @@ function test1() : array {
} }
test1(); test1();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, int returned in %s:%d Fatal error: Uncaught TypeError: Return value of test1() must be of type array, int returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): test1() #0 %s(%d): test1()
#1 {main} #1 {main}

View file

@ -8,7 +8,7 @@ function test1() : array {
test1(); test1();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of test1() must be of the type array, string returned in %s:%d Fatal error: Uncaught TypeError: Return value of test1() must be of type array, string returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): test1() #0 %s(%d): test1()
#1 {main} #1 {main}

View file

@ -13,7 +13,7 @@ class qux {
$qux = new qux(); $qux = new qux();
$qux->foo(); $qux->foo();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of qux::foo() must be an instance of foo, instance of qux returned in %s:%d Fatal error: Uncaught TypeError: Return value of qux::foo() must be of type foo, qux returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): qux->foo() #0 %s(%d): qux->foo()
#1 {main} #1 {main}

View file

@ -9,7 +9,7 @@ function &foo(array &$in) : array {
$array = [1, 2, 3]; $array = [1, 2, 3];
var_dump(foo($array)); var_dump(foo($array));
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array, null returned in %s:%d Fatal error: Uncaught TypeError: Return value of foo() must be of type array, null returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo(Array) #0 %s(%d): foo(Array)
#1 {main} #1 {main}

View file

@ -14,7 +14,7 @@ class foo {
$baz = new foo(); $baz = new foo();
var_dump($func=$baz->bar(), $func()); var_dump($func=$baz->bar(), $func());
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo::{closure}() must be of the type array, null returned in %s:%d Fatal error: Uncaught TypeError: Return value of foo::{closure}() must be of type array, null returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo->{closure}() #0 %s(%d): foo->{closure}()
#1 {main} #1 {main}

View file

@ -17,4 +17,4 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
Return value of foo() must be an instance of stdClass, array returned in %s on line %d Return value of foo() must be of type stdClass, array returned in %s on line %d

View file

@ -21,7 +21,7 @@ Stack trace:
#0 %s(%d): foo() #0 %s(%d): foo()
#1 {main} #1 {main}
Next TypeError: Return value of foo() must be of the type array, null returned in %s29.php:%d Next TypeError: Return value of foo() must be of type array, null returned in %s29.php:%d
Stack trace: Stack trace:
#0 %s(%d): foo() #0 %s(%d): foo()
#1 {main} #1 {main}

View file

@ -16,7 +16,7 @@ foo(0);
ok ok
ok ok
Fatal error: Uncaught TypeError: Return value of foo() must be of the type array or null, int returned in %s030.php:3 Fatal error: Uncaught TypeError: Return value of foo() must be of type ?array, int returned in %s030.php:3
Stack trace: Stack trace:
#0 %s030.php(10): foo(0) #0 %s030.php(10): foo(0)
#1 {main} #1 {main}

View file

@ -16,4 +16,4 @@ try {
} }
?> ?>
--EXPECT-- --EXPECT--
string(68) "Return value of getNumber() must be of the type int, string returned" string(64) "Return value of getNumber() must be of type int, string returned"

View file

@ -16,7 +16,7 @@ function boom(): array {
boom(); boom();
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of boom() must be of the type array, null returned in %sbug71092.php:%d Fatal error: Uncaught TypeError: Return value of boom() must be of type array, null returned in %sbug71092.php:%d
Stack trace: Stack trace:
#0 %s(%d): boom() #0 %s(%d): boom()
#1 {main} #1 {main}

View file

@ -11,4 +11,4 @@ if (!PHP_DEBUG) die('skip requires debug build');
zend_test_array_return(); zend_test_array_return();
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Return value of zend_test_array_return() must be of the type array, null returned in %s on line %d Fatal error: Return value of zend_test_array_return() must be of type array, null returned in %s on line %d

View file

@ -9,7 +9,7 @@ function get_config(): array {
get_config(); get_config();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of get_config() must be of the type array, int returned in %s:%d Fatal error: Uncaught TypeError: Return value of get_config() must be of type array, int returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): get_config() #0 %s(%d): get_config()
#1 {main} #1 {main}

View file

@ -8,7 +8,7 @@ function foo(): DateTime {
foo(); foo();
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Return value of foo() must be an instance of DateTime, null returned in %s:%d Fatal error: Uncaught TypeError: Return value of foo() must be of type DateTime, null returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo() #0 %s(%d): foo()
#1 {main} #1 {main}

View file

@ -38,6 +38,6 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
Return value of C::test1() must be of the type int, string returned Return value of C::test1() must be of type int, string returned
Argument 1 passed to C::test2() must be of the type int, string given, called in %s on line %d C::test2() expects argument #1 ($arg) to be of type int, string given, called in %s on line %d
Argument 1 passed to C::test3() must be of the type int, string given, called in %s on line %d C::test3() expects argument #1 ($arg) to be of type int, string given, called in %s on line %d

View file

@ -12,7 +12,7 @@ foo(123);
--EXPECTF-- --EXPECTF--
3 3
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be of the type array, int given, called in %s on line 7 and defined in %s:2 Fatal error: Uncaught TypeError: foo() expects argument #1 ($a) to be of type array, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo(123) #0 %s(%d): foo(123)
#1 {main} #1 {main}

View file

@ -29,7 +29,7 @@ array(2) {
string(3) "foo" string(3) "foo"
} }
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be callable, array given, called in %s on line %d and defined in %s:%d Fatal error: Uncaught TypeError: foo() expects argument #1 ($bar) to be of type callable, array given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo(Array) #0 %s(%d): foo(Array)
#1 {main} #1 {main}

View file

@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc';
// calls within that file should stay strict, despite being included by weak file // calls within that file should stay strict, despite being included by weak file
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc:5 Fatal error: Uncaught TypeError: takes_int() expects argument #1 ($x) to be of type int, float given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): takes_int(1) #0 %s(%d): takes_int(1)
#1 %s(%d): require('%s') #1 %s(%d): require('%s')

View file

@ -8,7 +8,7 @@ foo(null);
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to foo() must be an instance of bar, null given, called in %s on line %d and defined in %s:%d Fatal error: Uncaught TypeError: foo() expects argument #1 ($ex) to be of type bar, null given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): foo(NULL) #0 %s(%d): foo(NULL)
#1 {main} #1 {main}

View file

@ -28,8 +28,8 @@ try {
?> ?>
--EXPECT-- --EXPECT--
*** Trying Ord With Integer *** Trying Ord With Integer
*** Caught ord() expects parameter 1 to be string, int given *** Caught ord() expects argument #1 ($character) to be of type string, int given
*** Trying Array Map With Invalid Callback *** Trying Array Map With Invalid Callback
*** Caught array_map() expects parameter 1 to be a valid callback, first array member is not a valid class name or object *** Caught array_map() expects argument #1 ($callback) to be a valid callback, first array member is not a valid class name or object
*** Trying Strlen With Float *** Trying Strlen With Float
*** Caught strlen() expects parameter 1 to be string, float given *** Caught strlen() expects argument #1 ($str) to be of type string, float given

View file

@ -44,4 +44,4 @@ object(ArrayIterator)#1 (1) {
int(3) int(3)
} }
} }
Argument 1 passed to test() must be iterable, int given, called in %s on line %d test() expects argument #1 ($iterable) to be of type iterable, int given, called in %s on line %d

View file

@ -29,4 +29,4 @@ array(0) {
} }
object(Generator)#2 (0) { object(Generator)#2 (0) {
} }
Return value of baz() must be iterable, int returned Return value of baz() must be of type iterable, int returned

View file

@ -78,16 +78,16 @@ E_NOTICE: A non well formed numeric value encountered on line %d
int(1) int(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying int(%d) *** Trying int(%d)
int(%d) int(%d)
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
int(1) int(1)
@ -96,22 +96,22 @@ int(1)
int(0) int(0)
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) { *** Trying object(stdClass)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying object(Stringable)#%s (0) { *** Trying object(Stringable)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying resource(%d) of type (stream) *** Trying resource(%d) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d
Testing 'float' type: Testing 'float' type:
@ -132,10 +132,10 @@ E_NOTICE: A non well formed numeric value encountered on line %d
float(1) float(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying int(%d) *** Trying int(%d)
float(%s) float(%s)
@ -150,22 +150,22 @@ float(1)
float(0) float(0)
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) { *** Trying object(stdClass)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying object(Stringable)#%s (0) { *** Trying object(Stringable)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying resource(%d) of type (stream) *** Trying resource(%d) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d
Testing 'string' type: Testing 'string' type:
@ -203,22 +203,22 @@ string(1) "1"
string(0) "" string(0) ""
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) { *** Trying object(stdClass)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying object(Stringable)#%s (0) { *** Trying object(Stringable)#%s (0) {
} }
string(6) "foobar" string(6) "foobar"
*** Trying resource(%d) of type (stream) *** Trying resource(%d) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d
Testing 'bool' type: Testing 'bool' type:
@ -256,21 +256,21 @@ bool(true)
bool(false) bool(false)
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#%s (0) { *** Trying object(stdClass)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying object(Stringable)#%s (0) { *** Trying object(Stringable)#%s (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying resource(%d) of type (stream) *** Trying resource(%d) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d
Done Done

View file

@ -96,9 +96,9 @@ float(10.7)
Testing string add val Testing string add val
string(14) "this is a test" string(14) "this is a test"
Testing int with default null constant Testing int with default null constant
Argument 1 passed to int_val_default_null() must be of the type int, null given, called in %s on line %d int_val_default_null() expects argument #1 ($a) to be of type int, null given, called in %s on line %d
Testing int with null null constant Testing int with null null constant
Argument 1 passed to int_val_default_null() must be of the type int, null given, called in %s on line %d int_val_default_null() expects argument #1 ($a) to be of type int, null given, called in %s on line %d
Testing nullable int with default null constant Testing nullable int with default null constant
NULL NULL
Testing nullable int with null null constant Testing nullable int with null null constant

View file

@ -13,7 +13,7 @@ var_dump(int_val());
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to int_val() must be of the type int, string given, called in %s on line %d and defined in %s:%d Fatal error: Uncaught TypeError: int_val() expects argument #1 ($a) to be of type int, string given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): int_val() #0 %s(%d): int_val()
#1 {main} #1 {main}

View file

@ -27,13 +27,13 @@ echo PHP_EOL . "Done";
?> ?>
--EXPECTF-- --EXPECTF--
Testing int: Testing int:
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d
Testing float: Testing float:
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d
Testing string: Testing string:
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d
Testing bool: Testing bool:
*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d
Testing int nullable: Testing int nullable:
NULL NULL
Testing float nullable: Testing float nullable:

View file

@ -75,30 +75,30 @@ int(1)
E_NOTICE: A non well formed numeric value encountered on line %d E_NOTICE: A non well formed numeric value encountered on line %d
int(1) int(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Caught Return value of {closure}() must be of type int, string returned in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Caught Return value of {closure}() must be of type int, string returned in %s on line %d
*** Trying int(2147483647) *** Trying int(2147483647)
int(2147483647) int(2147483647)
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Return value of {closure}() must be of the type int, float returned in %s on line %d *** Caught Return value of {closure}() must be of type int, float returned in %s on line %d
*** Trying bool(true) *** Trying bool(true)
int(1) int(1)
*** Trying bool(false) *** Trying bool(false)
int(0) int(0)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type int, null returned in %s on line %d *** Caught Return value of {closure}() must be of type int, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type int, array returned in %s on line %d *** Caught Return value of {closure}() must be of type int, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Caught Return value of {closure}() must be of type int, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Caught Return value of {closure}() must be of type int, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type int, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type int, resource returned in %s on line %d
Testing 'float' type: Testing 'float' type:
*** Trying int(1) *** Trying int(1)
@ -113,9 +113,9 @@ float(1.5)
E_NOTICE: A non well formed numeric value encountered on line %d E_NOTICE: A non well formed numeric value encountered on line %d
float(1) float(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Return value of {closure}() must be of the type float, string returned in %s on line %d *** Caught Return value of {closure}() must be of type float, string returned in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Return value of {closure}() must be of the type float, string returned in %s on line %d *** Caught Return value of {closure}() must be of type float, string returned in %s on line %d
*** Trying int(2147483647) *** Trying int(2147483647)
float(2147483647) float(2147483647)
*** Trying float(NAN) *** Trying float(NAN)
@ -125,18 +125,18 @@ float(1)
*** Trying bool(false) *** Trying bool(false)
float(0) float(0)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type float, null returned in %s on line %d *** Caught Return value of {closure}() must be of type float, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type float, array returned in %s on line %d *** Caught Return value of {closure}() must be of type float, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type float, object returned in %s on line %d *** Caught Return value of {closure}() must be of type float, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type float, object returned in %s on line %d *** Caught Return value of {closure}() must be of type float, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type float, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type float, resource returned in %s on line %d
Testing 'string' type: Testing 'string' type:
*** Trying int(1) *** Trying int(1)
@ -162,18 +162,18 @@ string(1) "1"
*** Trying bool(false) *** Trying bool(false)
string(0) "" string(0) ""
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type string, null returned in %s on line %d *** Caught Return value of {closure}() must be of type string, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type string, array returned in %s on line %d *** Caught Return value of {closure}() must be of type string, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type string, object returned in %s on line %d *** Caught Return value of {closure}() must be of type string, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
string(6) "foobar" string(6) "foobar"
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type string, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type string, resource returned in %s on line %d
Testing 'bool' type: Testing 'bool' type:
*** Trying int(1) *** Trying int(1)
@ -199,17 +199,17 @@ bool(true)
*** Trying bool(false) *** Trying bool(false)
bool(false) bool(false)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type bool, null returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type bool, array returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type bool, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, resource returned in %s on line %d
Done Done

View file

@ -75,30 +75,30 @@ int(1)
E_NOTICE: A non well formed numeric value encountered on line %d E_NOTICE: A non well formed numeric value encountered on line %d
int(1) int(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Caught Return value of {closure}() must be of type int, string returned in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Return value of {closure}() must be of the type int, string returned in %s on line %d *** Caught Return value of {closure}() must be of type int, string returned in %s on line %d
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
int(9223372036854775807) int(9223372036854775807)
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Return value of {closure}() must be of the type int, float returned in %s on line %d *** Caught Return value of {closure}() must be of type int, float returned in %s on line %d
*** Trying bool(true) *** Trying bool(true)
int(1) int(1)
*** Trying bool(false) *** Trying bool(false)
int(0) int(0)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type int, null returned in %s on line %d *** Caught Return value of {closure}() must be of type int, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type int, array returned in %s on line %d *** Caught Return value of {closure}() must be of type int, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Caught Return value of {closure}() must be of type int, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type int, object returned in %s on line %d *** Caught Return value of {closure}() must be of type int, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type int, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type int, resource returned in %s on line %d
Testing 'float' type: Testing 'float' type:
*** Trying int(1) *** Trying int(1)
@ -113,9 +113,9 @@ float(1.5)
E_NOTICE: A non well formed numeric value encountered on line %d E_NOTICE: A non well formed numeric value encountered on line %d
float(1) float(1)
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Return value of {closure}() must be of the type float, string returned in %s on line %d *** Caught Return value of {closure}() must be of type float, string returned in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Return value of {closure}() must be of the type float, string returned in %s on line %d *** Caught Return value of {closure}() must be of type float, string returned in %s on line %d
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
float(9.2233720368548E+18) float(9.2233720368548E+18)
*** Trying float(NAN) *** Trying float(NAN)
@ -125,18 +125,18 @@ float(1)
*** Trying bool(false) *** Trying bool(false)
float(0) float(0)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type float, null returned in %s on line %d *** Caught Return value of {closure}() must be of type float, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type float, array returned in %s on line %d *** Caught Return value of {closure}() must be of type float, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type float, object returned in %s on line %d *** Caught Return value of {closure}() must be of type float, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type float, object returned in %s on line %d *** Caught Return value of {closure}() must be of type float, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type float, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type float, resource returned in %s on line %d
Testing 'string' type: Testing 'string' type:
*** Trying int(1) *** Trying int(1)
@ -162,18 +162,18 @@ string(1) "1"
*** Trying bool(false) *** Trying bool(false)
string(0) "" string(0) ""
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type string, null returned in %s on line %d *** Caught Return value of {closure}() must be of type string, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type string, array returned in %s on line %d *** Caught Return value of {closure}() must be of type string, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type string, object returned in %s on line %d *** Caught Return value of {closure}() must be of type string, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
string(6) "foobar" string(6) "foobar"
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type string, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type string, resource returned in %s on line %d
Testing 'bool' type: Testing 'bool' type:
*** Trying int(1) *** Trying int(1)
@ -199,17 +199,17 @@ bool(true)
*** Trying bool(false) *** Trying bool(false)
bool(false) bool(false)
*** Trying NULL *** Trying NULL
*** Caught Return value of {closure}() must be of the type bool, null returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, null returned in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Return value of {closure}() must be of the type bool, array returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, array returned in %s on line %d
*** Trying object(stdClass)#6 (0) { *** Trying object(stdClass)#6 (0) {
} }
*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d
*** Trying object(Stringable)#7 (0) { *** Trying object(Stringable)#7 (0) {
} }
*** Caught Return value of {closure}() must be of the type bool, object returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Return value of {closure}() must be of the type bool, resource returned in %s on line %d *** Caught Return value of {closure}() must be of type bool, resource returned in %s on line %d
Done Done

View file

@ -60,52 +60,52 @@ Testing 'int' type:
int(1) int(1)
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying int(2147483647) *** Trying int(2147483647)
int(2147483647) int(2147483647)
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d
Testing 'float' type: Testing 'float' type:
@ -113,7 +113,7 @@ Testing 'float' type:
float(1) float(1)
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
float(1) float(1)
@ -122,13 +122,13 @@ float(1)
float(1.5) float(1.5)
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying int(2147483647) *** Trying int(2147483647)
float(2147483647) float(2147483647)
@ -137,42 +137,42 @@ float(2147483647)
float(NAN) float(NAN)
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d
Testing 'string' type: Testing 'string' type:
*** Trying int(1) *** Trying int(1)
*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d
*** Trying string(1) "1" *** Trying string(1) "1"
string(1) "1" string(1) "1"
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
string(2) "1a" string(2) "1a"
@ -184,63 +184,63 @@ string(1) "a"
string(0) "" string(0) ""
*** Trying int(2147483647) *** Trying int(2147483647)
*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d
Testing 'bool' type: Testing 'bool' type:
*** Trying int(1) *** Trying int(1)
*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying int(2147483647) *** Trying int(2147483647)
*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
bool(true) bool(true)
@ -249,21 +249,21 @@ bool(true)
bool(false) bool(false)
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d
Done Done

View file

@ -60,52 +60,52 @@ Testing 'int' type:
int(1) int(1)
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
int(9223372036854775807) int(9223372036854775807)
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d
Testing 'float' type: Testing 'float' type:
@ -113,7 +113,7 @@ Testing 'float' type:
float(1) float(1)
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
float(1) float(1)
@ -122,13 +122,13 @@ float(1)
float(1.5) float(1.5)
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
float(9.2233720368548E+18) float(9.2233720368548E+18)
@ -137,42 +137,42 @@ float(9.2233720368548E+18)
float(NAN) float(NAN)
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d
Testing 'string' type: Testing 'string' type:
*** Trying int(1) *** Trying int(1)
*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d
*** Trying string(1) "1" *** Trying string(1) "1"
string(1) "1" string(1) "1"
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
string(2) "1a" string(2) "1a"
@ -184,63 +184,63 @@ string(1) "a"
string(0) "" string(0) ""
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying bool(false) *** Trying bool(false)
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d
Testing 'bool' type: Testing 'bool' type:
*** Trying int(1) *** Trying int(1)
*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d
*** Trying string(1) "1" *** Trying string(1) "1"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying float(1) *** Trying float(1)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying float(1.5) *** Trying float(1.5)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying string(2) "1a" *** Trying string(2) "1a"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying string(1) "a" *** Trying string(1) "a"
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying string(0) "" *** Trying string(0) ""
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying int(9223372036854775807) *** Trying int(9223372036854775807)
*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d
*** Trying float(NAN) *** Trying float(NAN)
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying bool(true) *** Trying bool(true)
bool(true) bool(true)
@ -249,21 +249,21 @@ bool(true)
bool(false) bool(false)
*** Trying NULL *** Trying NULL
*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d
*** Trying array(0) { *** Trying array(0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#5 (0) { *** Trying object(stdClass)#5 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying object(Stringable)#6 (0) { *** Trying object(Stringable)#6 (0) {
} }
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying resource(5) of type (stream) *** Trying resource(5) of type (stream)
*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d
Done Done

View file

@ -57,28 +57,28 @@ Testing 'int' type:
int(1) int(1)
*** Trying float value *** Trying float value
*** Caught Argument 1 passed to {closure}() must be of the type int, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d
*** Trying string value *** Trying string value
*** Caught Argument 1 passed to {closure}() must be of the type int, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d
*** Trying true value *** Trying true value
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying false value *** Trying false value
*** Caught Argument 1 passed to {closure}() must be of the type int, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d
*** Trying null value *** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type int, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d
*** Trying array value *** Trying array value
*** Caught Argument 1 passed to {closure}() must be of the type int, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d
*** Trying object value *** Trying object value
*** Caught Argument 1 passed to {closure}() must be of the type int, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d
*** Trying resource value *** Trying resource value
*** Caught Argument 1 passed to {closure}() must be of the type int, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d
Testing 'float' type: Testing 'float' type:
@ -89,65 +89,65 @@ float(1)
float(1) float(1)
*** Trying string value *** Trying string value
*** Caught Argument 1 passed to {closure}() must be of the type float, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d
*** Trying true value *** Trying true value
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying false value *** Trying false value
*** Caught Argument 1 passed to {closure}() must be of the type float, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d
*** Trying null value *** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type float, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d
*** Trying array value *** Trying array value
*** Caught Argument 1 passed to {closure}() must be of the type float, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d
*** Trying object value *** Trying object value
*** Caught Argument 1 passed to {closure}() must be of the type float, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d
*** Trying resource value *** Trying resource value
*** Caught Argument 1 passed to {closure}() must be of the type float, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d
Testing 'string' type: Testing 'string' type:
*** Trying integer value *** Trying integer value
*** Caught Argument 1 passed to {closure}() must be of the type string, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d
*** Trying float value *** Trying float value
*** Caught Argument 1 passed to {closure}() must be of the type string, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d
*** Trying string value *** Trying string value
string(1) "1" string(1) "1"
*** Trying true value *** Trying true value
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying false value *** Trying false value
*** Caught Argument 1 passed to {closure}() must be of the type string, bool given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d
*** Trying null value *** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type string, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d
*** Trying array value *** Trying array value
*** Caught Argument 1 passed to {closure}() must be of the type string, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d
*** Trying object value *** Trying object value
*** Caught Argument 1 passed to {closure}() must be of the type string, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d
*** Trying resource value *** Trying resource value
*** Caught Argument 1 passed to {closure}() must be of the type string, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d
Testing 'bool' type: Testing 'bool' type:
*** Trying integer value *** Trying integer value
*** Caught Argument 1 passed to {closure}() must be of the type bool, int given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d
*** Trying float value *** Trying float value
*** Caught Argument 1 passed to {closure}() must be of the type bool, float given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d
*** Trying string value *** Trying string value
*** Caught Argument 1 passed to {closure}() must be of the type bool, string given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d
*** Trying true value *** Trying true value
bool(true) bool(true)
@ -156,15 +156,15 @@ bool(true)
bool(false) bool(false)
*** Trying null value *** Trying null value
*** Caught Argument 1 passed to {closure}() must be of the type bool, null given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d
*** Trying array value *** Trying array value
*** Caught Argument 1 passed to {closure}() must be of the type bool, array given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d
*** Trying object value *** Trying object value
*** Caught Argument 1 passed to {closure}() must be of the type bool, object given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d
*** Trying resource value *** Trying resource value
*** Caught Argument 1 passed to {closure}() must be of the type bool, resource given, called in %s on line %d *** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d
Done Done

View file

@ -75,7 +75,7 @@ object(B)#3 (0) {
object(A)#3 (0) { object(A)#3 (0) {
} }
Return value of A::test2() must be an instance of B, instance of A returned Return value of A::test2() must be of type B, A returned
object(A)#3 (0) { object(A)#3 (0) {
} }
@ -84,8 +84,8 @@ object(C)#3 (0) {
object(A)#3 (0) { object(A)#3 (0) {
} }
Return value of A::test4() must be of type B|array, instance of A returned Return value of A::test4() must be of type B|array, A returned
Return value of {closure}() must be an instance of static, instance of stdClass returned Return value of {closure}() must be of type static, stdClass returned
object(A)#1 (0) { object(A)#1 (0) {
} }

View file

@ -31,7 +31,7 @@ object(P)#2 (0) {
object(P)#2 (0) { object(P)#2 (0) {
} }
Fatal error: Uncaught TypeError: Return value of C::test() must be an instance of P, instance of C returned in %s:%d Fatal error: Uncaught TypeError: Return value of C::test() must be of type P, C returned in %s:%d
Stack trace: Stack trace:
#0 %s(%d): C->test(Object(C)) #0 %s(%d): C->test(Object(C))
#1 {main} #1 {main}

View file

@ -13,7 +13,7 @@ require 'strict_call_weak_2.inc';
function_declared_in_weak_mode(1.0); function_declared_in_weak_mode(1.0);
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to function_declared_in_weak_mode() must be of the type int, float given, called in %sstrict_call_weak.php on line 10 and defined in %sstrict_call_weak_2.inc:5 Fatal error: Uncaught TypeError: function_declared_in_weak_mode() expects argument #1 ($x) to be of type int, float given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): function_declared_in_weak_mode(1) #0 %s(%d): function_declared_in_weak_mode(1)
#1 {main} #1 {main}

View file

@ -13,7 +13,7 @@ require 'strict_call_weak_explicit_2.inc';
function_declared_in_weak_mode(1.0); function_declared_in_weak_mode(1.0);
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to function_declared_in_weak_mode() must be of the type int, float given, called in %sstrict_call_weak_explicit.php on line 10 and defined in %sstrict_call_weak_explicit_2.inc:5 Fatal error: Uncaught TypeError: function_declared_in_weak_mode() expects argument #1 ($x) to be of type int, float given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): function_declared_in_weak_mode(1) #0 %s(%d): function_declared_in_weak_mode(1)
#1 {main} #1 {main}

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
Typed references must be kept track of and always be only the intersection of the types currently holding that reference Typed references must be kept track of and always be only the intersection of the type currently holding that reference
--FILE-- --FILE--
<?php <?php

View file

@ -1,5 +1,5 @@
--TEST-- --TEST--
The default value must be legal for one of the types in the union The default value must be legal for one of the type in the union
--FILE-- --FILE--
<?php <?php

View file

@ -68,7 +68,7 @@ int(42)
int(42) int(42)
int(42) int(42)
Cannot assign stdClass to property Test::$prop of type X|Y|Z|int Cannot assign stdClass to property Test::$prop of type X|Y|Z|int
Argument 1 passed to Test::method() must be of type X|Y|Z|int, instance of stdClass given, called in %s on line %d Test::method() expects argument #1 ($arg) to be of type X|Y|Z|int, stdClass given, called in %s on line %d
object(X)#4 (0) { object(X)#4 (0) {
} }
object(X)#6 (0) { object(X)#6 (0) {

View file

@ -37,7 +37,7 @@ function test(string $type, array $values) {
} catch (TypeError $e) { } catch (TypeError $e) {
$msg = $e->getMessage(); $msg = $e->getMessage();
$msg = strstr($msg, ', called in', true); $msg = strstr($msg, ', called in', true);
$msg = str_replace('1 passed to {closure}()', '...', $msg); $msg = str_replace('{closure}() expects argument #1', 'Argument ...', $msg);
echo $msg; echo $msg;
} }
echo "\n"; echo "\n";
@ -70,86 +70,86 @@ Type int|float:
42 => 42 42 => 42
42.0 => 42.0 42.0 => 42.0
INF => INF INF => INF
"42" => Argument ... must be of type int|float, string given "42" => Argument ... ($arg) to be of type int|float, string given
"42.0" => Argument ... must be of type int|float, string given "42.0" => Argument ... ($arg) to be of type int|float, string given
"42x" => Argument ... must be of type int|float, string given "42x" => Argument ... ($arg) to be of type int|float, string given
"x" => Argument ... must be of type int|float, string given "x" => Argument ... ($arg) to be of type int|float, string given
"" => Argument ... must be of type int|float, string given "" => Argument ... ($arg) to be of type int|float, string given
true => Argument ... must be of type int|float, bool given true => Argument ... ($arg) to be of type int|float, bool given
false => Argument ... must be of type int|float, bool given false => Argument ... ($arg) to be of type int|float, bool given
null => Argument ... must be of type int|float, null given null => Argument ... ($arg) to be of type int|float, null given
[] => Argument ... must be of type int|float, array given [] => Argument ... ($arg) to be of type int|float, array given
new stdClass => Argument ... must be of type int|float, object given new stdClass => Argument ... ($arg) to be of type int|float, object given
new WithToString => Argument ... must be of type int|float, object given new WithToString => Argument ... ($arg) to be of type int|float, object given
Type int|float|false: Type int|float|false:
42 => 42 42 => 42
42.0 => 42.0 42.0 => 42.0
INF => INF INF => INF
"42" => Argument ... must be of type int|float|false, string given "42" => Argument ... ($arg) to be of type int|float|false, string given
"42.0" => Argument ... must be of type int|float|false, string given "42.0" => Argument ... ($arg) to be of type int|float|false, string given
"42x" => Argument ... must be of type int|float|false, string given "42x" => Argument ... ($arg) to be of type int|float|false, string given
"x" => Argument ... must be of type int|float|false, string given "x" => Argument ... ($arg) to be of type int|float|false, string given
"" => Argument ... must be of type int|float|false, string given "" => Argument ... ($arg) to be of type int|float|false, string given
true => Argument ... must be of type int|float|false, bool given true => Argument ... ($arg) to be of type int|float|false, bool given
false => false false => false
null => Argument ... must be of type int|float|false, null given null => Argument ... ($arg) to be of type int|float|false, null given
[] => Argument ... must be of type int|float|false, array given [] => Argument ... ($arg) to be of type int|float|false, array given
new stdClass => Argument ... must be of type int|float|false, object given new stdClass => Argument ... ($arg) to be of type int|float|false, object given
new WithToString => Argument ... must be of type int|float|false, object given new WithToString => Argument ... ($arg) to be of type int|float|false, object given
Type int|float|bool: Type int|float|bool:
42 => 42 42 => 42
42.0 => 42.0 42.0 => 42.0
INF => INF INF => INF
"42" => Argument ... must be of type int|float|bool, string given "42" => Argument ... ($arg) to be of type int|float|bool, string given
"42.0" => Argument ... must be of type int|float|bool, string given "42.0" => Argument ... ($arg) to be of type int|float|bool, string given
"42x" => Argument ... must be of type int|float|bool, string given "42x" => Argument ... ($arg) to be of type int|float|bool, string given
"x" => Argument ... must be of type int|float|bool, string given "x" => Argument ... ($arg) to be of type int|float|bool, string given
"" => Argument ... must be of type int|float|bool, string given "" => Argument ... ($arg) to be of type int|float|bool, string given
true => true true => true
false => false false => false
null => Argument ... must be of type int|float|bool, null given null => Argument ... ($arg) to be of type int|float|bool, null given
[] => Argument ... must be of type int|float|bool, array given [] => Argument ... ($arg) to be of type int|float|bool, array given
new stdClass => Argument ... must be of type int|float|bool, object given new stdClass => Argument ... ($arg) to be of type int|float|bool, object given
new WithToString => Argument ... must be of type int|float|bool, object given new WithToString => Argument ... ($arg) to be of type int|float|bool, object given
Type int|bool: Type int|bool:
42 => 42 42 => 42
42.0 => Argument ... must be of type int|bool, float given 42.0 => Argument ... ($arg) to be of type int|bool, float given
INF => Argument ... must be of type int|bool, float given INF => Argument ... ($arg) to be of type int|bool, float given
"42" => Argument ... must be of type int|bool, string given "42" => Argument ... ($arg) to be of type int|bool, string given
"42.0" => Argument ... must be of type int|bool, string given "42.0" => Argument ... ($arg) to be of type int|bool, string given
"42x" => Argument ... must be of type int|bool, string given "42x" => Argument ... ($arg) to be of type int|bool, string given
"x" => Argument ... must be of type int|bool, string given "x" => Argument ... ($arg) to be of type int|bool, string given
"" => Argument ... must be of type int|bool, string given "" => Argument ... ($arg) to be of type int|bool, string given
true => true true => true
false => false false => false
null => Argument ... must be of type int|bool, null given null => Argument ... ($arg) to be of type int|bool, null given
[] => Argument ... must be of type int|bool, array given [] => Argument ... ($arg) to be of type int|bool, array given
new stdClass => Argument ... must be of type int|bool, object given new stdClass => Argument ... ($arg) to be of type int|bool, object given
new WithToString => Argument ... must be of type int|bool, object given new WithToString => Argument ... ($arg) to be of type int|bool, object given
Type int|string|null: Type int|string|null:
42 => 42 42 => 42
42.0 => Argument ... must be of type string|int|null, float given 42.0 => Argument ... ($arg) to be of type string|int|null, float given
INF => Argument ... must be of type string|int|null, float given INF => Argument ... ($arg) to be of type string|int|null, float given
"42" => "42" "42" => "42"
"42.0" => "42.0" "42.0" => "42.0"
"42x" => "42x" "42x" => "42x"
"x" => "x" "x" => "x"
"" => "" "" => ""
true => Argument ... must be of type string|int|null, bool given true => Argument ... ($arg) to be of type string|int|null, bool given
false => Argument ... must be of type string|int|null, bool given false => Argument ... ($arg) to be of type string|int|null, bool given
null => null null => null
[] => Argument ... must be of type string|int|null, array given [] => Argument ... ($arg) to be of type string|int|null, array given
new stdClass => Argument ... must be of type string|int|null, object given new stdClass => Argument ... ($arg) to be of type string|int|null, object given
new WithToString => Argument ... must be of type string|int|null, object given new WithToString => Argument ... ($arg) to be of type string|int|null, object given
Type string|bool: Type string|bool:
42 => Argument ... must be of type string|bool, int given 42 => Argument ... ($arg) to be of type string|bool, int given
42.0 => Argument ... must be of type string|bool, float given 42.0 => Argument ... ($arg) to be of type string|bool, float given
INF => Argument ... must be of type string|bool, float given INF => Argument ... ($arg) to be of type string|bool, float given
"42" => "42" "42" => "42"
"42.0" => "42.0" "42.0" => "42.0"
"42x" => "42x" "42x" => "42x"
@ -157,55 +157,55 @@ INF => Argument ... must be of type string|bool, float given
"" => "" "" => ""
true => true true => true
false => false false => false
null => Argument ... must be of type string|bool, null given null => Argument ... ($arg) to be of type string|bool, null given
[] => Argument ... must be of type string|bool, array given [] => Argument ... ($arg) to be of type string|bool, array given
new stdClass => Argument ... must be of type string|bool, object given new stdClass => Argument ... ($arg) to be of type string|bool, object given
new WithToString => Argument ... must be of type string|bool, object given new WithToString => Argument ... ($arg) to be of type string|bool, object given
Type float|array: Type float|array:
42 => 42.0 42 => 42.0
42.0 => 42.0 42.0 => 42.0
INF => INF INF => INF
"42" => Argument ... must be of type array|float, string given "42" => Argument ... ($arg) to be of type array|float, string given
"42.0" => Argument ... must be of type array|float, string given "42.0" => Argument ... ($arg) to be of type array|float, string given
"42x" => Argument ... must be of type array|float, string given "42x" => Argument ... ($arg) to be of type array|float, string given
"x" => Argument ... must be of type array|float, string given "x" => Argument ... ($arg) to be of type array|float, string given
"" => Argument ... must be of type array|float, string given "" => Argument ... ($arg) to be of type array|float, string given
true => Argument ... must be of type array|float, bool given true => Argument ... ($arg) to be of type array|float, bool given
false => Argument ... must be of type array|float, bool given false => Argument ... ($arg) to be of type array|float, bool given
null => Argument ... must be of type array|float, null given null => Argument ... ($arg) to be of type array|float, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|float, object given new stdClass => Argument ... ($arg) to be of type array|float, object given
new WithToString => Argument ... must be of type array|float, object given new WithToString => Argument ... ($arg) to be of type array|float, object given
Type string|array: Type string|array:
42 => Argument ... must be of type array|string, int given 42 => Argument ... ($arg) to be of type array|string, int given
42.0 => Argument ... must be of type array|string, float given 42.0 => Argument ... ($arg) to be of type array|string, float given
INF => Argument ... must be of type array|string, float given INF => Argument ... ($arg) to be of type array|string, float given
"42" => "42" "42" => "42"
"42.0" => "42.0" "42.0" => "42.0"
"42x" => "42x" "42x" => "42x"
"x" => "x" "x" => "x"
"" => "" "" => ""
true => Argument ... must be of type array|string, bool given true => Argument ... ($arg) to be of type array|string, bool given
false => Argument ... must be of type array|string, bool given false => Argument ... ($arg) to be of type array|string, bool given
null => Argument ... must be of type array|string, null given null => Argument ... ($arg) to be of type array|string, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|string, object given new stdClass => Argument ... ($arg) to be of type array|string, object given
new WithToString => Argument ... must be of type array|string, object given new WithToString => Argument ... ($arg) to be of type array|string, object given
Type bool|array: Type bool|array:
42 => Argument ... must be of type array|bool, int given 42 => Argument ... ($arg) to be of type array|bool, int given
42.0 => Argument ... must be of type array|bool, float given 42.0 => Argument ... ($arg) to be of type array|bool, float given
INF => Argument ... must be of type array|bool, float given INF => Argument ... ($arg) to be of type array|bool, float given
"42" => Argument ... must be of type array|bool, string given "42" => Argument ... ($arg) to be of type array|bool, string given
"42.0" => Argument ... must be of type array|bool, string given "42.0" => Argument ... ($arg) to be of type array|bool, string given
"42x" => Argument ... must be of type array|bool, string given "42x" => Argument ... ($arg) to be of type array|bool, string given
"x" => Argument ... must be of type array|bool, string given "x" => Argument ... ($arg) to be of type array|bool, string given
"" => Argument ... must be of type array|bool, string given "" => Argument ... ($arg) to be of type array|bool, string given
true => true true => true
false => false false => false
null => Argument ... must be of type array|bool, null given null => Argument ... ($arg) to be of type array|bool, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|bool, object given new stdClass => Argument ... ($arg) to be of type array|bool, object given
new WithToString => Argument ... must be of type array|bool, object given new WithToString => Argument ... ($arg) to be of type array|bool, object given

View file

@ -35,7 +35,7 @@ function test(string $type, array $values) {
} catch (TypeError $e) { } catch (TypeError $e) {
$msg = $e->getMessage(); $msg = $e->getMessage();
$msg = strstr($msg, ', called in', true); $msg = strstr($msg, ', called in', true);
$msg = str_replace('1 passed to {closure}()', '...', $msg); $msg = str_replace('{closure}() expects argument #1', 'Argument ...', $msg);
echo $msg; echo $msg;
} }
echo "\n"; echo "\n";
@ -71,14 +71,14 @@ INF => INF
"42" => 42 "42" => 42
"42.0" => 42.0 "42.0" => 42.0
"42x" => 42 (A non well formed numeric value encountered) "42x" => 42 (A non well formed numeric value encountered)
"x" => Argument ... must be of type int|float, string given "x" => Argument ... ($arg) to be of type int|float, string given
"" => Argument ... must be of type int|float, string given "" => Argument ... ($arg) to be of type int|float, string given
true => 1 true => 1
false => 0 false => 0
null => Argument ... must be of type int|float, null given null => Argument ... ($arg) to be of type int|float, null given
[] => Argument ... must be of type int|float, array given [] => Argument ... ($arg) to be of type int|float, array given
new stdClass => Argument ... must be of type int|float, object given new stdClass => Argument ... ($arg) to be of type int|float, object given
new WithToString => Argument ... must be of type int|float, object given new WithToString => Argument ... ($arg) to be of type int|float, object given
Type int|float|false: Type int|float|false:
42 => 42 42 => 42
@ -87,14 +87,14 @@ INF => INF
"42" => 42 "42" => 42
"42.0" => 42.0 "42.0" => 42.0
"42x" => 42 (A non well formed numeric value encountered) "42x" => 42 (A non well formed numeric value encountered)
"x" => Argument ... must be of type int|float|false, string given "x" => Argument ... ($arg) to be of type int|float|false, string given
"" => Argument ... must be of type int|float|false, string given "" => Argument ... ($arg) to be of type int|float|false, string given
true => 1 true => 1
false => false false => false
null => Argument ... must be of type int|float|false, null given null => Argument ... ($arg) to be of type int|float|false, null given
[] => Argument ... must be of type int|float|false, array given [] => Argument ... ($arg) to be of type int|float|false, array given
new stdClass => Argument ... must be of type int|float|false, object given new stdClass => Argument ... ($arg) to be of type int|float|false, object given
new WithToString => Argument ... must be of type int|float|false, object given new WithToString => Argument ... ($arg) to be of type int|float|false, object given
Type int|float|bool: Type int|float|bool:
42 => 42 42 => 42
@ -107,10 +107,10 @@ INF => INF
"" => false "" => false
true => true true => true
false => false false => false
null => Argument ... must be of type int|float|bool, null given null => Argument ... ($arg) to be of type int|float|bool, null given
[] => Argument ... must be of type int|float|bool, array given [] => Argument ... ($arg) to be of type int|float|bool, array given
new stdClass => Argument ... must be of type int|float|bool, object given new stdClass => Argument ... ($arg) to be of type int|float|bool, object given
new WithToString => Argument ... must be of type int|float|bool, object given new WithToString => Argument ... ($arg) to be of type int|float|bool, object given
Type int|bool: Type int|bool:
42 => 42 42 => 42
@ -123,10 +123,10 @@ INF => true
"" => false "" => false
true => true true => true
false => false false => false
null => Argument ... must be of type int|bool, null given null => Argument ... ($arg) to be of type int|bool, null given
[] => Argument ... must be of type int|bool, array given [] => Argument ... ($arg) to be of type int|bool, array given
new stdClass => Argument ... must be of type int|bool, object given new stdClass => Argument ... ($arg) to be of type int|bool, object given
new WithToString => Argument ... must be of type int|bool, object given new WithToString => Argument ... ($arg) to be of type int|bool, object given
Type int|string|null: Type int|string|null:
42 => 42 42 => 42
@ -140,8 +140,8 @@ INF => "INF"
true => 1 true => 1
false => 0 false => 0
null => null null => null
[] => Argument ... must be of type string|int|null, array given [] => Argument ... ($arg) to be of type string|int|null, array given
new stdClass => Argument ... must be of type string|int|null, object given new stdClass => Argument ... ($arg) to be of type string|int|null, object given
new WithToString => "__toString()" new WithToString => "__toString()"
Type string|bool: Type string|bool:
@ -155,9 +155,9 @@ INF => "INF"
"" => "" "" => ""
true => true true => true
false => false false => false
null => Argument ... must be of type string|bool, null given null => Argument ... ($arg) to be of type string|bool, null given
[] => Argument ... must be of type string|bool, array given [] => Argument ... ($arg) to be of type string|bool, array given
new stdClass => Argument ... must be of type string|bool, object given new stdClass => Argument ... ($arg) to be of type string|bool, object given
new WithToString => "__toString()" new WithToString => "__toString()"
Type float|array: Type float|array:
@ -167,14 +167,14 @@ INF => INF
"42" => 42.0 "42" => 42.0
"42.0" => 42.0 "42.0" => 42.0
"42x" => 42.0 (A non well formed numeric value encountered) "42x" => 42.0 (A non well formed numeric value encountered)
"x" => Argument ... must be of type array|float, string given "x" => Argument ... ($arg) to be of type array|float, string given
"" => Argument ... must be of type array|float, string given "" => Argument ... ($arg) to be of type array|float, string given
true => 1.0 true => 1.0
false => 0.0 false => 0.0
null => Argument ... must be of type array|float, null given null => Argument ... ($arg) to be of type array|float, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|float, object given new stdClass => Argument ... ($arg) to be of type array|float, object given
new WithToString => Argument ... must be of type array|float, object given new WithToString => Argument ... ($arg) to be of type array|float, object given
Type string|array: Type string|array:
42 => "42" 42 => "42"
@ -187,9 +187,9 @@ INF => "INF"
"" => "" "" => ""
true => "1" true => "1"
false => "" false => ""
null => Argument ... must be of type array|string, null given null => Argument ... ($arg) to be of type array|string, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|string, object given new stdClass => Argument ... ($arg) to be of type array|string, object given
new WithToString => "__toString()" new WithToString => "__toString()"
Type bool|array: Type bool|array:
@ -203,7 +203,7 @@ INF => true
"" => false "" => false
true => true true => true
false => false false => false
null => Argument ... must be of type array|bool, null given null => Argument ... ($arg) to be of type array|bool, null given
[] => [] [] => []
new stdClass => Argument ... must be of type array|bool, object given new stdClass => Argument ... ($arg) to be of type array|bool, object given
new WithToString => Argument ... must be of type array|bool, object given new WithToString => Argument ... ($arg) to be of type array|bool, object given

View file

@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc';
// calls within that file should stay strict, despite being included by weak file // calls within that file should stay strict, despite being included by weak file
?> ?>
--EXPECTF-- --EXPECTF--
Fatal error: Uncaught TypeError: Argument 1 passed to takes_int() must be of the type int, float given, called in %sweak_include_strict_2.inc on line 9 and defined in %sweak_include_strict_2.inc:5 Fatal error: Uncaught TypeError: takes_int() expects argument #1 ($x) to be of type int, float given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): takes_int(1) #0 %s(%d): takes_int(1)
#1 %s(%d): require('%s') #1 %s(%d): require('%s')

View file

@ -219,99 +219,99 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass given, called in %s on line 8 and defined in %s:5 TypeError: unloadedClass() expects argument #1 ($param) to be of type ?I\Dont\Exist, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(8): unloadedClass(Object(stdClass)) #0 %s(8): unloadedClass(Object(stdClass))
#1 {main} #1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, instance of stdClass given, called in %s on line 20 and defined in %s:16 TypeError: loadedClass() expects argument #1 ($param) to be of type ?RealClass, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(20): loadedClass(Object(stdClass)) #0 %s(20): loadedClass(Object(stdClass))
#1 {main} #1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, instance of stdClass given, called in %s on line 26 and defined in %s:17 TypeError: loadedInterface() expects argument #1 ($param) to be of type ?RealInterface, stdClass given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(26): loadedInterface(Object(stdClass)) #0 %s(26): loadedInterface(Object(stdClass))
#1 {main} #1 {main}
TypeError: Argument 1 passed to unloadedClass() must be an instance of I\Dont\Exist or null, int given, called in %s on line 32 and defined in %s:5 TypeError: unloadedClass() expects argument #1 ($param) to be of type ?I\Dont\Exist, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(32): unloadedClass(1) #0 %s(32): unloadedClass(1)
#1 {main} #1 {main}
TypeError: Argument 1 passed to loadedClass() must be an instance of RealClass or null, int given, called in %s on line 38 and defined in %s:16 TypeError: loadedClass() expects argument #1 ($param) to be of type ?RealClass, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(38): loadedClass(1) #0 %s(38): loadedClass(1)
#1 {main} #1 {main}
TypeError: Argument 1 passed to loadedInterface() must implement interface RealInterface or be null, int given, called in %s on line 44 and defined in %s:17 TypeError: loadedInterface() expects argument #1 ($param) to be of type ?RealInterface, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(44): loadedInterface(1) #0 %s(44): loadedInterface(1)
#1 {main} #1 {main}
TypeError: Argument 1 passed to callableF() must be callable or null, int given, called in %s on line 52 and defined in %s:49 TypeError: callableF() expects argument #1 ($param) to be of type ?callable, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(52): callableF(1) #0 %s(52): callableF(1)
#1 {main} #1 {main}
TypeError: Argument 1 passed to iterableF() must be iterable or null, int given, called in %s on line 60 and defined in %s:57 TypeError: iterableF() expects argument #1 ($param) to be of type ?iterable, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(60): iterableF(1) #0 %s(60): iterableF(1)
#1 {main} #1 {main}
TypeError: Argument 1 passed to intF() must be of the type int or null, object given, called in %s on line 68 and defined in %s:65 TypeError: intF() expects argument #1 ($param) to be of type ?int, object given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(68): intF(Object(stdClass)) #0 %s(68): intF(Object(stdClass))
#1 {main} #1 {main}
TypeError: Return value of returnUnloadedClass() must be an instance of I\Dont\Exist or null, instance of stdClass returned in %s:74 TypeError: Return value of returnUnloadedClass() must be of type ?I\Dont\Exist, stdClass returned in %s:74
Stack trace: Stack trace:
#0 %s(78): returnUnloadedClass() #0 %s(78): returnUnloadedClass()
#1 {main} #1 {main}
TypeError: Return value of returnLoadedClass() must be an instance of RealClass or null, instance of stdClass returned in %s:84 TypeError: Return value of returnLoadedClass() must be of type ?RealClass, stdClass returned in %s:84
Stack trace: Stack trace:
#0 %s(88): returnLoadedClass() #0 %s(88): returnLoadedClass()
#1 {main} #1 {main}
TypeError: Return value of returnLoadedInterface() must implement interface RealInterface or be null, instance of stdClass returned in %s:94 TypeError: Return value of returnLoadedInterface() must be of type ?RealInterface, stdClass returned in %s:94
Stack trace: Stack trace:
#0 %s(98): returnLoadedInterface() #0 %s(98): returnLoadedInterface()
#1 {main} #1 {main}
TypeError: Return value of returnUnloadedClassScalar() must be an instance of I\Dont\Exist or null, int returned in %s:104 TypeError: Return value of returnUnloadedClassScalar() must be of type ?I\Dont\Exist, int returned in %s:104
Stack trace: Stack trace:
#0 %s(108): returnUnloadedClassScalar() #0 %s(108): returnUnloadedClassScalar()
#1 {main} #1 {main}
TypeError: Return value of returnLoadedClassScalar() must be an instance of RealClass or null, int returned in %s:114 TypeError: Return value of returnLoadedClassScalar() must be of type ?RealClass, int returned in %s:114
Stack trace: Stack trace:
#0 %s(118): returnLoadedClassScalar() #0 %s(118): returnLoadedClassScalar()
#1 {main} #1 {main}
TypeError: Return value of returnLoadedInterfaceScalar() must implement interface RealInterface or be null, int returned in %s:124 TypeError: Return value of returnLoadedInterfaceScalar() must be of type ?RealInterface, int returned in %s:124
Stack trace: Stack trace:
#0 %s(128): returnLoadedInterfaceScalar() #0 %s(128): returnLoadedInterfaceScalar()
#1 {main} #1 {main}
TypeError: Return value of returnCallable() must be callable or null, int returned in %s:134 TypeError: Return value of returnCallable() must be of type ?callable, int returned in %s:134
Stack trace: Stack trace:
#0 %s(138): returnCallable() #0 %s(138): returnCallable()
#1 {main} #1 {main}
TypeError: Return value of returnIterable() must be iterable or null, int returned in %s:144 TypeError: Return value of returnIterable() must be of type ?iterable, int returned in %s:144
Stack trace: Stack trace:
#0 %s(148): returnIterable() #0 %s(148): returnIterable()
#1 {main} #1 {main}
TypeError: Return value of returnInt() must be of the type int or null, object returned in %s:154 TypeError: Return value of returnInt() must be of type ?int, object returned in %s:154
Stack trace: Stack trace:
#0 %s(158): returnInt() #0 %s(158): returnInt()
#1 {main} #1 {main}
TypeError: Return value of returnMissingUnloadedClass() must be an instance of I\Dont\Exist or null, none returned in %s:164 TypeError: Return value of returnMissingUnloadedClass() must be of type ?I\Dont\Exist, none returned in %s:164
Stack trace: Stack trace:
#0 %s(167): returnMissingUnloadedClass() #0 %s(167): returnMissingUnloadedClass()
#1 {main} #1 {main}
TypeError: Return value of returnMissingLoadedClass() must be an instance of RealClass or null, none returned in %s:173 TypeError: Return value of returnMissingLoadedClass() must be of type ?RealClass, none returned in %s:173
Stack trace: Stack trace:
#0 %s(176): returnMissingLoadedClass() #0 %s(176): returnMissingLoadedClass()
#1 {main} #1 {main}
TypeError: Return value of returnMissingLoadedInterface() must implement interface RealInterface or be null, none returned in %s:182 TypeError: Return value of returnMissingLoadedInterface() must be of type ?RealInterface, none returned in %s:182
Stack trace: Stack trace:
#0 %s(185): returnMissingLoadedInterface() #0 %s(185): returnMissingLoadedInterface()
#1 {main} #1 {main}
TypeError: Return value of returnMissingCallable() must be callable or null, none returned in %s:191 TypeError: Return value of returnMissingCallable() must be of type ?callable, none returned in %s:191
Stack trace: Stack trace:
#0 %s(194): returnMissingCallable() #0 %s(194): returnMissingCallable()
#1 {main} #1 {main}
TypeError: Return value of returnMissingIterable() must be iterable or null, none returned in %s:200 TypeError: Return value of returnMissingIterable() must be of type ?iterable, none returned in %s:200
Stack trace: Stack trace:
#0 %s(203): returnMissingIterable() #0 %s(203): returnMissingIterable()
#1 {main} #1 {main}
TypeError: Return value of returnMissingInt() must be of the type int or null, none returned in %s:209 TypeError: Return value of returnMissingInt() must be of type ?int, none returned in %s:209
Stack trace: Stack trace:
#0 %s(212): returnMissingInt() #0 %s(212): returnMissingInt()
#1 {main} #1 {main}

View file

@ -33,7 +33,7 @@ array(3) {
} }
} }
Fatal error: Uncaught TypeError: Argument 3 passed to test() must be of the type array, int given, called in %s:%d Fatal error: Uncaught TypeError: test() expects argument #3 ($args) to be of type array, int given, called in %s on line %d and defined in %s:%d
Stack trace: Stack trace:
#0 %s(%d): test(Array, Array, 2) #0 %s(%d): test(Array, Array, 2)
#1 {main} #1 {main}

View file

@ -15,4 +15,4 @@ try {
?> ?>
--EXPECTF-- --EXPECTF--
string(%d) "Argument 3 passed to test() must be of the type array, int given, called in %s on line %d" string(%d) "test() expects argument #3 ($args) to be of type array, int given, called in %s on line %d"

View file

@ -207,8 +207,6 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg) /* {{{ */
{ {
const char *space;
const char *class_name;
static const char * const expected_error[] = { static const char * const expected_error[] = {
Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR) Z_EXPECTED_TYPES(Z_EXPECTED_TYPE_STR)
NULL NULL
@ -217,41 +215,58 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z
if (EG(exception)) { if (EG(exception)) {
return; return;
} }
class_name = get_active_class_name(&space);
zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", zend_argument_type_error(num, "to be %s, %s given", expected_error[expected_type], zend_zval_type_name(arg));
class_name, space, get_active_function_name(), num, expected_error[expected_type], zend_zval_type_name(arg));
} }
/* }}} */ /* }}} */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, const char *name, zval *arg) /* {{{ */ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, const char *name, zval *arg) /* {{{ */
{ {
const char *space;
const char *class_name;
if (EG(exception)) { if (EG(exception)) {
return; return;
} }
class_name = get_active_class_name(&space);
zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", zend_argument_type_error(num, "to be of type %s, %s given", name, zend_zval_type_name(arg));
class_name, space, get_active_function_name(), num, name, zend_zval_type_name(arg));
} }
/* }}} */ /* }}} */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error) /* {{{ */ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error) /* {{{ */
{ {
const char *space;
const char *class_name;
if (EG(exception)) { if (EG(exception)) {
return; return;
} }
class_name = get_active_class_name(&space);
zend_type_error("%s%s%s() expects parameter %d to be a valid callback, %s", zend_argument_type_error(num, "to be a valid callback, %s", error);
class_name, space, get_active_function_name(), num, error);
efree(error); efree(error);
} }
/* }}} */ /* }}} */
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...) /* {{{ */
{
const char *space;
const char *class_name;
const char *arg_name;
char *message = NULL;
if (EG(exception)) {
return;
}
class_name = get_active_class_name(&space);
arg_name = get_active_function_arg_name(arg_num);
va_list va;
va_start(va, format);
zend_vspprintf(&message, 0, format, va);
va_end(va);
zend_throw_error(error_ce, "%s%s%s() expects argument #%d%s%s%s %s",
class_name, space, get_active_function_name(), arg_num,
arg_name ? " ($" : "", arg_name ? arg_name : "", arg_name ? ")" : "", message
);
efree(message);
}
/* }}} */
ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, int num, int check_null) /* {{{ */ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pce, int num, int check_null) /* {{{ */
{ {
zend_class_entry *ce_base = *pce; zend_class_entry *ce_base = *pce;
@ -268,23 +283,13 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc
*pce = zend_lookup_class(Z_STR_P(arg)); *pce = zend_lookup_class(Z_STR_P(arg));
if (ce_base) { if (ce_base) {
if ((!*pce || !instanceof_function(*pce, ce_base))) { if ((!*pce || !instanceof_function(*pce, ce_base))) {
const char *space; zend_argument_type_error(num, "to be a class name derived from %s, '%s' given", ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg));
const char *class_name = get_active_class_name(&space);
zend_type_error("%s%s%s() expects parameter %d to be a class name derived from %s, '%s' given",
class_name, space, get_active_function_name(), num,
ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg));
*pce = NULL; *pce = NULL;
return 0; return 0;
} }
} }
if (!*pce) { if (!*pce) {
const char *space; zend_argument_type_error(num, "to be a valid class name, '%s' given", Z_STRVAL_P(arg));
const char *class_name = get_active_class_name(&space);
zend_type_error("%s%s%s() expects parameter %d to be a valid class name, '%s' given",
class_name, space, get_active_function_name(), num,
Z_STRVAL_P(arg));
return 0; return 0;
} }
return 1; return 1;
@ -547,7 +552,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
char **p = va_arg(*va, char **); char **p = va_arg(*va, char **);
size_t *pl = va_arg(*va, size_t *); size_t *pl = va_arg(*va, size_t *);
if (!zend_parse_arg_path(arg, p, pl, check_null)) { if (!zend_parse_arg_path(arg, p, pl, check_null)) {
return "a valid path"; zend_spprintf(error, 0, "a valid path, %s given", zend_zval_type_name(arg));
return "";
} }
} }
break; break;
@ -556,7 +562,8 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
{ {
zend_string **str = va_arg(*va, zend_string **); zend_string **str = va_arg(*va, zend_string **);
if (!zend_parse_arg_path_str(arg, str, check_null)) { if (!zend_parse_arg_path_str(arg, str, check_null)) {
return "a valid path"; zend_spprintf(error, 0, "a valid path, %s given", zend_zval_type_name(arg));
return "";
} }
} }
break; break;
@ -653,7 +660,7 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
} }
if (!try_convert_to_string(arg)) { if (!try_convert_to_string(arg)) {
*pce = NULL; *pce = NULL;
return "valid class name"; return "a valid class name";
} }
if ((lookup = zend_lookup_class(Z_STR_P(arg))) == NULL) { if ((lookup = zend_lookup_class(Z_STR_P(arg))) == NULL) {
@ -663,14 +670,14 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
} }
if (ce_base) { if (ce_base) {
if ((!*pce || !instanceof_function(*pce, ce_base))) { if ((!*pce || !instanceof_function(*pce, ce_base))) {
zend_spprintf(error, 0, "to be a class name derived from %s, '%s' given", zend_spprintf(error, 0, "a class name derived from %s, '%s' given",
ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg)); ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg));
*pce = NULL; *pce = NULL;
return ""; return "";
} }
} }
if (!*pce) { if (!*pce) {
zend_spprintf(error, 0, "to be a valid class name, '%s' given", zend_spprintf(error, 0, "a valid class name, '%s' given",
Z_STRVAL_P(arg)); Z_STRVAL_P(arg));
return ""; return "";
} }
@ -697,11 +704,11 @@ static const char *zend_parse_arg_impl(int arg_num, zval *arg, va_list *va, cons
} }
if (is_callable_error) { if (is_callable_error) {
zend_spprintf(error, 0, "to be a valid callback, %s", is_callable_error); zend_spprintf(error, 0, "a valid callback, %s", is_callable_error);
efree(is_callable_error); efree(is_callable_error);
return ""; return "";
} else { } else {
return "valid callback"; return "a valid callback";
} }
} }
@ -737,19 +744,16 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec
return FAILURE; return FAILURE;
} }
if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) { if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) {
const char *space;
const char *class_name = get_active_class_name(&space);
if (error) { if (error) {
zend_type_error("%s%s%s() expects parameter %d %s", zend_argument_type_error(arg_num, "to be %s", error);
class_name, space, get_active_function_name(), arg_num, error);
efree(error); efree(error);
} else { } else {
zend_type_error("%s%s%s() expects parameter %d to be %s, %s given", zend_argument_type_error(arg_num, "to be of type %s, %s given", expected_type, zend_zval_type_name(arg));
class_name, space, get_active_function_name(), arg_num, expected_type,
zend_zval_type_name(arg));
} }
} else if (error) {
efree(error);
} }
return FAILURE; return FAILURE;
} }

View file

@ -1124,17 +1124,19 @@ static zend_always_inline zval *zend_try_array_init(zval *zv)
#define FAST_ZPP 1 #define FAST_ZPP 1
#define Z_EXPECTED_TYPES(_) \ #define Z_EXPECTED_TYPES(_) \
_(Z_EXPECTED_LONG, "int") \ _(Z_EXPECTED_LONG, "of type int") \
_(Z_EXPECTED_BOOL, "bool") \ _(Z_EXPECTED_BOOL, "of type bool") \
_(Z_EXPECTED_STRING, "string") \ _(Z_EXPECTED_STRING, "of type string") \
_(Z_EXPECTED_ARRAY, "array") \ _(Z_EXPECTED_ARRAY, "of type array") \
_(Z_EXPECTED_FUNC, "valid callback") \ _(Z_EXPECTED_FUNC, "a valid callback") \
_(Z_EXPECTED_RESOURCE, "resource") \ _(Z_EXPECTED_RESOURCE, "of type resource") \
_(Z_EXPECTED_PATH, "a valid path") \ _(Z_EXPECTED_PATH, "a valid path") \
_(Z_EXPECTED_OBJECT, "object") \ _(Z_EXPECTED_OBJECT, "of type object") \
_(Z_EXPECTED_DOUBLE, "float") \ _(Z_EXPECTED_DOUBLE, "of type float") \
_(Z_EXPECTED_NUMBER, "int or float") \ _(Z_EXPECTED_NUMBER, "of type int|float") \
_(Z_EXPECTED_STRING_OR_ARRAY, "string or array") \ _(Z_EXPECTED_STRING_OR_ARRAY, "of type string|array") \
#define Z_EXPECTED_TYPE
#define Z_EXPECTED_TYPE_ENUM(id, str) id, #define Z_EXPECTED_TYPE_ENUM(id, str) id,
#define Z_EXPECTED_TYPE_STR(id, str) str, #define Z_EXPECTED_TYPE_STR(id, str) str,
@ -1149,6 +1151,11 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameters_count_error(int min_
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, zend_expected_type expected_type, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, const char *name, zval *arg); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, const char *name, zval *arg);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error); ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *error);
ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error(zend_class_entry *error_ce, uint32_t arg_num, const char *format, ...);
#define zend_argument_type_error(arg_num, ...) \
zend_argument_error(zend_ce_type_error, arg_num, __VA_ARGS__)
#define zend_argument_value_error(arg_num, ...) \
zend_argument_error(zend_ce_value_error, arg_num, __VA_ARGS__)
#define ZPP_ERROR_OK 0 #define ZPP_ERROR_OK 0
#define ZPP_ERROR_FAILURE 1 #define ZPP_ERROR_FAILURE 1

View file

@ -1388,8 +1388,7 @@ ZEND_FUNCTION(set_error_handler)
if (Z_TYPE_P(error_handler) != IS_NULL) { /* NULL == unset */ if (Z_TYPE_P(error_handler) != IS_NULL) { /* NULL == unset */
if (!zend_is_callable(error_handler, 0, NULL)) { if (!zend_is_callable(error_handler, 0, NULL)) {
zend_string *error_handler_name = zend_get_callable_name(error_handler); zend_string *error_handler_name = zend_get_callable_name(error_handler);
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback", zend_error(E_WARNING, "%s() expects argument #1 ($error_handler) to be a valid callback", get_active_function_name());
get_active_function_name(), error_handler_name?ZSTR_VAL(error_handler_name):"unknown");
zend_string_release_ex(error_handler_name, 0); zend_string_release_ex(error_handler_name, 0);
return; return;
} }
@ -1453,8 +1452,7 @@ ZEND_FUNCTION(set_exception_handler)
if (Z_TYPE_P(exception_handler) != IS_NULL) { /* NULL == unset */ if (Z_TYPE_P(exception_handler) != IS_NULL) { /* NULL == unset */
if (!zend_is_callable(exception_handler, 0, NULL)) { if (!zend_is_callable(exception_handler, 0, NULL)) {
zend_string *exception_handler_name = zend_get_callable_name(exception_handler); zend_string *exception_handler_name = zend_get_callable_name(exception_handler);
zend_error(E_WARNING, "%s() expects the argument (%s) to be a valid callback", zend_error(E_WARNING, "%s() expects argument #1 ($exception_handler) to be a valid callback", get_active_function_name());
get_active_function_name(), exception_handler_name?ZSTR_VAL(exception_handler_name):"unknown");
zend_string_release_ex(exception_handler_name, 0); zend_string_release_ex(exception_handler_name, 0);
return; return;
} }

View file

@ -640,30 +640,12 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_throw_non_object_erro
} }
} }
/* Test used to preserve old error messages for non-union types.
* We might want to canonicalize all type errors instead. */
static zend_bool is_union_type(zend_type type) {
if (ZEND_TYPE_HAS_LIST(type)) {
return 1;
}
uint32_t type_mask_without_null = ZEND_TYPE_PURE_MASK_WITHOUT_NULL(type);
if (ZEND_TYPE_HAS_CLASS(type)) {
return type_mask_without_null != 0;
}
if (type_mask_without_null == MAY_BE_BOOL) {
return 0;
}
/* Check that only one bit is set. */
return (type_mask_without_null & (type_mask_without_null - 1)) != 0;
}
static ZEND_COLD void zend_verify_type_error_common( static ZEND_COLD void zend_verify_type_error_common(
const zend_function *zf, const zend_arg_info *arg_info, const zend_function *zf, const zend_arg_info *arg_info,
void **cache_slot, zval *value, void **cache_slot, zval *value,
const char **fname, const char **fsep, const char **fclass, const char **fname, const char **fsep, const char **fclass,
zend_string **need_msg, const char **given_msg, const char **given_kind) zend_string **need_msg, const char **given_kind)
{ {
smart_str str = {0};
*fname = ZSTR_VAL(zf->common.function_name); *fname = ZSTR_VAL(zf->common.function_name);
if (zf->common.scope) { if (zf->common.scope) {
*fsep = "::"; *fsep = "::";
@ -673,90 +655,18 @@ static ZEND_COLD void zend_verify_type_error_common(
*fclass = ""; *fclass = "";
} }
if (is_union_type(arg_info->type)) { *need_msg = zend_type_to_string_resolved(arg_info->type, zf->common.scope);
zend_string *type_str = zend_type_to_string_resolved(arg_info->type, zf->common.scope);
smart_str_appends(&str, "be of type ");
smart_str_append(&str, type_str);
zend_string_release(type_str);
} else if (ZEND_TYPE_HAS_CLASS(arg_info->type)) {
zend_bool is_interface = 0;
zend_class_entry *ce = *cache_slot;
if (!ce) {
ce = zend_fetch_class(ZEND_TYPE_NAME(arg_info->type),
(ZEND_FETCH_CLASS_AUTO | ZEND_FETCH_CLASS_NO_AUTOLOAD));
}
if (ce) {
if (ce->ce_flags & ZEND_ACC_INTERFACE) {
smart_str_appends(&str, "implement interface ");
is_interface = 1;
} else {
smart_str_appends(&str, "be an instance of ");
}
smart_str_append(&str, ce->name);
} else {
/* We don't know whether it's a class or interface, assume it's a class */
smart_str_appends(&str, "be an instance of ");
smart_str_append(&str, ZEND_TYPE_NAME(arg_info->type));
}
if (ZEND_TYPE_ALLOW_NULL(arg_info->type)) {
smart_str_appends(&str, is_interface ? " or be null" : " or null");
}
} else {
uint32_t type_mask = ZEND_TYPE_PURE_MASK_WITHOUT_NULL(arg_info->type);
switch (type_mask) {
case MAY_BE_OBJECT:
smart_str_appends(&str, "be an object");
break;
case MAY_BE_CALLABLE:
smart_str_appends(&str, "be callable");
break;
case MAY_BE_ITERABLE:
smart_str_appends(&str, "be iterable");
break;
case MAY_BE_STATIC: {
zend_class_entry *called_scope = zend_get_called_scope(EG(current_execute_data));
smart_str_appends(&str, "be an instance of ");
if (called_scope) {
smart_str_append(&str, called_scope->name);
} else {
smart_str_appends(&str, "static");
}
break;
}
default:
{
/* Hack to print the type without null */
zend_type type = arg_info->type;
ZEND_TYPE_FULL_MASK(type) &= ~MAY_BE_NULL;
zend_string *type_str = zend_type_to_string(type);
smart_str_appends(&str, "be of the type ");
smart_str_append(&str, type_str);
zend_string_release(type_str);
break;
}
}
if (ZEND_TYPE_ALLOW_NULL(arg_info->type)) {
smart_str_appends(&str, " or null");
}
}
*need_msg = smart_str_extract(&str);
if (value) { if (value) {
zend_bool has_class = ZEND_TYPE_HAS_CLASS(arg_info->type) zend_bool has_class = ZEND_TYPE_HAS_CLASS(arg_info->type)
|| (ZEND_TYPE_FULL_MASK(arg_info->type) & MAY_BE_STATIC); || (ZEND_TYPE_FULL_MASK(arg_info->type) & MAY_BE_STATIC);
if (has_class && Z_TYPE_P(value) == IS_OBJECT) { if (has_class && Z_TYPE_P(value) == IS_OBJECT) {
*given_msg = "instance of ";
*given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name); *given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name);
} else { } else {
*given_msg = zend_zval_type_name(value); *given_kind = zend_zval_type_name(value);
*given_kind = "";
} }
} else { } else {
*given_msg = "none"; *given_kind = "none";
*given_kind = "";
} }
} }
@ -767,7 +677,7 @@ ZEND_API ZEND_COLD void zend_verify_arg_error(
zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data; zend_execute_data *ptr = EG(current_execute_data)->prev_execute_data;
const char *fname, *fsep, *fclass; const char *fname, *fsep, *fclass;
zend_string *need_msg; zend_string *need_msg;
const char *given_msg, *given_kind; const char *given_msg;
if (EG(exception)) { if (EG(exception)) {
/* The type verification itself might have already thrown an exception /* The type verification itself might have already thrown an exception
@ -778,18 +688,20 @@ ZEND_API ZEND_COLD void zend_verify_arg_error(
if (value) { if (value) {
zend_verify_type_error_common( zend_verify_type_error_common(
zf, arg_info, cache_slot, value, zf, arg_info, cache_slot, value,
&fname, &fsep, &fclass, &need_msg, &given_msg, &given_kind); &fname, &fsep, &fclass, &need_msg, &given_msg);
if (zf->common.type == ZEND_USER_FUNCTION) { if (zf->common.type == ZEND_USER_FUNCTION) {
if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) { if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) {
zend_type_error("Argument %d passed to %s%s%s() must %s, %s%s given, called in %s on line %d", zend_type_error("%s%s%s() expects argument #%d ($%s) to be of type %s, %s given, called in %s on line %d",
arg_num, fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg, given_kind, fclass, fsep, fname, arg_num, ZSTR_VAL(arg_info->name), ZSTR_VAL(need_msg), given_msg,
ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno); ZSTR_VAL(ptr->func->op_array.filename), ptr->opline->lineno);
} else { } else {
zend_type_error("Argument %d passed to %s%s%s() must %s, %s%s given", arg_num, fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg, given_kind); zend_type_error("%s%s%s() expects argument #%d ($%s) to be of type %s, %s given",
fclass, fsep, fname, arg_num, ZSTR_VAL(arg_info->name), ZSTR_VAL(need_msg), given_msg);
} }
} else { } else {
zend_type_error("Argument %d passed to %s%s%s() must %s, %s%s given", arg_num, fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg, given_kind); zend_type_error("%s%s%s() expects argument #%d ($%s) to be of type %s, %s given",
fclass, fsep, fname, arg_num, ((zend_internal_arg_info*) arg_info)->name, ZSTR_VAL(need_msg), given_msg);
} }
zend_string_release(need_msg); zend_string_release(need_msg);
@ -1259,14 +1171,14 @@ ZEND_API ZEND_COLD void zend_verify_return_error(
const zend_arg_info *arg_info = &zf->common.arg_info[-1]; const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass; const char *fname, *fsep, *fclass;
zend_string *need_msg; zend_string *need_msg;
const char *given_msg, *given_kind; const char *given_msg;
zend_verify_type_error_common( zend_verify_type_error_common(
zf, arg_info, cache_slot, value, zf, arg_info, cache_slot, value,
&fname, &fsep, &fclass, &need_msg, &given_msg, &given_kind); &fname, &fsep, &fclass, &need_msg, &given_msg);
zend_type_error("Return value of %s%s%s() must %s, %s%s returned", zend_type_error("Return value of %s%s%s() must be of type %s, %s returned",
fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg, given_kind); fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg);
zend_string_release(need_msg); zend_string_release(need_msg);
} }
@ -1278,14 +1190,14 @@ static ZEND_COLD void zend_verify_internal_return_error(
const zend_arg_info *arg_info = &zf->common.arg_info[-1]; const zend_arg_info *arg_info = &zf->common.arg_info[-1];
const char *fname, *fsep, *fclass; const char *fname, *fsep, *fclass;
zend_string *need_msg; zend_string *need_msg;
const char *given_msg, *given_kind; const char *given_msg;
zend_verify_type_error_common( zend_verify_type_error_common(
zf, arg_info, cache_slot, value, zf, arg_info, cache_slot, value,
&fname, &fsep, &fclass, &need_msg, &given_msg, &given_kind); &fname, &fsep, &fclass, &need_msg, &given_msg);
zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must %s, %s%s returned", zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must be of type %s, %s returned",
fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg, given_kind); fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg);
} }
static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind) static ZEND_COLD void zend_verify_void_return_error(const zend_function *zf, const char *returned_msg, const char *returned_kind)
@ -2011,11 +1923,17 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_non_static_method_cal
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num) static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(const zend_function *func, uint32_t arg_num)
{ {
zend_error(E_WARNING, "Parameter %d to %s%s%s() expected to be a reference, value given", const char *arg_name = get_function_arg_name(func, arg_num);
arg_num,
zend_error(E_WARNING, "%s%s%s() expects argument #%d%s%s%s to be passed by reference, value given",
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
func->common.scope ? "::" : "", func->common.scope ? "::" : "",
ZSTR_VAL(func->common.function_name)); ZSTR_VAL(func->common.function_name),
arg_num,
arg_name ? " ($" : "",
arg_name ? arg_name : "",
arg_name ? ")" : ""
);
} }
static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_scalar_as_array(void) static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_use_scalar_as_array(void)
@ -2632,7 +2550,7 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error(
ZVAL_UNDEFINED_OP2(); ZVAL_UNDEFINED_OP2();
} }
if (!EG(exception)) { if (!EG(exception)) {
zend_type_error("array_key_exists() expects parameter 2 to be array, %s given", zend_type_error("array_key_exists() expects argument #2 ($array) to be of type array, %s given",
zend_get_type_by_const(Z_TYPE_P(subject))); zend_get_type_by_const(Z_TYPE_P(subject)));
} }
} }

View file

@ -287,6 +287,8 @@ static zend_always_inline void zend_vm_stack_free_call_frame(zend_execute_data *
/* services */ /* services */
ZEND_API const char *get_active_class_name(const char **space); ZEND_API const char *get_active_class_name(const char **space);
ZEND_API const char *get_active_function_name(void); ZEND_API const char *get_active_function_name(void);
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num);
ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num);
ZEND_API const char *zend_get_executed_filename(void); ZEND_API const char *zend_get_executed_filename(void);
ZEND_API zend_string *zend_get_executed_filename_ex(void); ZEND_API zend_string *zend_get_executed_filename_ex(void);
ZEND_API uint32_t zend_get_executed_lineno(void); ZEND_API uint32_t zend_get_executed_lineno(void);

View file

@ -488,6 +488,37 @@ ZEND_API const char *get_active_function_name(void) /* {{{ */
} }
/* }}} */ /* }}} */
ZEND_API const char *get_active_function_arg_name(uint32_t arg_num) /* {{{ */
{
zend_function *func;
if (!zend_is_executing()) {
return NULL;
}
func = EG(current_execute_data)->func;
return get_function_arg_name(func, arg_num);
}
/* }}} */
ZEND_API const char *get_function_arg_name(const zend_function *func, uint32_t arg_num) /* {{{ */
{
if (!func || func->common.num_args < arg_num) {
return NULL;
}
switch (func->type) {
case ZEND_USER_FUNCTION:
return ZSTR_VAL(func->common.arg_info[arg_num - 1].name);
case ZEND_INTERNAL_FUNCTION:
return ((zend_internal_arg_info*) func->common.arg_info)[arg_num - 1].name;
default:
return NULL;
}
}
/* }}} */
ZEND_API const char *zend_get_executed_filename(void) /* {{{ */ ZEND_API const char *zend_get_executed_filename(void) /* {{{ */
{ {
zend_execute_data *ex = EG(current_execute_data); zend_execute_data *ex = EG(current_execute_data);
@ -717,11 +748,18 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) /
} else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) { } else if (!ARG_MAY_BE_SENT_BY_REF(func, i + 1)) {
/* By-value send is not allowed -- emit a warning, /* By-value send is not allowed -- emit a warning,
* but still perform the call with a by-value send. */ * but still perform the call with a by-value send. */
const char *arg_name = get_function_arg_name(func, i + 1);
zend_error(E_WARNING, zend_error(E_WARNING,
"Parameter %d to %s%s%s() expected to be a reference, value given", i+1, "%s%s%s() expects argument #%d%s%s%s to be passed by reference, value given",
func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? ZSTR_VAL(func->common.scope->name) : "",
func->common.scope ? "::" : "", func->common.scope ? "::" : "",
ZSTR_VAL(func->common.function_name)); ZSTR_VAL(func->common.function_name),
i+1,
arg_name ? " ($" : "",
arg_name ? arg_name : "",
arg_name ? ")" : ""
);
if (UNEXPECTED(EG(exception))) { if (UNEXPECTED(EG(exception))) {
ZEND_CALL_NUM_ARGS(call) = i; ZEND_CALL_NUM_ARGS(call) = i;
zend_vm_stack_free_args(call); zend_vm_stack_free_args(call);

View file

@ -3775,7 +3775,7 @@ ZEND_VM_HANDLER(118, ZEND_INIT_USER_CALL, CONST, CONST|TMPVAR|CV, NUM)
init_func_run_time_cache(&func->op_array); init_func_run_time_cache(&func->op_array);
} }
} else { } else {
zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error); efree(error);
FREE_OP2(); FREE_OP2();
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -4938,7 +4938,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM)
ZEND_VM_C_GOTO(send_array); ZEND_VM_C_GOTO(send_array);
} }
} }
zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); zend_type_error("call_user_func_array() expects argument #2 ($args) to be of type array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
FREE_UNFETCHED_OP2(); FREE_UNFETCHED_OP2();
FREE_OP1(); FREE_OP1();
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -7909,7 +7909,7 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY)
zval_ptr_dtor(&tmp); zval_ptr_dtor(&tmp);
} }
if (!EG(exception)) { if (!EG(exception)) {
zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
} }
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0); } while (0);
@ -8517,7 +8517,7 @@ ZEND_VM_COLD_CONST_HANDLER(191, ZEND_GET_CLASS, UNUSED|CONST|TMPVAR|CV, UNUSED)
if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { if (OP1_TYPE == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1(); ZVAL_UNDEFINED_OP1();
} }
zend_type_error("get_class() expects parameter 1 to be object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); zend_type_error("get_class() expects argument #1 ($object) to be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1)));
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} }
break; break;

View file

@ -1981,7 +1981,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O
goto send_array; goto send_array;
} }
} }
zend_type_error("call_user_func_array() expects parameter 2 to be array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); zend_type_error("call_user_func_array() expects argument #2 ($args) to be of type array, %s given", zend_get_type_by_const(Z_TYPE_P(args)));
FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var); FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var);
FREE_OP(opline->op1_type, opline->op1.var); FREE_OP(opline->op1_type, opline->op1.var);
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -4464,7 +4464,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST
zval_ptr_dtor(&tmp); zval_ptr_dtor(&tmp);
} }
if (!EG(exception)) { if (!EG(exception)) {
zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
} }
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0); } while (0);
@ -5889,7 +5889,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CONS
init_func_run_time_cache(&func->op_array); init_func_run_time_cache(&func->op_array);
} }
} else { } else {
zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error); efree(error);
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -8065,7 +8065,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_TMPV
init_func_run_time_cache(&func->op_array); init_func_run_time_cache(&func->op_array);
} }
} else { } else {
zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error); efree(error);
zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var));
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -9333,7 +9333,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CO
if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { if (IS_CONST == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1(); ZVAL_UNDEFINED_OP1();
} }
zend_type_error("get_class() expects parameter 1 to be object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); zend_type_error("get_class() expects argument #1 ($object) to be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1)));
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} }
break; break;
@ -10320,7 +10320,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_USER_CALL_SPEC_CONST_CV_H
init_func_run_time_cache(&func->op_array); init_func_run_time_cache(&func->op_array);
} }
} else { } else {
zend_type_error("%s() expects parameter 1 to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error);
efree(error); efree(error);
HANDLE_EXCEPTION(); HANDLE_EXCEPTION();
@ -13305,7 +13305,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEN
zval_ptr_dtor(&tmp); zval_ptr_dtor(&tmp);
} }
if (!EG(exception)) { if (!EG(exception)) {
zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
} }
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0); } while (0);
@ -16412,7 +16412,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_TMPVAR_UNUSED_H
if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { if ((IS_TMP_VAR|IS_VAR) == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1(); ZVAL_UNDEFINED_OP1();
} }
zend_type_error("get_class() expects parameter 1 to be object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); zend_type_error("get_class() expects argument #1 ($object) to be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1)));
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} }
break; break;
@ -33308,7 +33308,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_UNUSED_UNUSED_H
if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { if (IS_UNUSED == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1(); ZVAL_UNDEFINED_OP1();
} }
zend_type_error("get_class() expects parameter 1 to be object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); zend_type_error("get_class() expects argument 1 ($object) to be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1)));
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} }
break; break;
@ -36702,7 +36702,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OP
zval_ptr_dtor(&tmp); zval_ptr_dtor(&tmp);
} }
if (!EG(exception)) { if (!EG(exception)) {
zend_type_error("strlen() expects parameter 1 to be string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value)));
} }
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} while (0); } while (0);
@ -45260,7 +45260,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_GET_CLASS_SPEC_CV_UNUSED_HANDL
if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) { if (IS_CV == IS_CV && UNEXPECTED(Z_TYPE_P(op1) == IS_UNDEF)) {
ZVAL_UNDEFINED_OP1(); ZVAL_UNDEFINED_OP1();
} }
zend_type_error("get_class() expects parameter 1 to be object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); zend_type_error("get_class() expects argument #1 ($object) to be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1)));
ZVAL_UNDEF(EX_VAR(opline->result.var)); ZVAL_UNDEF(EX_VAR(opline->result.var));
} }
break; break;

Some files were not shown because too many files have changed in this diff Show more