diff options
author | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-02-25 20:58:33 +0100 |
---|---|---|
committer | Máté Kocsis <kocsismate@woohoolabs.com> | 2020-02-26 15:00:08 +0100 |
commit | 960318ed95d17bd30c2896e2f3189ebffb965dce (patch) | |
tree | 2890972c266dabe649a44b540869a49e41a3e450 /Zend | |
parent | c7094d892639fedffb67c273f8fd44f3ffff86d6 (diff) | |
download | php-git-960318ed95d17bd30c2896e2f3189ebffb965dce.tar.gz |
Change argument error message format
Closes GH-5211
Diffstat (limited to 'Zend')
70 files changed, 422 insertions, 415 deletions
diff --git a/Zend/tests/008.phpt b/Zend/tests/008.phpt index f597812fa8..b53578dbb3 100644 --- a/Zend/tests/008.phpt +++ b/Zend/tests/008.phpt @@ -25,7 +25,7 @@ var_dump(constant("test const")); echo "Done\n"; ?> --EXPECTF-- -TypeError: define() expects argument #1 ($constant_name) to be of type string, array given +TypeError: define(): Argument #1 ($constant_name) must be of type string, array given Notice: Constant TRUE already defined in %s on line %d bool(false) diff --git a/Zend/tests/009.phpt b/Zend/tests/009.phpt index 222fd36297..16c060389d 100644 --- a/Zend/tests/009.phpt +++ b/Zend/tests/009.phpt @@ -46,8 +46,8 @@ string(3) "foo" Warning: get_class() called without object from outside a class in %s on line %d bool(false) -get_class() expects argument #1 ($object) to be of type object, string given +get_class(): Argument #1 ($object) must be of type object, string given string(3) "foo" string(4) "foo2" -get_class() expects argument #1 ($object) to be of type object, null given +get_class(): Argument #1 ($object) must be of type object, null given Done diff --git a/Zend/tests/arrow_functions/006.phpt b/Zend/tests/arrow_functions/006.phpt index e0ca1e1b5c..6bf4c683c8 100644 --- a/Zend/tests/arrow_functions/006.phpt +++ b/Zend/tests/arrow_functions/006.phpt @@ -32,7 +32,7 @@ try { --EXPECTF-- int(2) int(10) -{closure}() expects argument #1 ($x) to be of type int, string given, called in %s on line %d +{closure}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d array(3) { [0]=> int(20) @@ -41,4 +41,4 @@ array(3) { [2]=> int(30) } -{closure}() expects argument #2 ($args) to be of type ?int, string given, called in %s on line %d +{closure}(): Argument #2 ($args) must be of type ?int, string given, called in %s on line %d diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt index ea4ba7753c..fb3992ecee 100644 --- a/Zend/tests/bug31720.phpt +++ b/Zend/tests/bug31720.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECTF-- Warning: Undefined variable: nonesuchvar in %s on line %d -array_walk() expects argument #2 ($funcname) to be a valid callback, first array member is not a valid class name or object +array_walk(): Argument #2 ($funcname) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/bug39003.phpt b/Zend/tests/bug39003.phpt index 758e3f9c83..5f7c784976 100644 --- a/Zend/tests/bug39003.phpt +++ b/Zend/tests/bug39003.phpt @@ -20,7 +20,7 @@ test($obj); echo "Done\n"; ?> --EXPECTF-- -Fatal error: Uncaught TypeError: test() expects argument #1 ($object) to be of type OtherClassName, ClassName given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: test(): Argument #1 ($object) must be of type OtherClassName, ClassName given, called in %s:%d Stack trace: #0 %s(%d): test(Object(ClassName)) #1 {main} diff --git a/Zend/tests/bug42802.phpt b/Zend/tests/bug42802.phpt index 084b7c0e9d..375d7f6b5b 100644 --- a/Zend/tests/bug42802.phpt +++ b/Zend/tests/bug42802.phpt @@ -37,7 +37,7 @@ ok ok ok -Fatal error: Uncaught TypeError: foo\test5() expects argument #1 ($bar) to be of type bar, foo\bar given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: foo\test5(): Argument #1 ($bar) must be of type bar, foo\bar given, called in %s:%d Stack trace: #0 %s(%d): foo\test5(Object(foo\bar)) #1 {main} diff --git a/Zend/tests/bug43332_1.phpt b/Zend/tests/bug43332_1.phpt index e7f52eae9c..3b999646b5 100644 --- a/Zend/tests/bug43332_1.phpt +++ b/Zend/tests/bug43332_1.phpt @@ -12,7 +12,7 @@ $foo = new foo; $foo->bar($foo); // Ok! $foo->bar(new \stdclass); // Error, ok! --EXPECTF-- -Fatal error: Uncaught TypeError: foobar\foo::bar() expects argument #1 ($a) to be of type foobar\foo, stdClass given, called in %sbug43332_1.php on line 10 and defined in %sbug43332_1.php:5 +Fatal error: Uncaught TypeError: foobar\foo::bar(): Argument #1 ($a) must be of type foobar\foo, stdClass given, called in %s:%d Stack trace: #0 %s(%d): foobar\foo->bar(Object(stdClass)) #1 {main} diff --git a/Zend/tests/bug45186.phpt b/Zend/tests/bug45186.phpt index d60cab5088..7e4d0e5a73 100644 --- a/Zend/tests/bug45186.phpt +++ b/Zend/tests/bug45186.phpt @@ -54,4 +54,4 @@ string(1) "y" ok __callstatic: string(3) "www" -call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active +call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active diff --git a/Zend/tests/bug45186_2.phpt b/Zend/tests/bug45186_2.phpt index 262b379180..01f5734a4f 100644 --- a/Zend/tests/bug45186_2.phpt +++ b/Zend/tests/bug45186_2.phpt @@ -52,5 +52,5 @@ string(1) "y" __call: string(1) "y" ok -call_user_func() expects argument #1 ($function) to be a valid callback, class 'bar' does not have a method 'www' -call_user_func() expects argument #1 ($function) to be a valid callback, cannot access self:: when no class scope is active +call_user_func(): Argument #1 ($function) must be a valid callback, class 'bar' does not have a method 'www' +call_user_func(): Argument #1 ($function) must be a valid callback, cannot access self:: when no class scope is active diff --git a/Zend/tests/bug48770_2.phpt b/Zend/tests/bug48770_2.phpt index c5c17acb83..b8f88445f8 100644 --- a/Zend/tests/bug48770_2.phpt +++ b/Zend/tests/bug48770_2.phpt @@ -58,5 +58,5 @@ $c->func('This should work!'); --EXPECT-- string(27) "A::func2: This should work!" string(27) "A::func3: This should work!" -call_user_func_array() expects argument #1 ($function) to be a valid callback, cannot access private method A::func22() -call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'A' does not have a method 'inexistent' +call_user_func_array(): Argument #1 ($function) must be a valid callback, cannot access private method A::func22() +call_user_func_array(): Argument #1 ($function) must be a valid callback, class 'A' does not have a method 'inexistent' diff --git a/Zend/tests/bug48770_3.phpt b/Zend/tests/bug48770_3.phpt index 07cc8025df..0ce0d69119 100644 --- a/Zend/tests/bug48770_3.phpt +++ b/Zend/tests/bug48770_3.phpt @@ -52,4 +52,4 @@ $c->func('This should work!'); --EXPECT-- string(27) "B::func2: This should work!" string(27) "B::func3: This should work!" -call_user_func_array() expects argument #1 ($function) to be a valid callback, class 'B' does not have a method 'inexistent' +call_user_func_array(): Argument #1 ($function) must be a valid callback, class 'B' does not have a method 'inexistent' diff --git a/Zend/tests/bug61273.phpt b/Zend/tests/bug61273.phpt index e9d67f9d2a..45461729cb 100644 --- a/Zend/tests/bug61273.phpt +++ b/Zend/tests/bug61273.phpt @@ -11,5 +11,5 @@ $args = array_fill(0, 64 * 1024 - 64, 0); call_user_func_array(function(&$a) {}, $args); echo strval("okey"); --EXPECTF-- -Warning: {closure}() expects argument #1 ($a) to be passed by reference, value given in %s on line %d +Warning: {closure}(): Argument #1 ($a) must be passed by reference, value given in %s on line %d okey diff --git a/Zend/tests/bug68446.phpt b/Zend/tests/bug68446.phpt index c9d833a37f..34cdb23149 100644 --- a/Zend/tests/bug68446.phpt +++ b/Zend/tests/bug68446.phpt @@ -32,7 +32,7 @@ array(1) { int(1) } -Fatal error: Uncaught TypeError: a() expects argument #1 ($a) to be of type array, null given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: a(): Argument #1 ($a) must be of type array, null given, called in %s:%d Stack trace: #0 %s(%d): a(NULL) #1 {main} diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895.phpt index 0d4dc47004..9aa3706362 100644 --- a/Zend/tests/bug70895.phpt +++ b/Zend/tests/bug70895.phpt @@ -20,6 +20,6 @@ try { } ?> --EXPECT-- -array_map() expects argument #1 ($callback) to be a valid callback, function '%n' not found or invalid function name -array_map() expects argument #1 ($callback) to be a valid callback, function '%n %i' not found or invalid function name -array_map() expects argument #1 ($callback) to be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name +array_map(): Argument #1 ($callback) must be a valid callback, function '%n' not found or invalid function name +array_map(): Argument #1 ($callback) must be a valid callback, function '%n %i' not found or invalid function name +array_map(): Argument #1 ($callback) must be a valid callback, function '%n %i aoeu %f aoeu %p' not found or invalid function name diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt index 2a0fabd138..ea67acaaf8 100644 --- a/Zend/tests/bug70898.phpt +++ b/Zend/tests/bug70898.phpt @@ -13,4 +13,4 @@ try { } ?> --EXPECT-- -array_map() expects argument #1 ($callback) to be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name +array_map(): Argument #1 ($callback) must be a valid callback, function '0000000000000000000000000000000000' not found or invalid function name diff --git a/Zend/tests/bug72598.phpt b/Zend/tests/bug72598.phpt index acf40cbba0..741abc35e2 100644 --- a/Zend/tests/bug72598.phpt +++ b/Zend/tests/bug72598.phpt @@ -17,10 +17,10 @@ new class { }; ?> --EXPECTF-- -Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d object(class@anonymous)#1 (0) { } -Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d object(class@anonymous)#1 (0) { } diff --git a/Zend/tests/bug72598_2.phpt b/Zend/tests/bug72598_2.phpt index 75c4894dff..9a9274aae4 100644 --- a/Zend/tests/bug72598_2.phpt +++ b/Zend/tests/bug72598_2.phpt @@ -20,8 +20,8 @@ new class { }; ?> --EXPECTF-- -Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d int(0) -Warning: ref() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: ref(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d int(0) diff --git a/Zend/tests/bug73954.phpt b/Zend/tests/bug73954.phpt index 062d438b60..bff81f5001 100644 --- a/Zend/tests/bug73954.phpt +++ b/Zend/tests/bug73954.phpt @@ -16,7 +16,7 @@ takes_int(log(tan(3.14))); float(NAN) bool(true) -Fatal error: Uncaught TypeError: takes_int() expects argument #1 ($int) to be of type int, float given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: takes_int(): Argument #1 ($int) must be of type int, float given, called in %s:%d Stack trace: #0 %s(9): takes_int(NAN) #1 {main} diff --git a/Zend/tests/bug74164.phpt b/Zend/tests/bug74164.phpt index e0dbed9a19..36d681290d 100644 --- a/Zend/tests/bug74164.phpt +++ b/Zend/tests/bug74164.phpt @@ -12,7 +12,7 @@ set_error_handler(function ($type, $msg) { call_user_func(function (array &$ref) {var_dump("xxx");}, 'not_an_array_variable'); ?> --EXPECTF-- -Fatal error: Uncaught Exception: Foo\{closure}() expects argument #1 ($ref) to be passed by reference, value given in %s:%d +Fatal error: Uncaught Exception: Foo\{closure}(): Argument #1 ($ref) must be passed by reference, value given in %s:%d Stack trace: #0 [internal function]: Foo\{closure}(%s) #1 %sbug74164.php(%d): call_user_func(%s) diff --git a/Zend/tests/call_user_func_001.phpt b/Zend/tests/call_user_func_001.phpt index 8ad7656459..34234271b3 100644 --- a/Zend/tests/call_user_func_001.phpt +++ b/Zend/tests/call_user_func_001.phpt @@ -37,5 +37,5 @@ namespace testing { ?> --EXPECT-- string(6) "foobar" -call_user_func() expects argument #1 ($function) to be a valid callback, cannot access private method testing\foo::priv() -call_user_func() expects argument #1 ($function) to be a valid callback, cannot access protected method testing\foo::prot() +call_user_func(): Argument #1 ($function) must be a valid callback, cannot access private method testing\foo::priv() +call_user_func(): Argument #1 ($function) must be a valid callback, cannot access protected method testing\foo::prot() diff --git a/Zend/tests/call_user_func_002.phpt b/Zend/tests/call_user_func_002.phpt index 3ac9308543..c06803334a 100644 --- a/Zend/tests/call_user_func_002.phpt +++ b/Zend/tests/call_user_func_002.phpt @@ -31,11 +31,11 @@ try { ?> --EXPECTF-- string(3) "foo" -call_user_func() expects argument #1 ($function) to be a valid callback, class 'foo' not found -call_user_func() expects argument #1 ($function) to be a valid callback, class '' not found +call_user_func(): Argument #1 ($function) must be a valid callback, class 'foo' not found +call_user_func(): Argument #1 ($function) must be a valid callback, class '' not found Warning: Undefined variable: foo in %s on line %d -call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object +call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object Warning: Undefined variable: foo in %s on line %d -call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object +call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/call_user_func_006.phpt b/Zend/tests/call_user_func_006.phpt index 624ce2391c..e45c81dc10 100644 --- a/Zend/tests/call_user_func_006.phpt +++ b/Zend/tests/call_user_func_006.phpt @@ -21,8 +21,8 @@ var_dump($y); ?> --EXPECTF-- -Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d int(42) -Warning: Foo\bar() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: Foo\bar(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d int(42) diff --git a/Zend/tests/call_user_func_007.phpt b/Zend/tests/call_user_func_007.phpt index 8efa3ab901..4dd7341add 100644 --- a/Zend/tests/call_user_func_007.phpt +++ b/Zend/tests/call_user_func_007.phpt @@ -15,6 +15,6 @@ Notice: Undefined offset: 0 in %s on line %d Warning: Trying to access array offset on value of type null in %s on line %d -Warning: foo() expects argument #1 ($ref) to be passed by reference, value given in %s on line %d +Warning: foo(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d array(0) { } diff --git a/Zend/tests/call_user_func_008.phpt b/Zend/tests/call_user_func_008.phpt index c710360a13..1d20bc60d6 100644 --- a/Zend/tests/call_user_func_008.phpt +++ b/Zend/tests/call_user_func_008.phpt @@ -25,30 +25,30 @@ var_dump($i, $j); ?> --EXPECTF-- -Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d -Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d bool(true) int(0) int(0) -Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d -Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d bool(true) int(0) int(0) -Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d -Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d bool(true) int(0) int(0) -Warning: test() expects argument #1 ($ref1) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #1 ($ref1) must be passed by reference, value given in %s on line %d -Warning: test() expects argument #2 ($ref2) to be passed by reference, value given in %s on line %d +Warning: test(): Argument #2 ($ref2) must be passed by reference, value given in %s on line %d bool(true) int(0) int(0) diff --git a/Zend/tests/call_user_func_009.phpt b/Zend/tests/call_user_func_009.phpt index ebbecd73e6..6f2ec7a4b6 100644 --- a/Zend/tests/call_user_func_009.phpt +++ b/Zend/tests/call_user_func_009.phpt @@ -10,8 +10,8 @@ var_dump(\call_user_func('sort', [])); ?> --EXPECTF-- -Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d +Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d bool(true) -Warning: sort() expects argument #1 ($arg) to be passed by reference, value given in %s on line %d +Warning: sort(): Argument #1 ($arg) must be passed by reference, value given in %s on line %d bool(true) diff --git a/Zend/tests/call_user_func_array_invalid_type.phpt b/Zend/tests/call_user_func_array_invalid_type.phpt index a7b5fb3cb7..785a6e35e9 100644 --- a/Zend/tests/call_user_func_array_invalid_type.phpt +++ b/Zend/tests/call_user_func_array_invalid_type.phpt @@ -15,4 +15,4 @@ try { } ?> --EXPECT-- -call_user_func_array() expects argument #2 ($args) to be of type array, null given +call_user_func_array(): Argument #2 ($args) must be of type array, null given diff --git a/Zend/tests/closure_027.phpt b/Zend/tests/closure_027.phpt index bffd69c11a..ceffcd72ab 100644 --- a/Zend/tests/closure_027.phpt +++ b/Zend/tests/closure_027.phpt @@ -30,7 +30,7 @@ NULL Warning: Undefined variable: y in %s on line %d Exception: Too few arguments to function {closure}(), 0 passed in %s on line %d and exactly 1 expected -Fatal error: Uncaught TypeError: test() expects argument #1 ($a) to be of type Closure, stdClass given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: test(): Argument #1 ($a) must be of type Closure, stdClass given, called in %s:%d Stack trace: #0 %s(%d): test(Object(stdClass)) #1 {main} diff --git a/Zend/tests/closure_059.phpt b/Zend/tests/closure_059.phpt index c63e654f2d..ab418e42b7 100644 --- a/Zend/tests/closure_059.phpt +++ b/Zend/tests/closure_059.phpt @@ -33,6 +33,6 @@ try { echo "Exception: " . $e->getMessage() . "\n"; } --EXPECTF-- -Exception: {closure}() expects argument #1 ($a) to be of type A, B given, called in %s on line %d -Exception: {closure}() expects argument #1 ($a) to be of type A, B given -Exception: {closure}() expects argument #1 ($a) to be of type A, B given +Exception: {closure}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d +Exception: {closure}(): Argument #1 ($a) must be of type A, B given +Exception: {closure}(): Argument #1 ($a) must be of type A, B given diff --git a/Zend/tests/exception_017.phpt b/Zend/tests/exception_017.phpt index 4299ada5c0..f2f5f964ce 100644 --- a/Zend/tests/exception_017.phpt +++ b/Zend/tests/exception_017.phpt @@ -28,7 +28,7 @@ Error: Cannot call abstract method C::foo() in %s:%d Stack trace: #0 {main} -TypeError: foo() expects argument #1 ($x) to be of type callable, string given, called in %s on line %d and defined in %s:%d +TypeError: foo(): Argument #1 ($x) must be of type callable, string given, called in %s:%d Stack trace: #0 %s(%d): foo('C::foo') #1 {main} diff --git a/Zend/tests/exception_handler_004.phpt b/Zend/tests/exception_handler_004.phpt index e4684e942d..757a1b7f2d 100644 --- a/Zend/tests/exception_handler_004.phpt +++ b/Zend/tests/exception_handler_004.phpt @@ -9,7 +9,7 @@ set_exception_handler(array("", "")); echo "Done\n"; ?> --EXPECTF-- -Warning: set_exception_handler() expects argument #1 ($exception_handler) to be a valid callback in %s on line %d +Warning: set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback in %s on line %d -Warning: set_exception_handler() expects argument #1 ($exception_handler) to be a valid callback in %s on line %d +Warning: set_exception_handler(): Argument #1 ($exception_handler) must be a valid callback in %s on line %d Done diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt index c8977ece99..206b96149b 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt @@ -49,6 +49,6 @@ Too few arguments to function bar(), 1 passed in %s and exactly 2 expected ArgumentCountError Too few arguments to function bat(), 1 passed in %s and exactly 2 expected TypeError -bat() expects argument #1 ($foo) to be of type int, string given, called in %s on line %d +bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d TypeError -bat() expects argument #2 ($bar) to be of type string, int given, called in %s on line %d +bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d diff --git a/Zend/tests/function_arguments/variadic_argument_type_error.phpt b/Zend/tests/function_arguments/variadic_argument_type_error.phpt index ee244ab4a1..3a9bc050cc 100644 --- a/Zend/tests/function_arguments/variadic_argument_type_error.phpt +++ b/Zend/tests/function_arguments/variadic_argument_type_error.phpt @@ -18,5 +18,5 @@ try { } --EXPECTF-- -foo() expects argument #2 ($bar) to be of type int, array given, called in %s on line %d -foo() expects argument #4 ($bar) to be of type int, array given, called in %s on line %d +foo(): Argument #2 ($bar) must be of type int, array given, called in %s on line %d +foo(): Argument #4 ($bar) must be of type int, array given, called in %s on line %d diff --git a/Zend/tests/generators/generator_with_type_check.phpt b/Zend/tests/generators/generator_with_type_check.phpt index 90636406b4..67d19ab947 100644 --- a/Zend/tests/generators/generator_with_type_check.phpt +++ b/Zend/tests/generators/generator_with_type_check.phpt @@ -6,7 +6,7 @@ function gen(array $a) { yield; } gen(42); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s:%d Stack trace: #0 %sgenerator_with_type_check.php(3): gen(42) #1 {main} diff --git a/Zend/tests/generators/generator_with_type_check_2.phpt b/Zend/tests/generators/generator_with_type_check_2.phpt index 445c8f4a9f..21e8ab8bed 100644 --- a/Zend/tests/generators/generator_with_type_check_2.phpt +++ b/Zend/tests/generators/generator_with_type_check_2.phpt @@ -18,5 +18,5 @@ try { } ?> --EXPECTF-- -gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d -gen() expects argument #1 ($a) to be of type array, int given, called in %s on line %d +gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d +gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d diff --git a/Zend/tests/generators/throw_not_an_exception.phpt b/Zend/tests/generators/throw_not_an_exception.phpt index dcb1d3d0b0..d1ff81882f 100644 --- a/Zend/tests/generators/throw_not_an_exception.phpt +++ b/Zend/tests/generators/throw_not_an_exception.phpt @@ -12,7 +12,7 @@ $gen->throw(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Generator::throw() expects argument #1 ($exception) to be of type Throwable, object given in %s:%d +Fatal error: Uncaught TypeError: Generator::throw(): Argument #1 ($exception) must be of type Throwable, object given in %s:%d Stack trace: #0 %s(%d): Generator->throw(Object(stdClass)) #1 {main} diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt index 5ccf9e0d26..c158cd1ca1 100644 --- a/Zend/tests/methods-on-non-objects-call-user-func.phpt +++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt @@ -10,4 +10,4 @@ try { } ?> --EXPECT-- -call_user_func() expects argument #1 ($function) to be a valid callback, first array member is not a valid class name or object +call_user_func(): Argument #1 ($function) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/ns_071.phpt b/Zend/tests/ns_071.phpt index cee6431be0..b0126e399f 100644 --- a/Zend/tests/ns_071.phpt +++ b/Zend/tests/ns_071.phpt @@ -18,7 +18,7 @@ new bar(new \stdclass); --EXPECTF-- NULL -Fatal error: Uncaught TypeError: foo\bar::__construct() expects argument #1 ($x) to be of type ?array, object given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: foo\bar::__construct(): Argument #1 ($x) must be of type ?array, object given, called in %s:%d Stack trace: #0 %s(%d): foo\bar->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/ns_072.phpt b/Zend/tests/ns_072.phpt index 6429632658..b41fe29778 100644 --- a/Zend/tests/ns_072.phpt +++ b/Zend/tests/ns_072.phpt @@ -30,7 +30,7 @@ object(foo\test)#%d (0) { } NULL -Fatal error: Uncaught TypeError: foo\bar::__construct() expects argument #1 ($x) to be of type ?foo\foo, stdClass given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: foo\bar::__construct(): Argument #1 ($x) must be of type ?foo\foo, stdClass given, called in %s:%d Stack trace: #0 %s(%d): foo\bar->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/object_types/type_hint_in_class_method.phpt b/Zend/tests/object_types/type_hint_in_class_method.phpt index 098bfc0c52..f23189cb50 100644 --- a/Zend/tests/object_types/type_hint_in_class_method.phpt +++ b/Zend/tests/object_types/type_hint_in_class_method.phpt @@ -11,7 +11,7 @@ $one = new One(); $one->a(new One()); $one->a(123); --EXPECTF-- -Fatal error: Uncaught TypeError: One::a() expects argument #1 ($obj) to be of type object, int given, called in %s:%d +Fatal error: Uncaught TypeError: One::a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d Stack trace: #0 %s(9): One->a(123) #1 {main} diff --git a/Zend/tests/object_types/type_hint_in_function.phpt b/Zend/tests/object_types/type_hint_in_function.phpt index e834997f4d..f35e73b3a7 100644 --- a/Zend/tests/object_types/type_hint_in_function.phpt +++ b/Zend/tests/object_types/type_hint_in_function.phpt @@ -9,7 +9,7 @@ function a(object $obj) {} a(new A()); a(123); --EXPECTF-- -Fatal error: Uncaught TypeError: a() expects argument #1 ($obj) to be of type object, int given, called in %s on line %d and defined in %s:%d +Fatal error: Uncaught TypeError: a(): Argument #1 ($obj) must be of type object, int given, called in %s:%d Stack trace: #0 %s(7): a(123) #1 {main} diff --git a/Zend/tests/objects_022.phpt b/Zend/tests/objects_022.phpt index ce2d2f7c00..5fa6f8e95d 100644 --- a/Zend/tests/objects_022.phpt +++ b/Zend/tests/objects_022.phpt @@ -36,7 +36,7 @@ object(bar)#%d (0) { object(baz)#%d (0) { } -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 +Fatal error: Uncaught TypeError: foo::testFoo(): Argument #1 ($obj) must be of type foo, stdClass given, called in %s:%d Stack trace: #0 %s(%d): foo->testFoo(Object(stdClass)) #1 {main} diff --git a/Zend/tests/trait_type_errors.phpt b/Zend/tests/trait_type_errors.phpt index 1d29714a2f..2f5069a433 100644 --- a/Zend/tests/trait_type_errors.phpt +++ b/Zend/tests/trait_type_errors.phpt @@ -39,5 +39,5 @@ try { ?> --EXPECTF-- Return value of C::test1() must be of type int, string returned -C::test2() expects argument #1 ($arg) to be of 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 +C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d +C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/type_declarations/array_001.phpt b/Zend/tests/type_declarations/array_001.phpt index 0e08bd8b7f..5739ae1b72 100644 --- a/Zend/tests/type_declarations/array_001.phpt +++ b/Zend/tests/type_declarations/array_001.phpt @@ -12,7 +12,7 @@ foo(123); --EXPECTF-- 3 -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 +Fatal error: Uncaught TypeError: foo(): Argument #1 ($a) must be of type array, int given, called in %s:%d Stack trace: #0 %s(%d): foo(123) #1 {main} diff --git a/Zend/tests/type_declarations/callable_001.phpt b/Zend/tests/type_declarations/callable_001.phpt index e6c2702235..6b555f40e6 100644 --- a/Zend/tests/type_declarations/callable_001.phpt +++ b/Zend/tests/type_declarations/callable_001.phpt @@ -29,7 +29,7 @@ array(2) { string(3) "foo" } -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 +Fatal error: Uncaught TypeError: foo(): Argument #1 ($bar) must be of type callable, array given, called in %s:%d Stack trace: #0 %s(%d): foo(Array) #1 {main} diff --git a/Zend/tests/type_declarations/explicit_weak_include_strict.phpt b/Zend/tests/type_declarations/explicit_weak_include_strict.phpt index 5ad7bd17fc..60d4159dc2 100644 --- a/Zend/tests/type_declarations/explicit_weak_include_strict.phpt +++ b/Zend/tests/type_declarations/explicit_weak_include_strict.phpt @@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc'; // calls within that file should stay strict, despite being included by weak file ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: takes_int(): Argument #1 ($x) must be of type int, float given, called in %s:%d Stack trace: #0 %s(%d): takes_int(1) #1 %s(%d): require('%s') diff --git a/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt b/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt index 661616fb92..d70f7e240a 100644 --- a/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt +++ b/Zend/tests/type_declarations/inexistent_class_hint_with_scalar_arg.phpt @@ -8,7 +8,7 @@ foo(null); ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: foo(): Argument #1 ($ex) must be of type bar, null given, called in %s:%d Stack trace: #0 %s(%d): foo(NULL) #1 {main} diff --git a/Zend/tests/type_declarations/internal_function_strict_mode.phpt b/Zend/tests/type_declarations/internal_function_strict_mode.phpt index b3b9adc9d3..04c59ae341 100644 --- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt +++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt @@ -28,8 +28,8 @@ try { ?> --EXPECT-- *** Trying Ord With Integer -*** Caught ord() expects argument #1 ($character) to be of type string, int given +*** Caught ord(): Argument #1 ($character) must be of type string, int given *** Trying Array Map With Invalid Callback -*** Caught array_map() expects argument #1 ($callback) to be a valid callback, first array member is not a valid class name or object +*** Caught array_map(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object *** Trying Strlen With Float -*** Caught strlen() expects argument #1 ($str) to be of type string, float given +*** Caught strlen(): Argument #1 ($str) must be of type string, float given diff --git a/Zend/tests/type_declarations/iterable_001.phpt b/Zend/tests/type_declarations/iterable_001.phpt index 856dc63c4d..e5f21957ba 100644 --- a/Zend/tests/type_declarations/iterable_001.phpt +++ b/Zend/tests/type_declarations/iterable_001.phpt @@ -44,4 +44,4 @@ object(ArrayIterator)#1 (1) { int(3) } } -test() expects argument #1 ($iterable) to be of type iterable, int given, called in %s on line %d +test(): Argument #1 ($iterable) must be of type iterable, int given, called in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt index ef10e67ac0..e4b8ab5c51 100644 --- a/Zend/tests/type_declarations/scalar_basic.phpt +++ b/Zend/tests/type_declarations/scalar_basic.phpt @@ -78,16 +78,16 @@ E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying int(%d) int(%d) *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying bool(true) int(1) @@ -96,22 +96,22 @@ int(1) int(0) *** Trying NULL -*** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying object(Stringable)#%s (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -132,10 +132,10 @@ E_NOTICE: A non well formed numeric value encountered on line %d float(1) *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying int(%d) float(%s) @@ -150,22 +150,22 @@ float(1) float(0) *** Trying NULL -*** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying object(Stringable)#%s (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: @@ -203,22 +203,22 @@ string(1) "1" string(0) "" *** Trying NULL -*** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying object(Stringable)#%s (0) { } string(6) "foobar" *** Trying resource(%d) of type (stream) -*** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: @@ -256,21 +256,21 @@ bool(true) bool(false) *** Trying NULL -*** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying object(Stringable)#%s (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/scalar_constant_defaults.phpt b/Zend/tests/type_declarations/scalar_constant_defaults.phpt index 28f0252cdf..5e3826de7d 100644 --- a/Zend/tests/type_declarations/scalar_constant_defaults.phpt +++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt @@ -96,9 +96,9 @@ float(10.7) Testing string add val string(14) "this is a test" Testing int with default null constant -int_val_default_null() expects argument #1 ($a) to be of type int, null given, called in %s on line %d +int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing int with null null constant -int_val_default_null() expects argument #1 ($a) to be of type int, null given, called in %s on line %d +int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing nullable int with default null constant NULL Testing nullable int with null null constant diff --git a/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt b/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt index 66d56e72df..72cc9820da 100644 --- a/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt +++ b/Zend/tests/type_declarations/scalar_constant_defaults_error.phpt @@ -13,7 +13,7 @@ var_dump(int_val()); ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: int_val(): Argument #1 ($a) must be of type int, string given, called in %s:%d Stack trace: #0 %s(%d): int_val() #1 {main} diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt index ab9647ba9c..d1ade3ad48 100644 --- a/Zend/tests/type_declarations/scalar_null.phpt +++ b/Zend/tests/type_declarations/scalar_null.phpt @@ -27,13 +27,13 @@ echo PHP_EOL . "Done"; ?> --EXPECTF-- Testing int: -*** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d Testing float: -*** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d Testing string: -*** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d Testing bool: -*** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d Testing int nullable: NULL Testing float nullable: diff --git a/Zend/tests/type_declarations/scalar_strict.phpt b/Zend/tests/type_declarations/scalar_strict.phpt index 89ab6a024b..032fd3d301 100644 --- a/Zend/tests/type_declarations/scalar_strict.phpt +++ b/Zend/tests/type_declarations/scalar_strict.phpt @@ -60,52 +60,52 @@ Testing 'int' type: int(1) *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying int(2147483647) int(2147483647) *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -113,7 +113,7 @@ Testing 'float' type: float(1) *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying float(1) float(1) @@ -122,13 +122,13 @@ float(1) float(1.5) *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying int(2147483647) float(2147483647) @@ -137,42 +137,42 @@ float(2147483647) float(NAN) *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: *** Trying int(1) -*** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying string(1) "1" string(1) "1" *** Trying float(1) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying string(2) "1a" string(2) "1a" @@ -184,63 +184,63 @@ string(1) "a" string(0) "" *** Trying int(2147483647) -*** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: *** Trying int(1) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying int(2147483647) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying bool(true) bool(true) @@ -249,21 +249,21 @@ bool(true) bool(false) *** Trying NULL -*** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt index 2d00b6f23b..5818606b4c 100644 --- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt @@ -60,52 +60,52 @@ Testing 'int' type: int(1) *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -113,7 +113,7 @@ Testing 'float' type: float(1) *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying float(1) float(1) @@ -122,13 +122,13 @@ float(1) float(1.5) *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying int(9223372036854775807) float(9.223372036854776E+18) @@ -137,42 +137,42 @@ float(9.223372036854776E+18) float(NAN) *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: *** Trying int(1) -*** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying string(1) "1" string(1) "1" *** Trying float(1) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying string(2) "1a" string(2) "1a" @@ -184,63 +184,63 @@ string(1) "a" string(0) "" *** Trying int(9223372036854775807) -*** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying bool(false) -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying NULL -*** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: *** Trying int(1) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying string(1) "1" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying int(9223372036854775807) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying bool(true) bool(true) @@ -249,21 +249,21 @@ bool(true) bool(false) *** Trying NULL -*** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying object(Stringable)#6 (0) { } -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying resource(5) of type (stream) -*** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt index d3050314f4..cb385422bd 100644 --- a/Zend/tests/type_declarations/scalar_strict_basic.phpt +++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt @@ -57,28 +57,28 @@ Testing 'int' type: int(1) *** Trying float value -*** Caught {closure}() expects argument #1 ($i) to be of type int, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying string value -*** Caught {closure}() expects argument #1 ($i) to be of type int, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying true value -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying false value -*** Caught {closure}() expects argument #1 ($i) to be of type int, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, bool given, called in %s on line %d *** Trying null value -*** Caught {closure}() expects argument #1 ($i) to be of type int, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array value -*** Caught {closure}() expects argument #1 ($i) to be of type int, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object value -*** Caught {closure}() expects argument #1 ($i) to be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d *** Trying resource value -*** Caught {closure}() expects argument #1 ($i) to be of type int, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -89,65 +89,65 @@ float(1) float(1) *** Trying string value -*** Caught {closure}() expects argument #1 ($f) to be of type float, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying true value -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying false value -*** Caught {closure}() expects argument #1 ($f) to be of type float, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, bool given, called in %s on line %d *** Trying null value -*** Caught {closure}() expects argument #1 ($f) to be of type float, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array value -*** Caught {closure}() expects argument #1 ($f) to be of type float, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object value -*** Caught {closure}() expects argument #1 ($f) to be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d *** Trying resource value -*** Caught {closure}() expects argument #1 ($f) to be of type float, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: *** Trying integer value -*** Caught {closure}() expects argument #1 ($s) to be of type string, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying float value -*** Caught {closure}() expects argument #1 ($s) to be of type string, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying string value string(1) "1" *** Trying true value -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying false value -*** Caught {closure}() expects argument #1 ($s) to be of type string, bool given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, bool given, called in %s on line %d *** Trying null value -*** Caught {closure}() expects argument #1 ($s) to be of type string, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array value -*** Caught {closure}() expects argument #1 ($s) to be of type string, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object value -*** Caught {closure}() expects argument #1 ($s) to be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d *** Trying resource value -*** Caught {closure}() expects argument #1 ($s) to be of type string, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: *** Trying integer value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, int given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying float value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, float given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying string value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, string given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying true value bool(true) @@ -156,15 +156,15 @@ bool(true) bool(false) *** Trying null value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, null given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, array given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d *** Trying resource value -*** Caught {closure}() expects argument #1 ($b) to be of type bool, resource given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/strict_call_weak.phpt b/Zend/tests/type_declarations/strict_call_weak.phpt index e20524b2d5..55da67a6ef 100644 --- a/Zend/tests/type_declarations/strict_call_weak.phpt +++ b/Zend/tests/type_declarations/strict_call_weak.phpt @@ -13,7 +13,7 @@ require 'strict_call_weak_2.inc'; function_declared_in_weak_mode(1.0); ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: function_declared_in_weak_mode(): Argument #1 ($x) must be of type int, float given, called in %s:%d Stack trace: #0 %s(%d): function_declared_in_weak_mode(1) #1 {main} diff --git a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt index b6b382e5cc..14b460aa9d 100644 --- a/Zend/tests/type_declarations/strict_call_weak_explicit.phpt +++ b/Zend/tests/type_declarations/strict_call_weak_explicit.phpt @@ -13,7 +13,7 @@ require 'strict_call_weak_explicit_2.inc'; function_declared_in_weak_mode(1.0); ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: function_declared_in_weak_mode(): Argument #1 ($x) must be of type int, float given, called in %s:%d Stack trace: #0 %s(%d): function_declared_in_weak_mode(1) #1 {main} diff --git a/Zend/tests/type_declarations/union_types/multiple_classes.phpt b/Zend/tests/type_declarations/union_types/multiple_classes.phpt index 3187415586..b45fc02d83 100644 --- a/Zend/tests/type_declarations/union_types/multiple_classes.phpt +++ b/Zend/tests/type_declarations/union_types/multiple_classes.phpt @@ -68,7 +68,7 @@ int(42) int(42) int(42) Cannot assign stdClass to property Test::$prop of type X|Y|Z|int -Test::method() expects argument #1 ($arg) to be of type X|Y|Z|int, stdClass given, called in %s on line %d +Test::method(): Argument #1 ($arg) must be of type X|Y|Z|int, stdClass given, called in %s on line %d object(X)#4 (0) { } object(X)#6 (0) { diff --git a/Zend/tests/type_declarations/union_types/type_checking_strict.phpt b/Zend/tests/type_declarations/union_types/type_checking_strict.phpt index 81c75328d6..4887b3b796 100644 --- a/Zend/tests/type_declarations/union_types/type_checking_strict.phpt +++ b/Zend/tests/type_declarations/union_types/type_checking_strict.phpt @@ -37,7 +37,7 @@ function test(string $type, array $values) { } catch (TypeError $e) { $msg = $e->getMessage(); $msg = strstr($msg, ', called in', true); - $msg = str_replace('{closure}() expects argument #1', 'Argument ...', $msg); + $msg = str_replace('{closure}(): Argument #1 ($arg)', 'Argument ...', $msg); echo $msg; } echo "\n"; @@ -70,86 +70,86 @@ Type int|float: 42 => 42 42.0 => 42.0 INF => INF -"42" => Argument ... ($arg) to be of type int|float, string given -"42.0" => Argument ... ($arg) to be of type int|float, string given -"42x" => Argument ... ($arg) to be of type int|float, string given -"x" => Argument ... ($arg) to be of type int|float, string given -"" => Argument ... ($arg) to be of type int|float, string given -true => Argument ... ($arg) to be of type int|float, bool given -false => Argument ... ($arg) to be of type int|float, bool given -null => Argument ... ($arg) to be of type int|float, null given -[] => Argument ... ($arg) to be of type int|float, array given -new stdClass => Argument ... ($arg) to be of type int|float, object given -new WithToString => Argument ... ($arg) to be of type int|float, object given +"42" => Argument ... must be of type int|float, string given +"42.0" => Argument ... must be of type int|float, string given +"42x" => Argument ... must be of type int|float, string given +"x" => Argument ... must be of type int|float, string given +"" => Argument ... must be of type int|float, string given +true => Argument ... must be of type int|float, bool given +false => Argument ... must be of type int|float, bool given +null => Argument ... must be of type int|float, null given +[] => Argument ... must be of type int|float, array given +new stdClass => Argument ... must be of type int|float, object given +new WithToString => Argument ... must be of type int|float, object given Type int|float|false: 42 => 42 42.0 => 42.0 INF => INF -"42" => Argument ... ($arg) to be of type int|float|false, string given -"42.0" => Argument ... ($arg) to be of type int|float|false, string given -"42x" => Argument ... ($arg) to be of type int|float|false, string given -"x" => Argument ... ($arg) to be of type int|float|false, string given -"" => Argument ... ($arg) to be of type int|float|false, string given -true => Argument ... ($arg) to be of type int|float|false, bool given +"42" => Argument ... must be of type int|float|false, string given +"42.0" => Argument ... must be of type int|float|false, string given +"42x" => Argument ... must be of type int|float|false, string given +"x" => Argument ... must be of type int|float|false, string given +"" => Argument ... must be of type int|float|false, string given +true => Argument ... must be of type int|float|false, bool given false => false -null => Argument ... ($arg) to be of type int|float|false, null given -[] => Argument ... ($arg) to be of type int|float|false, array given -new stdClass => Argument ... ($arg) to be of type int|float|false, object given -new WithToString => Argument ... ($arg) to be of type int|float|false, object given +null => Argument ... must be of type int|float|false, null given +[] => Argument ... must be of type int|float|false, array given +new stdClass => Argument ... must be of type int|float|false, object given +new WithToString => Argument ... must be of type int|float|false, object given Type int|float|bool: 42 => 42 42.0 => 42.0 INF => INF -"42" => Argument ... ($arg) to be of type int|float|bool, string given -"42.0" => Argument ... ($arg) to be of type int|float|bool, string given -"42x" => Argument ... ($arg) to be of type int|float|bool, string given -"x" => Argument ... ($arg) to be of type int|float|bool, string given -"" => Argument ... ($arg) to be of type int|float|bool, string given +"42" => Argument ... must be of type int|float|bool, string given +"42.0" => Argument ... must be of type int|float|bool, string given +"42x" => Argument ... must be of type int|float|bool, string given +"x" => Argument ... must be of type int|float|bool, string given +"" => Argument ... must be of type int|float|bool, string given true => true false => false -null => Argument ... ($arg) to be of type int|float|bool, null given -[] => Argument ... ($arg) to be of type int|float|bool, array given -new stdClass => Argument ... ($arg) to be of type int|float|bool, object given -new WithToString => Argument ... ($arg) to be of type int|float|bool, object given +null => Argument ... must be of type int|float|bool, null given +[] => Argument ... must be of type int|float|bool, array given +new stdClass => Argument ... must be of type int|float|bool, object given +new WithToString => Argument ... must be of type int|float|bool, object given Type int|bool: 42 => 42 -42.0 => Argument ... ($arg) to be of type int|bool, float given -INF => Argument ... ($arg) to be of type int|bool, float given -"42" => Argument ... ($arg) to be of type int|bool, string given -"42.0" => Argument ... ($arg) to be of type int|bool, string given -"42x" => Argument ... ($arg) to be of type int|bool, string given -"x" => Argument ... ($arg) to be of type int|bool, string given -"" => Argument ... ($arg) to be of type int|bool, string given +42.0 => Argument ... must be of type int|bool, float given +INF => Argument ... must be of type int|bool, float given +"42" => Argument ... must be of type int|bool, string given +"42.0" => Argument ... must be of type int|bool, string given +"42x" => Argument ... must be of type int|bool, string given +"x" => Argument ... must be of type int|bool, string given +"" => Argument ... must be of type int|bool, string given true => true false => false -null => Argument ... ($arg) to be of type int|bool, null given -[] => Argument ... ($arg) to be of type int|bool, array given -new stdClass => Argument ... ($arg) to be of type int|bool, object given -new WithToString => Argument ... ($arg) to be of type int|bool, object given +null => Argument ... must be of type int|bool, null given +[] => Argument ... must be of type int|bool, array given +new stdClass => Argument ... must be of type int|bool, object given +new WithToString => Argument ... must be of type int|bool, object given Type int|string|null: 42 => 42 -42.0 => Argument ... ($arg) to be of type string|int|null, float given -INF => Argument ... ($arg) to be of type string|int|null, float given +42.0 => Argument ... must be of type string|int|null, float given +INF => Argument ... must be of type string|int|null, float given "42" => "42" "42.0" => "42.0" "42x" => "42x" "x" => "x" "" => "" -true => Argument ... ($arg) to be of type string|int|null, bool given -false => Argument ... ($arg) to be of type string|int|null, bool given +true => Argument ... must be of type string|int|null, bool given +false => Argument ... must be of type string|int|null, bool given null => null -[] => Argument ... ($arg) to be of type string|int|null, array given -new stdClass => Argument ... ($arg) to be of type string|int|null, object given -new WithToString => Argument ... ($arg) to be of type string|int|null, object given +[] => Argument ... must be of type string|int|null, array given +new stdClass => Argument ... must be of type string|int|null, object given +new WithToString => Argument ... must be of type string|int|null, object given Type string|bool: -42 => Argument ... ($arg) to be of type string|bool, int given -42.0 => Argument ... ($arg) to be of type string|bool, float given -INF => Argument ... ($arg) to be of type string|bool, float given +42 => Argument ... must be of type string|bool, int given +42.0 => Argument ... must be of type string|bool, float given +INF => Argument ... must be of type string|bool, float given "42" => "42" "42.0" => "42.0" "42x" => "42x" @@ -157,55 +157,55 @@ INF => Argument ... ($arg) to be of type string|bool, float given "" => "" true => true false => false -null => Argument ... ($arg) to be of type string|bool, null given -[] => Argument ... ($arg) to be of type string|bool, array given -new stdClass => Argument ... ($arg) to be of type string|bool, object given -new WithToString => Argument ... ($arg) to be of type string|bool, object given +null => Argument ... must be of type string|bool, null given +[] => Argument ... must be of type string|bool, array given +new stdClass => Argument ... must be of type string|bool, object given +new WithToString => Argument ... must be of type string|bool, object given Type float|array: 42 => 42.0 42.0 => 42.0 INF => INF -"42" => Argument ... ($arg) to be of type array|float, string given -"42.0" => Argument ... ($arg) to be of type array|float, string given -"42x" => Argument ... ($arg) to be of type array|float, string given -"x" => Argument ... ($arg) to be of type array|float, string given -"" => Argument ... ($arg) to be of type array|float, string given -true => Argument ... ($arg) to be of type array|float, bool given -false => Argument ... ($arg) to be of type array|float, bool given -null => Argument ... ($arg) to be of type array|float, null given +"42" => Argument ... must be of type array|float, string given +"42.0" => Argument ... must be of type array|float, string given +"42x" => Argument ... must be of type array|float, string given +"x" => Argument ... must be of type array|float, string given +"" => Argument ... must be of type array|float, string given +true => Argument ... must be of type array|float, bool given +false => Argument ... must be of type array|float, bool given +null => Argument ... must be of type array|float, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|float, object given -new WithToString => Argument ... ($arg) to be of type array|float, object given +new stdClass => Argument ... must be of type array|float, object given +new WithToString => Argument ... must be of type array|float, object given Type string|array: -42 => Argument ... ($arg) to be of type array|string, int given -42.0 => Argument ... ($arg) to be of type array|string, float given -INF => Argument ... ($arg) to be of type array|string, float given +42 => Argument ... must be of type array|string, int given +42.0 => Argument ... must be of type array|string, float given +INF => Argument ... must be of type array|string, float given "42" => "42" "42.0" => "42.0" "42x" => "42x" "x" => "x" "" => "" -true => Argument ... ($arg) to be of type array|string, bool given -false => Argument ... ($arg) to be of type array|string, bool given -null => Argument ... ($arg) to be of type array|string, null given +true => Argument ... must be of type array|string, bool given +false => Argument ... must be of type array|string, bool given +null => Argument ... must be of type array|string, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|string, object given -new WithToString => Argument ... ($arg) to be of type array|string, object given +new stdClass => Argument ... must be of type array|string, object given +new WithToString => Argument ... must be of type array|string, object given Type bool|array: -42 => Argument ... ($arg) to be of type array|bool, int given -42.0 => Argument ... ($arg) to be of type array|bool, float given -INF => Argument ... ($arg) to be of type array|bool, float given -"42" => Argument ... ($arg) to be of type array|bool, string given -"42.0" => Argument ... ($arg) to be of type array|bool, string given -"42x" => Argument ... ($arg) to be of type array|bool, string given -"x" => Argument ... ($arg) to be of type array|bool, string given -"" => Argument ... ($arg) to be of type array|bool, string given +42 => Argument ... must be of type array|bool, int given +42.0 => Argument ... must be of type array|bool, float given +INF => Argument ... must be of type array|bool, float given +"42" => Argument ... must be of type array|bool, string given +"42.0" => Argument ... must be of type array|bool, string given +"42x" => Argument ... must be of type array|bool, string given +"x" => Argument ... must be of type array|bool, string given +"" => Argument ... must be of type array|bool, string given true => true false => false -null => Argument ... ($arg) to be of type array|bool, null given +null => Argument ... must be of type array|bool, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|bool, object given -new WithToString => Argument ... ($arg) to be of type array|bool, object given +new stdClass => Argument ... must be of type array|bool, object given +new WithToString => Argument ... must be of type array|bool, object given diff --git a/Zend/tests/type_declarations/union_types/type_checking_weak.phpt b/Zend/tests/type_declarations/union_types/type_checking_weak.phpt index c48e95f640..1b9fa4b316 100644 --- a/Zend/tests/type_declarations/union_types/type_checking_weak.phpt +++ b/Zend/tests/type_declarations/union_types/type_checking_weak.phpt @@ -35,7 +35,7 @@ function test(string $type, array $values) { } catch (TypeError $e) { $msg = $e->getMessage(); $msg = strstr($msg, ', called in', true); - $msg = str_replace('{closure}() expects argument #1', 'Argument ...', $msg); + $msg = str_replace('{closure}(): Argument #1 ($arg)', 'Argument ...', $msg); echo $msg; } echo "\n"; @@ -71,14 +71,14 @@ INF => INF "42" => 42 "42.0" => 42.0 "42x" => 42 (A non well formed numeric value encountered) -"x" => Argument ... ($arg) to be of type int|float, string given -"" => Argument ... ($arg) to be of type int|float, string given +"x" => Argument ... must be of type int|float, string given +"" => Argument ... must be of type int|float, string given true => 1 false => 0 -null => Argument ... ($arg) to be of type int|float, null given -[] => Argument ... ($arg) to be of type int|float, array given -new stdClass => Argument ... ($arg) to be of type int|float, object given -new WithToString => Argument ... ($arg) to be of type int|float, object given +null => Argument ... must be of type int|float, null given +[] => Argument ... must be of type int|float, array given +new stdClass => Argument ... must be of type int|float, object given +new WithToString => Argument ... must be of type int|float, object given Type int|float|false: 42 => 42 @@ -87,14 +87,14 @@ INF => INF "42" => 42 "42.0" => 42.0 "42x" => 42 (A non well formed numeric value encountered) -"x" => Argument ... ($arg) to be of type int|float|false, string given -"" => Argument ... ($arg) to be of type int|float|false, string given +"x" => Argument ... must be of type int|float|false, string given +"" => Argument ... must be of type int|float|false, string given true => 1 false => false -null => Argument ... ($arg) to be of type int|float|false, null given -[] => Argument ... ($arg) to be of type int|float|false, array given -new stdClass => Argument ... ($arg) to be of type int|float|false, object given -new WithToString => Argument ... ($arg) to be of type int|float|false, object given +null => Argument ... must be of type int|float|false, null given +[] => Argument ... must be of type int|float|false, array given +new stdClass => Argument ... must be of type int|float|false, object given +new WithToString => Argument ... must be of type int|float|false, object given Type int|float|bool: 42 => 42 @@ -107,10 +107,10 @@ INF => INF "" => false true => true false => false -null => Argument ... ($arg) to be of type int|float|bool, null given -[] => Argument ... ($arg) to be of type int|float|bool, array given -new stdClass => Argument ... ($arg) to be of type int|float|bool, object given -new WithToString => Argument ... ($arg) to be of type int|float|bool, object given +null => Argument ... must be of type int|float|bool, null given +[] => Argument ... must be of type int|float|bool, array given +new stdClass => Argument ... must be of type int|float|bool, object given +new WithToString => Argument ... must be of type int|float|bool, object given Type int|bool: 42 => 42 @@ -123,10 +123,10 @@ INF => true "" => false true => true false => false -null => Argument ... ($arg) to be of type int|bool, null given -[] => Argument ... ($arg) to be of type int|bool, array given -new stdClass => Argument ... ($arg) to be of type int|bool, object given -new WithToString => Argument ... ($arg) to be of type int|bool, object given +null => Argument ... must be of type int|bool, null given +[] => Argument ... must be of type int|bool, array given +new stdClass => Argument ... must be of type int|bool, object given +new WithToString => Argument ... must be of type int|bool, object given Type int|string|null: 42 => 42 @@ -140,8 +140,8 @@ INF => "INF" true => 1 false => 0 null => null -[] => Argument ... ($arg) to be of type string|int|null, array given -new stdClass => Argument ... ($arg) to be of type string|int|null, object given +[] => Argument ... must be of type string|int|null, array given +new stdClass => Argument ... must be of type string|int|null, object given new WithToString => "__toString()" Type string|bool: @@ -155,9 +155,9 @@ INF => "INF" "" => "" true => true false => false -null => Argument ... ($arg) to be of type string|bool, null given -[] => Argument ... ($arg) to be of type string|bool, array given -new stdClass => Argument ... ($arg) to be of type string|bool, object given +null => Argument ... must be of type string|bool, null given +[] => Argument ... must be of type string|bool, array given +new stdClass => Argument ... must be of type string|bool, object given new WithToString => "__toString()" Type float|array: @@ -167,14 +167,14 @@ INF => INF "42" => 42.0 "42.0" => 42.0 "42x" => 42.0 (A non well formed numeric value encountered) -"x" => Argument ... ($arg) to be of type array|float, string given -"" => Argument ... ($arg) to be of type array|float, string given +"x" => Argument ... must be of type array|float, string given +"" => Argument ... must be of type array|float, string given true => 1.0 false => 0.0 -null => Argument ... ($arg) to be of type array|float, null given +null => Argument ... must be of type array|float, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|float, object given -new WithToString => Argument ... ($arg) to be of type array|float, object given +new stdClass => Argument ... must be of type array|float, object given +new WithToString => Argument ... must be of type array|float, object given Type string|array: 42 => "42" @@ -187,9 +187,9 @@ INF => "INF" "" => "" true => "1" false => "" -null => Argument ... ($arg) to be of type array|string, null given +null => Argument ... must be of type array|string, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|string, object given +new stdClass => Argument ... must be of type array|string, object given new WithToString => "__toString()" Type bool|array: @@ -203,7 +203,7 @@ INF => true "" => false true => true false => false -null => Argument ... ($arg) to be of type array|bool, null given +null => Argument ... must be of type array|bool, null given [] => [] -new stdClass => Argument ... ($arg) to be of type array|bool, object given -new WithToString => Argument ... ($arg) to be of type array|bool, object given +new stdClass => Argument ... must be of type array|bool, object given +new WithToString => Argument ... must be of type array|bool, object given diff --git a/Zend/tests/type_declarations/weak_include_strict.phpt b/Zend/tests/type_declarations/weak_include_strict.phpt index 61f33818e2..9bf6c0a47f 100644 --- a/Zend/tests/type_declarations/weak_include_strict.phpt +++ b/Zend/tests/type_declarations/weak_include_strict.phpt @@ -11,7 +11,7 @@ require 'weak_include_strict_2.inc'; // calls within that file should stay strict, despite being included by weak file ?> --EXPECTF-- -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 +Fatal error: Uncaught TypeError: takes_int(): Argument #1 ($x) must be of type int, float given, called in %s:%d Stack trace: #0 %s(%d): takes_int(1) #1 %s(%d): require('%s') diff --git a/Zend/tests/typehints/or_null.phpt b/Zend/tests/typehints/or_null.phpt index 55714620c2..2d0683edbb 100644 --- a/Zend/tests/typehints/or_null.phpt +++ b/Zend/tests/typehints/or_null.phpt @@ -219,39 +219,39 @@ try { ?> --EXPECTF-- -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 +TypeError: unloadedClass(): Argument #1 ($param) must be of type ?I\Dont\Exist, stdClass given, called in %s:%d Stack trace: #0 %s(8): unloadedClass(Object(stdClass)) #1 {main} -TypeError: loadedClass() expects argument #1 ($param) to be of type ?RealClass, stdClass given, called in %s on line %d and defined in %s:%d +TypeError: loadedClass(): Argument #1 ($param) must be of type ?RealClass, stdClass given, called in %s:%d Stack trace: #0 %s(20): loadedClass(Object(stdClass)) #1 {main} -TypeError: loadedInterface() expects argument #1 ($param) to be of type ?RealInterface, stdClass given, called in %s on line %d and defined in %s:%d +TypeError: loadedInterface(): Argument #1 ($param) must be of type ?RealInterface, stdClass given, called in %s:%d Stack trace: #0 %s(26): loadedInterface(Object(stdClass)) #1 {main} -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 +TypeError: unloadedClass(): Argument #1 ($param) must be of type ?I\Dont\Exist, int given, called in %s:%d Stack trace: #0 %s(32): unloadedClass(1) #1 {main} -TypeError: loadedClass() expects argument #1 ($param) to be of type ?RealClass, int given, called in %s on line %d and defined in %s:%d +TypeError: loadedClass(): Argument #1 ($param) must be of type ?RealClass, int given, called in %s:%d Stack trace: #0 %s(38): loadedClass(1) #1 {main} -TypeError: loadedInterface() expects argument #1 ($param) to be of type ?RealInterface, int given, called in %s on line %d and defined in %s:%d +TypeError: loadedInterface(): Argument #1 ($param) must be of type ?RealInterface, int given, called in %s:%d Stack trace: #0 %s(44): loadedInterface(1) #1 {main} -TypeError: callableF() expects argument #1 ($param) to be of type ?callable, int given, called in %s on line %d and defined in %s:%d +TypeError: callableF(): Argument #1 ($param) must be of type ?callable, int given, called in %s:%d Stack trace: #0 %s(52): callableF(1) #1 {main} -TypeError: iterableF() expects argument #1 ($param) to be of type ?iterable, int given, called in %s on line %d and defined in %s:%d +TypeError: iterableF(): Argument #1 ($param) must be of type ?iterable, int given, called in %s:%d Stack trace: #0 %s(60): iterableF(1) #1 {main} -TypeError: intF() expects argument #1 ($param) to be of type ?int, object given, called in %s on line %d and defined in %s:%d +TypeError: intF(): Argument #1 ($param) must be of type ?int, object given, called in %s:%d Stack trace: #0 %s(68): intF(Object(stdClass)) #1 {main} diff --git a/Zend/tests/variadic/typehint_error.phpt b/Zend/tests/variadic/typehint_error.phpt index 712e21d3ac..3d92214cf3 100644 --- a/Zend/tests/variadic/typehint_error.phpt +++ b/Zend/tests/variadic/typehint_error.phpt @@ -33,7 +33,7 @@ array(3) { } } -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 +Fatal error: Uncaught TypeError: test(): Argument #3 ($args) must be of type array, int given, called in %s:%d Stack trace: #0 %s(%d): test(Array, Array, 2) #1 {main} diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt index d1168f4025..8bec0389f8 100644 --- a/Zend/tests/variadic/typehint_suppressed_error.phpt +++ b/Zend/tests/variadic/typehint_suppressed_error.phpt @@ -15,4 +15,4 @@ try { ?> --EXPECTF-- -string(%d) "test() expects argument #3 ($args) to be of type array, int given, called in %s on line %d" +string(%d) "test(): Argument #3 ($args) must be of type array, int given, called in %s on line %d" diff --git a/Zend/zend_API.c b/Zend/zend_API.c index a739303cf3..74afc47474 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -216,7 +216,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z return; } - zend_argument_type_error(num, "to be %s, %s given", expected_error[expected_type], zend_zval_type_name(arg)); + zend_argument_type_error(num, "must be %s, %s given", expected_error[expected_type], zend_zval_type_name(arg)); } /* }}} */ @@ -226,7 +226,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, return; } - zend_argument_type_error(num, "to be of type %s, %s given", name, zend_zval_type_name(arg)); + zend_argument_type_error(num, "must be of type %s, %s given", name, zend_zval_type_name(arg)); } /* }}} */ @@ -236,7 +236,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_callback_error(int num, char *e return; } - zend_argument_type_error(num, "to be a valid callback, %s", error); + zend_argument_type_error(num, "must be a valid callback, %s", error); efree(error); } /* }}} */ @@ -259,9 +259,10 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_argument_error(zend_class_entry *erro 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 + zend_throw_error(error_ce, "%s%s%s(): 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); } @@ -283,13 +284,13 @@ ZEND_API int ZEND_FASTCALL zend_parse_arg_class(zval *arg, zend_class_entry **pc *pce = zend_lookup_class(Z_STR_P(arg)); if (ce_base) { if ((!*pce || !instanceof_function(*pce, ce_base))) { - zend_argument_type_error(num, "to be a class name derived from %s, '%s' given", ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg)); + zend_argument_type_error(num, "must be a class name derived from %s, '%s' given", ZSTR_VAL(ce_base->name), Z_STRVAL_P(arg)); *pce = NULL; return 0; } } if (!*pce) { - zend_argument_type_error(num, "to be a valid class name, '%s' given", Z_STRVAL_P(arg)); + zend_argument_type_error(num, "must be a valid class name, '%s' given", Z_STRVAL_P(arg)); return 0; } return 1; @@ -745,10 +746,10 @@ static int zend_parse_arg(int arg_num, zval *arg, va_list *va, const char **spec } if (!(flags & ZEND_PARSE_PARAMS_QUIET) && (*expected_type || error)) { if (error) { - zend_argument_type_error(arg_num, "to be %s", error); + zend_argument_type_error(arg_num, "must be %s", error); efree(error); } else { - zend_argument_type_error(arg_num, "to be of type %s, %s given", expected_type, zend_zval_type_name(arg)); + zend_argument_type_error(arg_num, "must be of type %s, %s given", expected_type, zend_zval_type_name(arg)); } } else if (error) { efree(error); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 96a6b21ae2..66cf80d64b 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -1388,7 +1388,7 @@ ZEND_FUNCTION(set_error_handler) if (Z_TYPE_P(error_handler) != IS_NULL) { /* NULL == unset */ if (!zend_is_callable(error_handler, 0, NULL)) { zend_string *error_handler_name = zend_get_callable_name(error_handler); - zend_error(E_WARNING, "%s() expects argument #1 ($error_handler) to be a valid callback", get_active_function_name()); + zend_error(E_WARNING, "%s(): Argument #1 ($error_handler) must be a valid callback", get_active_function_name()); zend_string_release_ex(error_handler_name, 0); return; } @@ -1452,7 +1452,7 @@ ZEND_FUNCTION(set_exception_handler) if (Z_TYPE_P(exception_handler) != IS_NULL) { /* NULL == unset */ if (!zend_is_callable(exception_handler, 0, NULL)) { zend_string *exception_handler_name = zend_get_callable_name(exception_handler); - zend_error(E_WARNING, "%s() expects argument #1 ($exception_handler) to be a valid callback", get_active_function_name()); + zend_error(E_WARNING, "%s(): Argument #1 ($exception_handler) must be a valid callback", get_active_function_name()); zend_string_release_ex(exception_handler_name, 0); return; } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index b851439e39..f550614130 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -692,16 +692,21 @@ ZEND_API ZEND_COLD void zend_verify_arg_error( if (zf->common.type == ZEND_USER_FUNCTION) { if (ptr && ptr->func && ZEND_USER_CODE(ptr->func->common.type)) { - zend_type_error("%s%s%s() expects argument #%d ($%s) to be of type %s, %s given, called in %s on line %d", - 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); + zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given, called in %s on line %d", + 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 + ); } else { - 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); + zend_type_error("%s%s%s(): Argument #%d ($%s) must be of type %s, %s given", + fclass, fsep, fname, arg_num, ZSTR_VAL(arg_info->name), ZSTR_VAL(need_msg), given_msg + ); } } else { - 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_type_error("%s%s%s(): Argument #%d ($%s) must 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); @@ -1925,7 +1930,7 @@ static zend_never_inline ZEND_COLD void ZEND_FASTCALL zend_param_must_be_ref(con { const char *arg_name = get_function_arg_name(func, arg_num); - zend_error(E_WARNING, "%s%s%s() expects argument #%d%s%s%s to be passed by reference, value given", + zend_error(E_WARNING, "%s%s%s(): Argument #%d%s%s%s must be passed by reference, value given", func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? "::" : "", ZSTR_VAL(func->common.function_name), @@ -2550,8 +2555,9 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( ZVAL_UNDEFINED_OP2(); } if (!EG(exception)) { - 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_type_error("array_key_exists(): Argument #2 ($array) must be of type array, %s given", + zend_get_type_by_const(Z_TYPE_P(subject)) + ); } } diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 80d0cf26ee..514c40ec1b 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -751,7 +751,7 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache) / const char *arg_name = get_function_arg_name(func, i + 1); zend_error(E_WARNING, - "%s%s%s() expects argument #%d%s%s%s to be passed by reference, value given", + "%s%s%s(): Argument #%d%s%s%s must be passed by reference, value given", func->common.scope ? ZSTR_VAL(func->common.scope->name) : "", func->common.scope ? "::" : "", ZSTR_VAL(func->common.function_name), diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 7f0de717a4..bf5a156389 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -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); } } else { - zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); FREE_OP2(); HANDLE_EXCEPTION(); @@ -4938,7 +4938,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM) ZEND_VM_C_GOTO(send_array); } } - 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))); + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_get_type_by_const(Z_TYPE_P(args))); FREE_UNFETCHED_OP2(); FREE_OP1(); HANDLE_EXCEPTION(); @@ -7909,7 +7909,7 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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)) { ZVAL_UNDEFINED_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))); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index c9bb201131..c87df4e871 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1981,7 +1981,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_SEND_ARRAY_SPEC_HANDLER(ZEND_O goto send_array; } } - 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))); + zend_type_error("call_user_func_array(): Argument #2 ($args) must 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_OP(opline->op1_type, opline->op1.var); HANDLE_EXCEPTION(); @@ -4464,7 +4464,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CONST zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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); } } else { - zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); 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); } } else { - zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); zval_ptr_dtor_nogc(EX_VAR(opline->op2.var)); 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)) { ZVAL_UNDEFINED_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))); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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); } } else { - zend_type_error("%s() expects argument #1 ($function) to be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); + zend_type_error("%s(): Argument #1 ($function) must be a valid callback, %s", Z_STRVAL_P(RT_CONSTANT(opline, opline->op1)), error); efree(error); HANDLE_EXCEPTION(); @@ -13305,7 +13305,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_TMPVAR_HANDLER(ZEN zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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)) { ZVAL_UNDEFINED_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))); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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)) { ZVAL_UNDEFINED_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))); + zend_type_error("Argument 1 ($object) passed to get_class() must be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -36702,7 +36702,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_STRLEN_SPEC_CV_HANDLER(ZEND_OP zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen() expects argument #1 ($str) to be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_get_type_by_const(Z_TYPE_P(value))); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } 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)) { ZVAL_UNDEFINED_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))); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_get_type_by_const(Z_TYPE_P(op1))); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; |