From 0d1191469e2497b0eca88404abcb87e1d5cc168b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 25 May 2020 19:28:15 +0200 Subject: [PATCH 1/3] Improve type error messages when an object is given Additionally, make the format of return type errors match the format of argument errors. --- Zend/tests/bug26166.phpt | 2 +- Zend/tests/ns_071.phpt | 2 +- .../object_types/return_type_in_class.phpt | 2 +- .../object_types/return_type_in_function.phpt | 2 +- .../return_type_inheritance_in_class.phpt | 2 +- .../return_type_inheritance_in_interface.phpt | 2 +- Zend/tests/return_types/001.phpt | 2 +- Zend/tests/return_types/002.phpt | 2 +- Zend/tests/return_types/003.phpt | 2 +- Zend/tests/return_types/004.phpt | 2 +- Zend/tests/return_types/005.phpt | 2 +- Zend/tests/return_types/010.phpt | 2 +- Zend/tests/return_types/013.phpt | 2 +- Zend/tests/return_types/028.phpt | 2 +- Zend/tests/return_types/029.phpt | 2 +- Zend/tests/return_types/030.phpt | 2 +- Zend/tests/return_types/bug70557.phpt | 2 +- Zend/tests/return_types/bug71092.phpt | 2 +- .../return_types/internal_functions001.phpt | 4 +- Zend/tests/return_types/rfc001.phpt | 2 +- Zend/tests/return_types/rfc003.phpt | 2 +- Zend/tests/trait_type_errors.phpt | 2 +- .../tests/type_declarations/iterable_003.phpt | 2 +- .../validation/mixed_return_strict_error.phpt | 5 +- .../validation/mixed_return_weak_error.phpt | 2 +- .../tests/type_declarations/scalar_basic.phpt | 14 +++--- .../scalar_return_basic.phpt | 48 +++++++++---------- .../scalar_return_basic_64bit.phpt | 48 +++++++++---------- .../scalar_strict_64bit.phpt | 16 +++---- .../scalar_strict_basic.phpt | 8 ++-- .../type_declarations/static_type_return.phpt | 6 +-- .../type_declarations/static_type_trait.phpt | 2 +- .../union_types/type_checking_strict.phpt | 36 +++++++------- .../union_types/type_checking_weak.phpt | 30 ++++++------ Zend/tests/typehints/or_null.phpt | 32 ++++++------- Zend/zend_execute.c | 8 ++-- .../tests/iterable_type_optimization.phpt | 2 +- ext/opcache/tests/ssa_bug_003.phpt | 8 ++-- tests/classes/tostring_001.phpt | 2 +- tests/classes/tostring_004.phpt | 4 +- 40 files changed, 158 insertions(+), 161 deletions(-) diff --git a/Zend/tests/bug26166.phpt b/Zend/tests/bug26166.phpt index 4a5a30f5b298..3e5c6daa21d4 100644 --- a/Zend/tests/bug26166.phpt +++ b/Zend/tests/bug26166.phpt @@ -64,6 +64,6 @@ try { --EXPECT-- Hello World! ===NONE=== -Return value of NoneTest::__toString() must be of type string, none returned +NoneTest::__toString(): Return value must be of type string, none returned ===THROW=== This is an error! diff --git a/Zend/tests/ns_071.phpt b/Zend/tests/ns_071.phpt index b0126e399fae..18e5a745d56e 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(): Argument #1 ($x) must be of type ?array, object given, called in %s:%d +Fatal error: Uncaught TypeError: foo\bar::__construct(): Argument #1 ($x) must be of type ?array, 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/return_type_in_class.phpt b/Zend/tests/object_types/return_type_in_class.phpt index 44e3fbf871ee..f2a628829864 100644 --- a/Zend/tests/object_types/return_type_in_class.phpt +++ b/Zend/tests/object_types/return_type_in_class.phpt @@ -18,7 +18,7 @@ $three = new class extends Two { }; $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d +Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d Stack trace: #0 %s(%d): Two@anonymous->a() #1 {main} diff --git a/Zend/tests/object_types/return_type_in_function.phpt b/Zend/tests/object_types/return_type_in_function.phpt index 1c60759bb3ae..b94541c8d7cd 100644 --- a/Zend/tests/object_types/return_type_in_function.phpt +++ b/Zend/tests/object_types/return_type_in_function.phpt @@ -8,7 +8,7 @@ function a() : object { } a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of a() must be of type object, int returned in %s:4 +Fatal error: Uncaught TypeError: a(): Return value must be of type object, int returned in %s:%d Stack trace: #0 %s(6): a() #1 {main} diff --git a/Zend/tests/object_types/return_type_inheritance_in_class.phpt b/Zend/tests/object_types/return_type_inheritance_in_class.phpt index 21dec61e3055..564a9d311dad 100644 --- a/Zend/tests/object_types/return_type_inheritance_in_class.phpt +++ b/Zend/tests/object_types/return_type_inheritance_in_class.phpt @@ -18,7 +18,7 @@ $three = new class extends Two { }; $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d +Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d Stack trace: #0 %s(%d): Two@anonymous->a() #1 {main} diff --git a/Zend/tests/object_types/return_type_inheritance_in_interface.phpt b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt index b1af6789113b..2e112c4cb6f2 100644 --- a/Zend/tests/object_types/return_type_inheritance_in_interface.phpt +++ b/Zend/tests/object_types/return_type_inheritance_in_interface.phpt @@ -18,7 +18,7 @@ $three = new class implements Two { }; $three->a(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of Two@anonymous::a() must be of type object, int returned in %s:%d +Fatal error: Uncaught TypeError: Two@anonymous::a(): Return value must be of type object, int returned in %s:%d Stack trace: #0 %s(%d): Two@anonymous->a() #1 {main} diff --git a/Zend/tests/return_types/001.phpt b/Zend/tests/return_types/001.phpt index fc2bc326a988..f726f0cd7e2e 100644 --- a/Zend/tests/return_types/001.phpt +++ b/Zend/tests/return_types/001.phpt @@ -7,7 +7,7 @@ function test1() : array { test1(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test1() must be of type array, none returned in %s:%d +Fatal error: Uncaught TypeError: test1(): Return value must be of type array, none returned in %s:%d Stack trace: #0 %s(%d): test1() #1 {main} diff --git a/Zend/tests/return_types/002.phpt b/Zend/tests/return_types/002.phpt index 07101ca760ee..ad88cf12568a 100644 --- a/Zend/tests/return_types/002.phpt +++ b/Zend/tests/return_types/002.phpt @@ -8,7 +8,7 @@ function test1() : array { test1(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test1() must be of type array, null returned in %s:%d +Fatal error: Uncaught TypeError: test1(): Return value must be of type array, null returned in %s:%d Stack trace: #0 %s(%d): test1() #1 {main} diff --git a/Zend/tests/return_types/003.phpt b/Zend/tests/return_types/003.phpt index 5d60da25ed12..c2f466cd0119 100644 --- a/Zend/tests/return_types/003.phpt +++ b/Zend/tests/return_types/003.phpt @@ -7,7 +7,7 @@ function test1() : array { } test1(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test1() must be of type array, int returned in %s:%d +Fatal error: Uncaught TypeError: test1(): Return value must be of type array, int returned in %s:%d Stack trace: #0 %s(%d): test1() #1 {main} diff --git a/Zend/tests/return_types/004.phpt b/Zend/tests/return_types/004.phpt index eae7018dedb4..3d2fdda0d9fd 100644 --- a/Zend/tests/return_types/004.phpt +++ b/Zend/tests/return_types/004.phpt @@ -8,7 +8,7 @@ function test1() : array { test1(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test1() must be of type array, string returned in %s:%d +Fatal error: Uncaught TypeError: test1(): Return value must be of type array, string returned in %s:%d Stack trace: #0 %s(%d): test1() #1 {main} diff --git a/Zend/tests/return_types/005.phpt b/Zend/tests/return_types/005.phpt index 6313ae69ce24..31d5ca8b9ab8 100644 --- a/Zend/tests/return_types/005.phpt +++ b/Zend/tests/return_types/005.phpt @@ -13,7 +13,7 @@ class qux { $qux = new qux(); $qux->foo(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of qux::foo() must be of type foo, qux returned in %s:%d +Fatal error: Uncaught TypeError: qux::foo(): Return value must be of type foo, qux returned in %s:%d Stack trace: #0 %s(%d): qux->foo() #1 {main} diff --git a/Zend/tests/return_types/010.phpt b/Zend/tests/return_types/010.phpt index 6ff9d7f25c0e..763c8664ee54 100644 --- a/Zend/tests/return_types/010.phpt +++ b/Zend/tests/return_types/010.phpt @@ -9,7 +9,7 @@ function &foo(array &$in) : array { $array = [1, 2, 3]; var_dump(foo($array)); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of foo() must be of type array, null returned in %s:%d +Fatal error: Uncaught TypeError: foo(): Return value must be of type array, null returned in %s:%d Stack trace: #0 %s(%d): foo(Array) #1 {main} diff --git a/Zend/tests/return_types/013.phpt b/Zend/tests/return_types/013.phpt index 1cbdd6184f46..e7cea22accfb 100644 --- a/Zend/tests/return_types/013.phpt +++ b/Zend/tests/return_types/013.phpt @@ -14,7 +14,7 @@ class foo { $baz = new foo(); var_dump($func=$baz->bar(), $func()); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of foo::{closure}() must be of type array, null returned in %s:%d +Fatal error: Uncaught TypeError: foo::{closure}(): Return value must be of type array, null returned in %s:%d Stack trace: #0 %s(%d): foo->{closure}() #1 {main} diff --git a/Zend/tests/return_types/028.phpt b/Zend/tests/return_types/028.phpt index d50b09c3f6bf..802dd7708dfe 100644 --- a/Zend/tests/return_types/028.phpt +++ b/Zend/tests/return_types/028.phpt @@ -17,4 +17,4 @@ try { ?> --EXPECTF-- -Return value of foo() must be of type stdClass, array returned in %s on line %d +foo(): Return value must be of type stdClass, array returned in %s on line %d diff --git a/Zend/tests/return_types/029.phpt b/Zend/tests/return_types/029.phpt index 0e25dea5593c..1d17b5d770ec 100644 --- a/Zend/tests/return_types/029.phpt +++ b/Zend/tests/return_types/029.phpt @@ -21,7 +21,7 @@ Stack trace: #0 %s(%d): foo() #1 {main} -Next TypeError: Return value of foo() must be of type array, null returned in %s29.php:%d +Next TypeError: foo(): Return value must be of type array, null returned in %s:%d Stack trace: #0 %s(%d): foo() #1 {main} diff --git a/Zend/tests/return_types/030.phpt b/Zend/tests/return_types/030.phpt index 907d47d66aba..2f4cb696d5d5 100644 --- a/Zend/tests/return_types/030.phpt +++ b/Zend/tests/return_types/030.phpt @@ -16,7 +16,7 @@ foo(0); ok ok -Fatal error: Uncaught TypeError: Return value of foo() must be of type ?array, int returned in %s030.php:3 +Fatal error: Uncaught TypeError: foo(): Return value must be of type ?array, int returned in %s:%d Stack trace: #0 %s030.php(10): foo(0) #1 {main} diff --git a/Zend/tests/return_types/bug70557.phpt b/Zend/tests/return_types/bug70557.phpt index af8b92fb6225..60da2d526366 100644 --- a/Zend/tests/return_types/bug70557.phpt +++ b/Zend/tests/return_types/bug70557.phpt @@ -16,4 +16,4 @@ try { } ?> --EXPECT-- -string(64) "Return value of getNumber() must be of type int, string returned" +string(62) "getNumber(): Return value must be of type int, string returned" diff --git a/Zend/tests/return_types/bug71092.phpt b/Zend/tests/return_types/bug71092.phpt index ed9a082349d1..e7ca36f475fd 100644 --- a/Zend/tests/return_types/bug71092.phpt +++ b/Zend/tests/return_types/bug71092.phpt @@ -16,7 +16,7 @@ function boom(): array { boom(); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of boom() must be of type array, null returned in %sbug71092.php:%d +Fatal error: Uncaught TypeError: boom(): Return value must be of type array, null returned in %s:%d Stack trace: #0 %s(%d): boom() #1 {main} diff --git a/Zend/tests/return_types/internal_functions001.phpt b/Zend/tests/return_types/internal_functions001.phpt index 14a60c83b492..ebed8515e56d 100644 --- a/Zend/tests/return_types/internal_functions001.phpt +++ b/Zend/tests/return_types/internal_functions001.phpt @@ -10,5 +10,5 @@ if (!PHP_DEBUG) die('skip requires debug build'); ---EXPECTF-- -Fatal error: Return value of zend_test_array_return() must be of type array, null returned in %s on line %d +--EXPECT-- +Fatal error: zend_test_array_return(): Return value must be of type array, null returned in Unknown on line 0 diff --git a/Zend/tests/return_types/rfc001.phpt b/Zend/tests/return_types/rfc001.phpt index cbe2335afb28..f9cdbec2b761 100644 --- a/Zend/tests/return_types/rfc001.phpt +++ b/Zend/tests/return_types/rfc001.phpt @@ -9,7 +9,7 @@ function get_config(): array { get_config(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of get_config() must be of type array, int returned in %s:%d +Fatal error: Uncaught TypeError: get_config(): Return value must be of type array, int returned in %s:%d Stack trace: #0 %s(%d): get_config() #1 {main} diff --git a/Zend/tests/return_types/rfc003.phpt b/Zend/tests/return_types/rfc003.phpt index 76a77c07c493..461d80b7fe83 100644 --- a/Zend/tests/return_types/rfc003.phpt +++ b/Zend/tests/return_types/rfc003.phpt @@ -8,7 +8,7 @@ function foo(): DateTime { foo(); --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of foo() must be of type DateTime, null returned in %s:%d +Fatal error: Uncaught TypeError: foo(): Return value must be of type DateTime, null returned in %s:%d Stack trace: #0 %s(%d): foo() #1 {main} diff --git a/Zend/tests/trait_type_errors.phpt b/Zend/tests/trait_type_errors.phpt index 2f5069a4331f..d3c7c0582fb1 100644 --- a/Zend/tests/trait_type_errors.phpt +++ b/Zend/tests/trait_type_errors.phpt @@ -38,6 +38,6 @@ try { ?> --EXPECTF-- -Return value of C::test1() must be of type int, string returned +C::test1(): Return value must be of type int, string returned 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/iterable_003.phpt b/Zend/tests/type_declarations/iterable_003.phpt index eda77d490b64..d2a3bcb368cf 100644 --- a/Zend/tests/type_declarations/iterable_003.phpt +++ b/Zend/tests/type_declarations/iterable_003.phpt @@ -29,4 +29,4 @@ array(0) { } object(Generator)#2 (0) { } -Return value of baz() must be of type iterable, int returned +baz(): Return value must be of type iterable, int returned diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt index ded74b046791..2bd775af0a47 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt @@ -15,6 +15,5 @@ try { } ?> ---EXPECTF-- -Return value of foo() must be of type mixed, none returned - +--EXPECT-- +foo(): Return value must be of type mixed, none returned diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt index 316f465877aa..52bd99beb6cd 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt @@ -15,4 +15,4 @@ try { ?> --EXPECT-- -Return value of foo() must be of type mixed, none returned +foo(): Return value must be of type mixed, none returned diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt index c3f06c5bbde8..002cab6042ae 100644 --- a/Zend/tests/type_declarations/scalar_basic.phpt +++ b/Zend/tests/type_declarations/scalar_basic.phpt @@ -104,11 +104,11 @@ int(0) *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%s (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) *** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d @@ -158,11 +158,11 @@ float(0) *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%s (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) *** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d @@ -211,7 +211,7 @@ string(0) "" *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%s (0) { } @@ -264,11 +264,11 @@ bool(false) *** Trying object(stdClass)#%s (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%s (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) *** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_return_basic.phpt b/Zend/tests/type_declarations/scalar_return_basic.phpt index c0b0df682967..8e353a043b10 100644 --- a/Zend/tests/type_declarations/scalar_return_basic.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic.phpt @@ -75,30 +75,30 @@ int(1) E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of type int, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of type int, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, string returned in %s on line %d *** Trying int(2147483647) int(2147483647) *** Trying float(NAN) -*** Caught Return value of {closure}() must be of type int, float returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, float returned in %s on line %d *** Trying bool(true) int(1) *** Trying bool(false) int(0) *** Trying NULL -*** Caught Return value of {closure}() must be of type int, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type int, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, object returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type int, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, resource returned in %s on line %d Testing 'float' type: *** Trying int(1) @@ -113,9 +113,9 @@ float(1.5) E_NOTICE: A non well formed numeric value encountered on line %d float(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of type float, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of type float, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, string returned in %s on line %d *** Trying int(2147483647) float(2147483647) *** Trying float(NAN) @@ -125,18 +125,18 @@ float(1) *** Trying bool(false) float(0) *** Trying NULL -*** Caught Return value of {closure}() must be of type float, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type float, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, object returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type float, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, resource returned in %s on line %d Testing 'string' type: *** Trying int(1) @@ -162,18 +162,18 @@ string(1) "1" *** Trying bool(false) string(0) "" *** Trying NULL -*** Caught Return value of {closure}() must be of type string, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type string, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type string, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, object returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } string(6) "foobar" *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type string, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, resource returned in %s on line %d Testing 'bool' type: *** Trying int(1) @@ -199,17 +199,17 @@ bool(true) *** Trying bool(false) bool(false) *** Trying NULL -*** Caught Return value of {closure}() must be of type bool, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type bool, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, object returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, object returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type bool, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, resource returned in %s on line %d Done diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt index 5e387c45c8f2..0fbccb1b6909 100644 --- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt @@ -75,30 +75,30 @@ int(1) E_NOTICE: A non well formed numeric value encountered on line %d int(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of type int, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of type int, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, string returned in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught Return value of {closure}() must be of type int, float returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, float returned in %s on line %d *** Trying bool(true) int(1) *** Trying bool(false) int(0) *** Trying NULL -*** Caught Return value of {closure}() must be of type int, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type int, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type int, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, resource returned in %s on line %d Testing 'float' type: *** Trying int(1) @@ -113,9 +113,9 @@ float(1.5) E_NOTICE: A non well formed numeric value encountered on line %d float(1) *** Trying string(1) "a" -*** Caught Return value of {closure}() must be of type float, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, string returned in %s on line %d *** Trying string(0) "" -*** Caught Return value of {closure}() must be of type float, string returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, string returned in %s on line %d *** Trying int(9223372036854775807) float(9.223372036854776E+18) *** Trying float(NAN) @@ -125,18 +125,18 @@ float(1) *** Trying bool(false) float(0) *** Trying NULL -*** Caught Return value of {closure}() must be of type float, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type float, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type float, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, resource returned in %s on line %d Testing 'string' type: *** Trying int(1) @@ -162,18 +162,18 @@ string(1) "1" *** Trying bool(false) string(0) "" *** Trying NULL -*** Caught Return value of {closure}() must be of type string, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type string, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type string, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } string(6) "foobar" *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type string, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, resource returned in %s on line %d Testing 'bool' type: *** Trying int(1) @@ -199,17 +199,17 @@ bool(true) *** Trying bool(false) bool(false) *** Trying NULL -*** Caught Return value of {closure}() must be of type bool, null returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, null returned in %s on line %d *** Trying array(0) { } -*** Caught Return value of {closure}() must be of type bool, array returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught Return value of {closure}() must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) -*** Caught Return value of {closure}() must be of type bool, resource returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, resource returned 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 6f8504c16c63..4705fa81dbd7 100644 --- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt @@ -98,11 +98,11 @@ int(9223372036854775807) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d @@ -151,11 +151,11 @@ float(NAN) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d @@ -204,11 +204,11 @@ string(0) "" *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d @@ -257,11 +257,11 @@ bool(false) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt index cb385422bdb0..f02649b8b55f 100644 --- a/Zend/tests/type_declarations/scalar_strict_basic.phpt +++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt @@ -75,7 +75,7 @@ int(1) *** Caught {closure}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object value -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying resource value *** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d @@ -104,7 +104,7 @@ float(1) *** Caught {closure}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object value -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying resource value *** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d @@ -133,7 +133,7 @@ string(1) "1" *** Caught {closure}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object value -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying resource value *** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d @@ -162,7 +162,7 @@ bool(false) *** Caught {closure}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object value -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying resource value *** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d diff --git a/Zend/tests/type_declarations/static_type_return.phpt b/Zend/tests/type_declarations/static_type_return.phpt index a5c8921e0a65..820f4b0d6f07 100644 --- a/Zend/tests/type_declarations/static_type_return.phpt +++ b/Zend/tests/type_declarations/static_type_return.phpt @@ -75,7 +75,7 @@ object(B)#3 (0) { object(A)#3 (0) { } -Return value of A::test2() must be of type B, A returned +A::test2(): Return value must be of type B, A returned object(A)#3 (0) { } @@ -84,8 +84,8 @@ object(C)#3 (0) { object(A)#3 (0) { } -Return value of A::test4() must be of type B|array, A returned +A::test4(): Return value must be of type B|array, A returned -Return value of {closure}() must be of type static, stdClass returned +{closure}(): Return value must be of type static, stdClass returned object(A)#1 (0) { } diff --git a/Zend/tests/type_declarations/static_type_trait.phpt b/Zend/tests/type_declarations/static_type_trait.phpt index 41f861643b66..25ebe4d236b7 100644 --- a/Zend/tests/type_declarations/static_type_trait.phpt +++ b/Zend/tests/type_declarations/static_type_trait.phpt @@ -31,7 +31,7 @@ object(P)#2 (0) { object(P)#2 (0) { } -Fatal error: Uncaught TypeError: Return value of C::test() must be of type P, C returned in %s:%d +Fatal error: Uncaught TypeError: C::test(): Return value must be of type P, C returned in %s:%d Stack trace: #0 %s(%d): C->test(Object(C)) #1 {main} 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 4887b3b7967a..bfb02196f1f9 100644 --- a/Zend/tests/type_declarations/union_types/type_checking_strict.phpt +++ b/Zend/tests/type_declarations/union_types/type_checking_strict.phpt @@ -79,8 +79,8 @@ 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 +new stdClass => Argument ... must be of type int|float, stdClass given +new WithToString => Argument ... must be of type int|float, WithToString given Type int|float|false: 42 => 42 @@ -95,8 +95,8 @@ true => Argument ... must be of type int|float|false, bool given false => false 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 +new stdClass => Argument ... must be of type int|float|false, stdClass given +new WithToString => Argument ... must be of type int|float|false, WithToString given Type int|float|bool: 42 => 42 @@ -111,8 +111,8 @@ true => true false => false 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 +new stdClass => Argument ... must be of type int|float|bool, stdClass given +new WithToString => Argument ... must be of type int|float|bool, WithToString given Type int|bool: 42 => 42 @@ -127,8 +127,8 @@ true => true false => false 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 +new stdClass => Argument ... must be of type int|bool, stdClass given +new WithToString => Argument ... must be of type int|bool, WithToString given Type int|string|null: 42 => 42 @@ -143,8 +143,8 @@ 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 ... 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 +new stdClass => Argument ... must be of type string|int|null, stdClass given +new WithToString => Argument ... must be of type string|int|null, WithToString given Type string|bool: 42 => Argument ... must be of type string|bool, int given @@ -159,8 +159,8 @@ true => true false => false 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 +new stdClass => Argument ... must be of type string|bool, stdClass given +new WithToString => Argument ... must be of type string|bool, WithToString given Type float|array: 42 => 42.0 @@ -175,8 +175,8 @@ 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 ... must be of type array|float, object given -new WithToString => Argument ... must be of type array|float, object given +new stdClass => Argument ... must be of type array|float, stdClass given +new WithToString => Argument ... must be of type array|float, WithToString given Type string|array: 42 => Argument ... must be of type array|string, int given @@ -191,8 +191,8 @@ 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 ... must be of type array|string, object given -new WithToString => Argument ... must be of type array|string, object given +new stdClass => Argument ... must be of type array|string, stdClass given +new WithToString => Argument ... must be of type array|string, WithToString given Type bool|array: 42 => Argument ... must be of type array|bool, int given @@ -207,5 +207,5 @@ true => true false => false null => Argument ... must be of type array|bool, null given [] => [] -new stdClass => Argument ... must be of type array|bool, object given -new WithToString => Argument ... must be of type array|bool, object given +new stdClass => Argument ... must be of type array|bool, stdClass given +new WithToString => Argument ... must be of type array|bool, WithToString 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 1b9fa4b316eb..2b1e7397fbfa 100644 --- a/Zend/tests/type_declarations/union_types/type_checking_weak.phpt +++ b/Zend/tests/type_declarations/union_types/type_checking_weak.phpt @@ -77,8 +77,8 @@ true => 1 false => 0 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 +new stdClass => Argument ... must be of type int|float, stdClass given +new WithToString => Argument ... must be of type int|float, WithToString given Type int|float|false: 42 => 42 @@ -93,8 +93,8 @@ true => 1 false => false 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 +new stdClass => Argument ... must be of type int|float|false, stdClass given +new WithToString => Argument ... must be of type int|float|false, WithToString given Type int|float|bool: 42 => 42 @@ -109,8 +109,8 @@ true => true false => false 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 +new stdClass => Argument ... must be of type int|float|bool, stdClass given +new WithToString => Argument ... must be of type int|float|bool, WithToString given Type int|bool: 42 => 42 @@ -125,8 +125,8 @@ true => true false => false 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 +new stdClass => Argument ... must be of type int|bool, stdClass given +new WithToString => Argument ... must be of type int|bool, WithToString given Type int|string|null: 42 => 42 @@ -141,7 +141,7 @@ true => 1 false => 0 null => null [] => Argument ... must be of type string|int|null, array given -new stdClass => Argument ... must be of type string|int|null, object given +new stdClass => Argument ... must be of type string|int|null, stdClass given new WithToString => "__toString()" Type string|bool: @@ -157,7 +157,7 @@ true => true false => false 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 stdClass => Argument ... must be of type string|bool, stdClass given new WithToString => "__toString()" Type float|array: @@ -173,8 +173,8 @@ true => 1.0 false => 0.0 null => Argument ... must be of type array|float, null given [] => [] -new stdClass => Argument ... must be of type array|float, object given -new WithToString => Argument ... must be of type array|float, object given +new stdClass => Argument ... must be of type array|float, stdClass given +new WithToString => Argument ... must be of type array|float, WithToString given Type string|array: 42 => "42" @@ -189,7 +189,7 @@ true => "1" false => "" null => Argument ... must be of type array|string, null given [] => [] -new stdClass => Argument ... must be of type array|string, object given +new stdClass => Argument ... must be of type array|string, stdClass given new WithToString => "__toString()" Type bool|array: @@ -205,5 +205,5 @@ true => true false => false null => Argument ... must be of type array|bool, null given [] => [] -new stdClass => Argument ... must be of type array|bool, object given -new WithToString => Argument ... must be of type array|bool, object given +new stdClass => Argument ... must be of type array|bool, stdClass given +new WithToString => Argument ... must be of type array|bool, WithToString given diff --git a/Zend/tests/typehints/or_null.phpt b/Zend/tests/typehints/or_null.phpt index 2d0683edbbc1..d7a2e2300269 100644 --- a/Zend/tests/typehints/or_null.phpt +++ b/Zend/tests/typehints/or_null.phpt @@ -251,67 +251,67 @@ TypeError: iterableF(): Argument #1 ($param) must be of type ?iterable, int give Stack trace: #0 %s(60): iterableF(1) #1 {main} -TypeError: intF(): Argument #1 ($param) must be of type ?int, object given, called in %s:%d +TypeError: intF(): Argument #1 ($param) must be of type ?int, stdClass given, called in %s:%d Stack trace: #0 %s(68): intF(Object(stdClass)) #1 {main} -TypeError: Return value of returnUnloadedClass() must be of type ?I\Dont\Exist, stdClass returned in %s:74 +TypeError: returnUnloadedClass(): Return value must be of type ?I\Dont\Exist, stdClass returned in %s:%d Stack trace: #0 %s(78): returnUnloadedClass() #1 {main} -TypeError: Return value of returnLoadedClass() must be of type ?RealClass, stdClass returned in %s:84 +TypeError: returnLoadedClass(): Return value must be of type ?RealClass, stdClass returned in %s:%d Stack trace: #0 %s(88): returnLoadedClass() #1 {main} -TypeError: Return value of returnLoadedInterface() must be of type ?RealInterface, stdClass returned in %s:94 +TypeError: returnLoadedInterface(): Return value must be of type ?RealInterface, stdClass returned in %s:%d Stack trace: #0 %s(98): returnLoadedInterface() #1 {main} -TypeError: Return value of returnUnloadedClassScalar() must be of type ?I\Dont\Exist, int returned in %s:104 +TypeError: returnUnloadedClassScalar(): Return value must be of type ?I\Dont\Exist, int returned in %s:%d Stack trace: #0 %s(108): returnUnloadedClassScalar() #1 {main} -TypeError: Return value of returnLoadedClassScalar() must be of type ?RealClass, int returned in %s:114 +TypeError: returnLoadedClassScalar(): Return value must be of type ?RealClass, int returned in %s:%d Stack trace: #0 %s(118): returnLoadedClassScalar() #1 {main} -TypeError: Return value of returnLoadedInterfaceScalar() must be of type ?RealInterface, int returned in %s:124 +TypeError: returnLoadedInterfaceScalar(): Return value must be of type ?RealInterface, int returned in %s:%d Stack trace: #0 %s(128): returnLoadedInterfaceScalar() #1 {main} -TypeError: Return value of returnCallable() must be of type ?callable, int returned in %s:134 +TypeError: returnCallable(): Return value must be of type ?callable, int returned in %s:%d Stack trace: #0 %s(138): returnCallable() #1 {main} -TypeError: Return value of returnIterable() must be of type ?iterable, int returned in %s:144 +TypeError: returnIterable(): Return value must be of type ?iterable, int returned in %s:%d Stack trace: #0 %s(148): returnIterable() #1 {main} -TypeError: Return value of returnInt() must be of type ?int, object returned in %s:154 +TypeError: returnInt(): Return value must be of type ?int, stdClass returned in %s:%d Stack trace: #0 %s(158): returnInt() #1 {main} -TypeError: Return value of returnMissingUnloadedClass() must be of type ?I\Dont\Exist, none returned in %s:164 +TypeError: returnMissingUnloadedClass(): Return value must be of type ?I\Dont\Exist, none returned in %s:%d Stack trace: #0 %s(167): returnMissingUnloadedClass() #1 {main} -TypeError: Return value of returnMissingLoadedClass() must be of type ?RealClass, none returned in %s:173 +TypeError: returnMissingLoadedClass(): Return value must be of type ?RealClass, none returned in %s:%d Stack trace: #0 %s(176): returnMissingLoadedClass() #1 {main} -TypeError: Return value of returnMissingLoadedInterface() must be of type ?RealInterface, none returned in %s:182 +TypeError: returnMissingLoadedInterface(): Return value must be of type ?RealInterface, none returned in %s:%d Stack trace: #0 %s(185): returnMissingLoadedInterface() #1 {main} -TypeError: Return value of returnMissingCallable() must be of type ?callable, none returned in %s:191 +TypeError: returnMissingCallable(): Return value must be of type ?callable, none returned in %s:%d Stack trace: #0 %s(194): returnMissingCallable() #1 {main} -TypeError: Return value of returnMissingIterable() must be of type ?iterable, none returned in %s:200 +TypeError: returnMissingIterable(): Return value must be of type ?iterable, none returned in %s:%d Stack trace: #0 %s(203): returnMissingIterable() #1 {main} -TypeError: Return value of returnMissingInt() must be of type ?int, none returned in %s:209 +TypeError: returnMissingInt(): Return value must be of type ?int, none returned in %s:%d Stack trace: #0 %s(212): returnMissingInt() #1 {main} diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 0a18ab62fab1..0061910b1943 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -663,9 +663,7 @@ static ZEND_COLD void zend_verify_type_error_common( *need_msg = zend_type_to_string_resolved(arg_info->type, zf->common.scope); if (value) { - zend_bool has_class = ZEND_TYPE_HAS_CLASS(arg_info->type) - || (ZEND_TYPE_FULL_MASK(arg_info->type) & MAY_BE_STATIC); - if (has_class && Z_TYPE_P(value) == IS_OBJECT) { + if (Z_TYPE_P(value) == IS_OBJECT) { *given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name); } else { *given_kind = zend_zval_type_name(value); @@ -1187,7 +1185,7 @@ ZEND_API ZEND_COLD void zend_verify_return_error( zf, arg_info, cache_slot, value, &fname, &fsep, &fclass, &need_msg, &given_msg); - zend_type_error("Return value of %s%s%s() must be of type %s, %s returned", + zend_type_error("%s%s%s(): Return value must be of type %s, %s returned", fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg); zend_string_release(need_msg); @@ -1206,7 +1204,7 @@ static ZEND_COLD void zend_verify_internal_return_error( zf, arg_info, cache_slot, value, &fname, &fsep, &fclass, &need_msg, &given_msg); - zend_error_noreturn(E_CORE_ERROR, "Return value of %s%s%s() must be of type %s, %s returned", + zend_error_noreturn(E_CORE_ERROR, "%s%s%s(): Return value must be of type %s, %s returned", fclass, fsep, fname, ZSTR_VAL(need_msg), given_msg); } diff --git a/ext/opcache/tests/iterable_type_optimization.phpt b/ext/opcache/tests/iterable_type_optimization.phpt index 26d9971d37ba..ed836ffd5acd 100644 --- a/ext/opcache/tests/iterable_type_optimization.phpt +++ b/ext/opcache/tests/iterable_type_optimization.phpt @@ -10,7 +10,7 @@ test(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Return value of test() must be of type iterable, object returned in %s:%d +Fatal error: Uncaught TypeError: test(): Return value must be of type iterable, object returned in %s:%d Stack trace: #0 %s(%d): test(Object(stdClass)) #1 {main} diff --git a/ext/opcache/tests/ssa_bug_003.phpt b/ext/opcache/tests/ssa_bug_003.phpt index b53d24d4827a..bcfdded45edb 100644 --- a/ext/opcache/tests/ssa_bug_003.phpt +++ b/ext/opcache/tests/ssa_bug_003.phpt @@ -19,7 +19,7 @@ function test1($x) : callable { try { test1(1); } catch (Error $e) { - echo "Error: {$e->getMessage()}\n"; + echo $e->getMessage() . "\n"; } class Foo {} @@ -31,10 +31,10 @@ function test2() : Foo { try { test2(); } catch (Error $e) { - echo "Error: {$e->getMessage()}\n"; + echo $e->getMessage() . "\n"; } ?> --EXPECT-- -Error: Return value of test1() must be of type callable, string returned -Error: Return value of test2() must be of type Foo, stdClass returned +test1(): Return value must be of type callable, string returned +test2(): Return value must be of type Foo, stdClass returned diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt index 62791bf84e6b..abf41f97cdac 100644 --- a/tests/classes/tostring_001.phpt +++ b/tests/classes/tostring_001.phpt @@ -131,5 +131,5 @@ Converted object(test3)#2 (0) { } test3::__toString() -Return value of test3::__toString() must be of type string, array returned +test3::__toString(): Return value must be of type string, array returned ====DONE==== diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt index e07a7b21217e..8d2869868e0c 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -62,8 +62,8 @@ Object of class stdClass could not be converted to string Object with bad __toString(): Try 1: -Return value of badToString::__toString() must be of type string, array returned +badToString::__toString(): Return value must be of type string, array returned Try 2: -Return value of badToString::__toString() must be of type string, array returned +badToString::__toString(): Return value must be of type string, array returned From be9f1844b233d238711737ad081d630b6d418e90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Mon, 25 May 2020 20:32:37 +0200 Subject: [PATCH 2/3] Improve more error messages --- Zend/tests/add_002.phpt | 4 +- Zend/tests/add_003.phpt | 4 +- Zend/tests/bug54305.phpt | 2 +- Zend/tests/decrement_001.phpt | 2 +- Zend/tests/decrement_001_64bit.phpt | 2 +- Zend/tests/exception_018.phpt | 2 +- Zend/tests/exception_019.phpt | 2 +- Zend/tests/exception_020.phpt | 2 +- Zend/tests/exception_021.phpt | 2 +- Zend/tests/exception_022.phpt | 2 +- .../generators/throw_not_an_exception.phpt | 2 +- Zend/tests/increment_001.phpt | 2 +- Zend/tests/operator_unsupported_types.phpt | 842 +++++++++--------- Zend/tests/throw/001.phpt | 2 +- .../scalar_return_basic.phpt | 14 +- .../type_declarations/scalar_strict.phpt | 16 +- Zend/zend_API.c | 30 +- Zend/zend_API.h | 1 + Zend/zend_builtin_functions.c | 4 +- Zend/zend_compile.c | 2 +- Zend/zend_execute.c | 20 +- Zend/zend_operators.c | 8 +- Zend/zend_vm_def.h | 16 +- Zend/zend_vm_execute.h | 46 +- ext/bz2/bz2.c | 2 +- ext/date/tests/014.phpt | 2 +- .../DateTimeImmutable_createFromMutable.phpt | 2 +- .../tests/DateTime_createFromImmutable.phpt | 2 +- ext/date/tests/bug70245.phpt | 2 +- ext/date/tests/microtime_error.phpt | 2 +- ext/date/tests/timezone_offset_get_error.phpt | 4 +- ext/dom/parentnode.c | 4 +- ext/ftp/php_ftp.c | 6 +- ext/hash/hash.c | 4 +- ext/intl/tests/bug48227.phpt | 2 +- ext/intl/tests/calendar_equals_error.phpt | 2 +- ext/libxml/tests/004.phpt | 2 +- ...tute_character_variation_strict_types.phpt | 4 +- ...titute_character_variation_weak_types.phpt | 2 +- ext/mysqli/mysqli.c | 2 +- ext/mysqli/tests/mysqli_fetch_object_oo.phpt | 2 +- .../tests/iterable_type_optimization.phpt | 2 +- ext/pcre/php_pcre.c | 2 +- ext/pcre/tests/preg_grep_error1.phpt | 2 +- ext/pcre/tests/preg_match_all_error1.phpt | 2 +- ext/pcre/tests/preg_match_error1.phpt | 2 +- ext/pcre/tests/preg_match_error2.phpt | 2 +- ext/pcre/tests/preg_split_error1.phpt | 2 +- ext/reflection/php_reflection.c | 14 +- .../tests/ReflectionClass_getMethod_002.phpt | 2 +- .../ReflectionClass_getProperty_002.phpt | 2 +- .../tests/ReflectionReference_errors.phpt | 2 +- .../session_set_save_handler_iface_002.phpt | 2 +- ext/spl/php_spl.c | 6 +- ...edArray_construct_param_SplFixedArray.phpt | 2 +- ext/spl/tests/fixedarray_005.phpt | 2 +- ext/spl/tests/iterator_044.phpt | 8 +- .../tests/recursive_tree_iterator_003.phpt | 2 +- ext/standard/array.c | 30 +- ext/standard/filestat.c | 8 +- ext/standard/proc_open.c | 2 +- .../array/array_diff_assoc_variation1.phpt | 2 +- .../array/array_diff_assoc_variation2.phpt | 2 +- .../array/array_diff_key_variation1.phpt | 8 +- .../array/array_diff_key_variation2.phpt | 8 +- .../array/array_diff_uassoc_variation1.phpt | 4 +- .../array/array_diff_uassoc_variation2.phpt | 4 +- .../array/array_diff_ukey_variation1.phpt | 8 +- .../array/array_diff_ukey_variation2.phpt | 8 +- .../tests/array/array_diff_variation1.phpt | 2 +- .../tests/array/array_diff_variation2.phpt | 2 +- .../array_intersect_assoc_variation1.phpt | 4 +- .../array_intersect_assoc_variation2.phpt | 4 +- .../array/array_intersect_key_variation1.phpt | 8 +- .../array/array_intersect_key_variation2.phpt | 8 +- .../array_intersect_uassoc_variation1.phpt | 8 +- .../array_intersect_uassoc_variation2.phpt | 8 +- .../array_intersect_ukey_variation1.phpt | 8 +- .../array_intersect_ukey_variation2.phpt | 8 +- .../array/array_intersect_variation1.phpt | 4 +- .../array/array_intersect_variation2.phpt | 4 +- .../tests/array/array_key_exists.phpt | 2 +- .../array_merge_recursive_variation1.phpt | 4 +- .../array_merge_recursive_variation2.phpt | 2 +- .../tests/array/array_merge_variation2.phpt | 2 +- .../tests/array/array_search_variation3.phpt | 4 +- .../array/array_udiff_assoc_variation1.phpt | 4 +- .../array/array_udiff_assoc_variation2.phpt | 4 +- .../array/array_udiff_uassoc_variation1.phpt | 4 +- .../array/array_udiff_uassoc_variation2.phpt | 4 +- .../tests/array/array_udiff_variation1.phpt | 4 +- .../tests/array/array_udiff_variation2.phpt | 4 +- .../array_uintersect_assoc_variation1.phpt | 4 +- .../array_uintersect_assoc_variation2.phpt | 4 +- .../array_uintersect_uassoc_variation1.phpt | 4 +- .../array_uintersect_uassoc_variation2.phpt | 4 +- .../array/array_uintersect_variation1.phpt | 4 +- .../array/array_uintersect_variation2.phpt | 4 +- ext/standard/tests/array/bug40191.phpt | 2 +- .../tests/array/in_array_variation3.phpt | 4 +- ext/standard/tests/array/max.phpt | 2 +- ext/standard/tests/array/min.phpt | 2 +- ext/standard/tests/math/abs_variation.phpt | 2 +- ext/standard/tests/math/ceil_variation1.phpt | 2 +- ext/standard/tests/math/floor_variation1.phpt | 2 +- ext/standard/tests/math/pow_variation1.phpt | 2 +- .../tests/math/pow_variation1_64bit.phpt | 2 +- ext/standard/tests/math/pow_variation2.phpt | 2 +- ext/standard/tests/math/round_variation1.phpt | 2 +- ext/standard/tests/network/bug73594.phpt | 2 +- .../tests/password/password_hash_error.phpt | 2 +- .../tests/strings/join_variation2.phpt | 2 +- .../tests/strings/vprintf_variation2.phpt | 2 +- ext/standard/var.c | 2 +- ext/tokenizer/tokenizer.c | 4 +- ext/zip/php_zip.c | 2 +- ext/zlib/zlib.c | 2 +- tests/classes/tostring_004.phpt | 2 +- 118 files changed, 701 insertions(+), 688 deletions(-) diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt index 131569d856f8..9077ece08587 100644 --- a/Zend/tests/add_002.phpt +++ b/Zend/tests/add_002.phpt @@ -20,9 +20,9 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array + object +Exception: Unsupported operand types: array + stdClass -Fatal error: Uncaught TypeError: Unsupported operand types: array + object in %s:%d +Fatal error: Uncaught TypeError: Unsupported operand types: array + stdClass in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt index 69edb7cb1ec0..6d27863e893f 100644 --- a/Zend/tests/add_003.phpt +++ b/Zend/tests/add_003.phpt @@ -20,9 +20,9 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: object + array +Exception: Unsupported operand types: stdClass + array -Fatal error: Uncaught TypeError: Unsupported operand types: object + array in %s:%d +Fatal error: Uncaught TypeError: Unsupported operand types: stdClass + array in %s:%d Stack trace: #0 {main} thrown in %s on line %d diff --git a/Zend/tests/bug54305.phpt b/Zend/tests/bug54305.phpt index a443d480ec56..61e351306f78 100644 --- a/Zend/tests/bug54305.phpt +++ b/Zend/tests/bug54305.phpt @@ -16,4 +16,4 @@ try { } ?> --EXPECT-- -Cannot increment object +Cannot increment ReflectionMethod diff --git a/Zend/tests/decrement_001.phpt b/Zend/tests/decrement_001.phpt index 5983c4eaa185..638249179956 100644 --- a/Zend/tests/decrement_001.phpt +++ b/Zend/tests/decrement_001.phpt @@ -56,7 +56,7 @@ float(1.5) NULL bool(true) bool(false) -Cannot decrement object +Cannot decrement stdClass object(stdClass)#%d (0) { } Cannot decrement array diff --git a/Zend/tests/decrement_001_64bit.phpt b/Zend/tests/decrement_001_64bit.phpt index a96d8cbd0712..b776bc5dd389 100644 --- a/Zend/tests/decrement_001_64bit.phpt +++ b/Zend/tests/decrement_001_64bit.phpt @@ -56,7 +56,7 @@ float(1.5) NULL bool(true) bool(false) -Cannot decrement object +Cannot decrement stdClass object(stdClass)#1 (0) { } Cannot decrement array diff --git a/Zend/tests/exception_018.phpt b/Zend/tests/exception_018.phpt index 6789cfe9813b..b61a788288e2 100644 --- a/Zend/tests/exception_018.phpt +++ b/Zend/tests/exception_018.phpt @@ -8,7 +8,7 @@ throw new Hello(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Exception::__construct(): Argument #1 ($message) must be of type string, object given in %s:%d +Fatal error: Uncaught TypeError: Exception::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d Stack trace: #0 %sexception_018.php(%d): Exception->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/exception_019.phpt b/Zend/tests/exception_019.phpt index 7aa20c2bc763..45b87956c944 100644 --- a/Zend/tests/exception_019.phpt +++ b/Zend/tests/exception_019.phpt @@ -7,7 +7,7 @@ throw new Exception(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Exception::__construct(): Argument #1 ($message) must be of type string, object given in %s:%d +Fatal error: Uncaught TypeError: Exception::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d Stack trace: #0 %sexception_019.php(%d): Exception->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/exception_020.phpt b/Zend/tests/exception_020.phpt index 3135ef363340..680a1a0d1af1 100644 --- a/Zend/tests/exception_020.phpt +++ b/Zend/tests/exception_020.phpt @@ -8,7 +8,7 @@ throw new MyErrorException(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: ErrorException::__construct(): Argument #1 ($message) must be of type string, object given in %s:%d +Fatal error: Uncaught TypeError: ErrorException::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d Stack trace: #0 %sexception_020.php(%d): ErrorException->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/exception_021.phpt b/Zend/tests/exception_021.phpt index 70ca3caa5734..6fa7e49d80a1 100644 --- a/Zend/tests/exception_021.phpt +++ b/Zend/tests/exception_021.phpt @@ -8,7 +8,7 @@ throw new Hello(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Error::__construct(): Argument #1 ($message) must be of type string, object given in %s:%d +Fatal error: Uncaught TypeError: Error::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d Stack trace: #0 %sexception_021.php(%d): Error->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/exception_022.phpt b/Zend/tests/exception_022.phpt index e9b9da87e99f..604d3314c22c 100644 --- a/Zend/tests/exception_022.phpt +++ b/Zend/tests/exception_022.phpt @@ -7,7 +7,7 @@ throw new Error(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: Error::__construct(): Argument #1 ($message) must be of type string, object given in %s:%d +Fatal error: Uncaught TypeError: Error::__construct(): Argument #1 ($message) must be of type string, stdClass given in %s:%d Stack trace: #0 %sexception_022.php(%d): Error->__construct(Object(stdClass)) #1 {main} diff --git a/Zend/tests/generators/throw_not_an_exception.phpt b/Zend/tests/generators/throw_not_an_exception.phpt index d1ff81882f8a..3b5a590096f4 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(): Argument #1 ($exception) must be of type Throwable, object given in %s:%d +Fatal error: Uncaught TypeError: Generator::throw(): Argument #1 ($exception) must be of type Throwable, stdClass given in %s:%d Stack trace: #0 %s(%d): Generator->throw(Object(stdClass)) #1 {main} diff --git a/Zend/tests/increment_001.phpt b/Zend/tests/increment_001.phpt index a834c5c51d54..f34377192677 100644 --- a/Zend/tests/increment_001.phpt +++ b/Zend/tests/increment_001.phpt @@ -56,7 +56,7 @@ float(3.5) int(1) bool(true) bool(false) -Cannot increment object +Cannot increment stdClass object(stdClass)#%d (0) { } Cannot increment array diff --git a/Zend/tests/operator_unsupported_types.phpt b/Zend/tests/operator_unsupported_types.phpt index 9004897d7141..e266affcea22 100644 --- a/Zend/tests/operator_unsupported_types.phpt +++ b/Zend/tests/operator_unsupported_types.phpt @@ -126,13 +126,13 @@ foreach ($illegalValues as $illegalValue) { --EXPECT-- BINARY OP: No error for [] + [] -Unsupported operand types: array + object +Unsupported operand types: array + stdClass Unsupported operand types: array + resource -Unsupported operand types: object + array -Unsupported operand types: object + object -Unsupported operand types: object + resource +Unsupported operand types: stdClass + array +Unsupported operand types: stdClass + stdClass +Unsupported operand types: stdClass + resource Unsupported operand types: resource + array -Unsupported operand types: resource + object +Unsupported operand types: resource + stdClass Unsupported operand types: resource + resource Unsupported operand types: array + null Unsupported operand types: null + array @@ -149,21 +149,21 @@ Unsupported operand types: string + array Unsupported operand types: array + string Warning: A non-numeric value encountered Unsupported operand types: string + array -Unsupported operand types: object + null -Unsupported operand types: null + object -Unsupported operand types: object + bool -Unsupported operand types: bool + object -Unsupported operand types: object + bool -Unsupported operand types: bool + object -Unsupported operand types: object + int -Unsupported operand types: int + object -Unsupported operand types: object + float -Unsupported operand types: float + object -Unsupported operand types: object + string -Unsupported operand types: string + object -Unsupported operand types: object + string +Unsupported operand types: stdClass + null +Unsupported operand types: null + stdClass +Unsupported operand types: stdClass + bool +Unsupported operand types: bool + stdClass +Unsupported operand types: stdClass + bool +Unsupported operand types: bool + stdClass +Unsupported operand types: stdClass + int +Unsupported operand types: int + stdClass +Unsupported operand types: stdClass + float +Unsupported operand types: float + stdClass +Unsupported operand types: stdClass + string +Unsupported operand types: string + stdClass +Unsupported operand types: stdClass + string Warning: A non-numeric value encountered -Unsupported operand types: string + object +Unsupported operand types: string + stdClass Unsupported operand types: resource + null Unsupported operand types: null + resource Unsupported operand types: resource + bool @@ -180,13 +180,13 @@ Unsupported operand types: resource + string Warning: A non-numeric value encountered Unsupported operand types: string + resource Unsupported operand types: array - array -Unsupported operand types: array - object +Unsupported operand types: array - stdClass Unsupported operand types: array - resource -Unsupported operand types: object - array -Unsupported operand types: object - object -Unsupported operand types: object - resource +Unsupported operand types: stdClass - array +Unsupported operand types: stdClass - stdClass +Unsupported operand types: stdClass - resource Unsupported operand types: resource - array -Unsupported operand types: resource - object +Unsupported operand types: resource - stdClass Unsupported operand types: resource - resource Unsupported operand types: array - null Unsupported operand types: null - array @@ -203,21 +203,21 @@ Unsupported operand types: string - array Unsupported operand types: array - string Warning: A non-numeric value encountered Unsupported operand types: string - array -Unsupported operand types: object - null -Unsupported operand types: null - object -Unsupported operand types: object - bool -Unsupported operand types: bool - object -Unsupported operand types: object - bool -Unsupported operand types: bool - object -Unsupported operand types: object - int -Unsupported operand types: int - object -Unsupported operand types: object - float -Unsupported operand types: float - object -Unsupported operand types: object - string -Unsupported operand types: string - object -Unsupported operand types: object - string +Unsupported operand types: stdClass - null +Unsupported operand types: null - stdClass +Unsupported operand types: stdClass - bool +Unsupported operand types: bool - stdClass +Unsupported operand types: stdClass - bool +Unsupported operand types: bool - stdClass +Unsupported operand types: stdClass - int +Unsupported operand types: int - stdClass +Unsupported operand types: stdClass - float +Unsupported operand types: float - stdClass +Unsupported operand types: stdClass - string +Unsupported operand types: string - stdClass +Unsupported operand types: stdClass - string Warning: A non-numeric value encountered -Unsupported operand types: string - object +Unsupported operand types: string - stdClass Unsupported operand types: resource - null Unsupported operand types: null - resource Unsupported operand types: resource - bool @@ -234,13 +234,13 @@ Unsupported operand types: resource - string Warning: A non-numeric value encountered Unsupported operand types: string - resource Unsupported operand types: array * array -Unsupported operand types: object * array +Unsupported operand types: stdClass * array Unsupported operand types: resource * array -Unsupported operand types: object * array -Unsupported operand types: object * object -Unsupported operand types: object * resource +Unsupported operand types: stdClass * array +Unsupported operand types: stdClass * stdClass +Unsupported operand types: stdClass * resource Unsupported operand types: resource * array -Unsupported operand types: object * resource +Unsupported operand types: stdClass * resource Unsupported operand types: resource * resource Unsupported operand types: array * null Unsupported operand types: null * array @@ -257,20 +257,20 @@ Unsupported operand types: string * array Unsupported operand types: array * string Warning: A non-numeric value encountered Unsupported operand types: string * array -Unsupported operand types: object * null -Unsupported operand types: object * null -Unsupported operand types: object * bool -Unsupported operand types: object * bool -Unsupported operand types: object * bool -Unsupported operand types: object * bool -Unsupported operand types: object * int -Unsupported operand types: object * int -Unsupported operand types: object * float -Unsupported operand types: object * float -Unsupported operand types: object * string -Unsupported operand types: object * string -Unsupported operand types: object * string -Unsupported operand types: object * string +Unsupported operand types: stdClass * null +Unsupported operand types: stdClass * null +Unsupported operand types: stdClass * bool +Unsupported operand types: stdClass * bool +Unsupported operand types: stdClass * bool +Unsupported operand types: stdClass * bool +Unsupported operand types: stdClass * int +Unsupported operand types: stdClass * int +Unsupported operand types: stdClass * float +Unsupported operand types: stdClass * float +Unsupported operand types: stdClass * string +Unsupported operand types: stdClass * string +Unsupported operand types: stdClass * string +Unsupported operand types: stdClass * string Unsupported operand types: resource * null Unsupported operand types: resource * null Unsupported operand types: resource * bool @@ -286,13 +286,13 @@ Unsupported operand types: resource * string Unsupported operand types: resource * string Unsupported operand types: resource * string Unsupported operand types: array / array -Unsupported operand types: array / object +Unsupported operand types: array / stdClass Unsupported operand types: array / resource -Unsupported operand types: object / array -Unsupported operand types: object / object -Unsupported operand types: object / resource +Unsupported operand types: stdClass / array +Unsupported operand types: stdClass / stdClass +Unsupported operand types: stdClass / resource Unsupported operand types: resource / array -Unsupported operand types: resource / object +Unsupported operand types: resource / stdClass Unsupported operand types: resource / resource Unsupported operand types: array / null Unsupported operand types: null / array @@ -309,21 +309,21 @@ Unsupported operand types: string / array Unsupported operand types: array / string Warning: A non-numeric value encountered Unsupported operand types: string / array -Unsupported operand types: object / null -Unsupported operand types: null / object -Unsupported operand types: object / bool -Unsupported operand types: bool / object -Unsupported operand types: object / bool -Unsupported operand types: bool / object -Unsupported operand types: object / int -Unsupported operand types: int / object -Unsupported operand types: object / float -Unsupported operand types: float / object -Unsupported operand types: object / string -Unsupported operand types: string / object -Unsupported operand types: object / string +Unsupported operand types: stdClass / null +Unsupported operand types: null / stdClass +Unsupported operand types: stdClass / bool +Unsupported operand types: bool / stdClass +Unsupported operand types: stdClass / bool +Unsupported operand types: bool / stdClass +Unsupported operand types: stdClass / int +Unsupported operand types: int / stdClass +Unsupported operand types: stdClass / float +Unsupported operand types: float / stdClass +Unsupported operand types: stdClass / string +Unsupported operand types: string / stdClass +Unsupported operand types: stdClass / string Warning: A non-numeric value encountered -Unsupported operand types: string / object +Unsupported operand types: string / stdClass Unsupported operand types: resource / null Unsupported operand types: null / resource Unsupported operand types: resource / bool @@ -340,13 +340,13 @@ Unsupported operand types: resource / string Warning: A non-numeric value encountered Unsupported operand types: string / resource Unsupported operand types: array % array -Unsupported operand types: array % object +Unsupported operand types: array % stdClass Unsupported operand types: array % resource -Unsupported operand types: object % array -Unsupported operand types: object % object -Unsupported operand types: object % resource +Unsupported operand types: stdClass % array +Unsupported operand types: stdClass % stdClass +Unsupported operand types: stdClass % resource Unsupported operand types: resource % array -Unsupported operand types: resource % object +Unsupported operand types: resource % stdClass Unsupported operand types: resource % resource Unsupported operand types: array % null Unsupported operand types: null % array @@ -363,21 +363,21 @@ Unsupported operand types: string % array Unsupported operand types: array % string Warning: A non-numeric value encountered Unsupported operand types: string % array -Unsupported operand types: object % null -Unsupported operand types: null % object -Unsupported operand types: object % bool -Unsupported operand types: bool % object -Unsupported operand types: object % bool -Unsupported operand types: bool % object -Unsupported operand types: object % int -Unsupported operand types: int % object -Unsupported operand types: object % float -Unsupported operand types: float % object -Unsupported operand types: object % string -Unsupported operand types: string % object -Unsupported operand types: object % string +Unsupported operand types: stdClass % null +Unsupported operand types: null % stdClass +Unsupported operand types: stdClass % bool +Unsupported operand types: bool % stdClass +Unsupported operand types: stdClass % bool +Unsupported operand types: bool % stdClass +Unsupported operand types: stdClass % int +Unsupported operand types: int % stdClass +Unsupported operand types: stdClass % float +Unsupported operand types: float % stdClass +Unsupported operand types: stdClass % string +Unsupported operand types: string % stdClass +Unsupported operand types: stdClass % string Warning: A non-numeric value encountered -Unsupported operand types: string % object +Unsupported operand types: string % stdClass Unsupported operand types: resource % null Unsupported operand types: null % resource Unsupported operand types: resource % bool @@ -394,13 +394,13 @@ Unsupported operand types: resource % string Warning: A non-numeric value encountered Unsupported operand types: string % resource Unsupported operand types: array ** array -Unsupported operand types: array ** object +Unsupported operand types: array ** stdClass Unsupported operand types: array ** resource -Unsupported operand types: object ** array -Unsupported operand types: object ** object -Unsupported operand types: object ** resource +Unsupported operand types: stdClass ** array +Unsupported operand types: stdClass ** stdClass +Unsupported operand types: stdClass ** resource Unsupported operand types: resource ** array -Unsupported operand types: resource ** object +Unsupported operand types: resource ** stdClass Unsupported operand types: resource ** resource Unsupported operand types: array ** null Unsupported operand types: null ** array @@ -417,21 +417,21 @@ Unsupported operand types: string ** array Unsupported operand types: array ** string Warning: A non-numeric value encountered Unsupported operand types: string ** array -Unsupported operand types: object ** null -Unsupported operand types: null ** object -Unsupported operand types: object ** bool -Unsupported operand types: bool ** object -Unsupported operand types: object ** bool -Unsupported operand types: bool ** object -Unsupported operand types: object ** int -Unsupported operand types: int ** object -Unsupported operand types: object ** float -Unsupported operand types: float ** object -Unsupported operand types: object ** string -Unsupported operand types: string ** object -Unsupported operand types: object ** string +Unsupported operand types: stdClass ** null +Unsupported operand types: null ** stdClass +Unsupported operand types: stdClass ** bool +Unsupported operand types: bool ** stdClass +Unsupported operand types: stdClass ** bool +Unsupported operand types: bool ** stdClass +Unsupported operand types: stdClass ** int +Unsupported operand types: int ** stdClass +Unsupported operand types: stdClass ** float +Unsupported operand types: float ** stdClass +Unsupported operand types: stdClass ** string +Unsupported operand types: string ** stdClass +Unsupported operand types: stdClass ** string Warning: A non-numeric value encountered -Unsupported operand types: string ** object +Unsupported operand types: string ** stdClass Unsupported operand types: resource ** null Unsupported operand types: null ** resource Unsupported operand types: resource ** bool @@ -448,13 +448,13 @@ Unsupported operand types: resource ** string Warning: A non-numeric value encountered Unsupported operand types: string ** resource Unsupported operand types: array << array -Unsupported operand types: array << object +Unsupported operand types: array << stdClass Unsupported operand types: array << resource -Unsupported operand types: object << array -Unsupported operand types: object << object -Unsupported operand types: object << resource +Unsupported operand types: stdClass << array +Unsupported operand types: stdClass << stdClass +Unsupported operand types: stdClass << resource Unsupported operand types: resource << array -Unsupported operand types: resource << object +Unsupported operand types: resource << stdClass Unsupported operand types: resource << resource Unsupported operand types: array << null Unsupported operand types: null << array @@ -471,21 +471,21 @@ Unsupported operand types: string << array Unsupported operand types: array << string Warning: A non-numeric value encountered Unsupported operand types: string << array -Unsupported operand types: object << null -Unsupported operand types: null << object -Unsupported operand types: object << bool -Unsupported operand types: bool << object -Unsupported operand types: object << bool -Unsupported operand types: bool << object -Unsupported operand types: object << int -Unsupported operand types: int << object -Unsupported operand types: object << float -Unsupported operand types: float << object -Unsupported operand types: object << string -Unsupported operand types: string << object -Unsupported operand types: object << string +Unsupported operand types: stdClass << null +Unsupported operand types: null << stdClass +Unsupported operand types: stdClass << bool +Unsupported operand types: bool << stdClass +Unsupported operand types: stdClass << bool +Unsupported operand types: bool << stdClass +Unsupported operand types: stdClass << int +Unsupported operand types: int << stdClass +Unsupported operand types: stdClass << float +Unsupported operand types: float << stdClass +Unsupported operand types: stdClass << string +Unsupported operand types: string << stdClass +Unsupported operand types: stdClass << string Warning: A non-numeric value encountered -Unsupported operand types: string << object +Unsupported operand types: string << stdClass Unsupported operand types: resource << null Unsupported operand types: null << resource Unsupported operand types: resource << bool @@ -502,13 +502,13 @@ Unsupported operand types: resource << string Warning: A non-numeric value encountered Unsupported operand types: string << resource Unsupported operand types: array >> array -Unsupported operand types: array >> object +Unsupported operand types: array >> stdClass Unsupported operand types: array >> resource -Unsupported operand types: object >> array -Unsupported operand types: object >> object -Unsupported operand types: object >> resource +Unsupported operand types: stdClass >> array +Unsupported operand types: stdClass >> stdClass +Unsupported operand types: stdClass >> resource Unsupported operand types: resource >> array -Unsupported operand types: resource >> object +Unsupported operand types: resource >> stdClass Unsupported operand types: resource >> resource Unsupported operand types: array >> null Unsupported operand types: null >> array @@ -525,21 +525,21 @@ Unsupported operand types: string >> array Unsupported operand types: array >> string Warning: A non-numeric value encountered Unsupported operand types: string >> array -Unsupported operand types: object >> null -Unsupported operand types: null >> object -Unsupported operand types: object >> bool -Unsupported operand types: bool >> object -Unsupported operand types: object >> bool -Unsupported operand types: bool >> object -Unsupported operand types: object >> int -Unsupported operand types: int >> object -Unsupported operand types: object >> float -Unsupported operand types: float >> object -Unsupported operand types: object >> string -Unsupported operand types: string >> object -Unsupported operand types: object >> string +Unsupported operand types: stdClass >> null +Unsupported operand types: null >> stdClass +Unsupported operand types: stdClass >> bool +Unsupported operand types: bool >> stdClass +Unsupported operand types: stdClass >> bool +Unsupported operand types: bool >> stdClass +Unsupported operand types: stdClass >> int +Unsupported operand types: int >> stdClass +Unsupported operand types: stdClass >> float +Unsupported operand types: float >> stdClass +Unsupported operand types: stdClass >> string +Unsupported operand types: string >> stdClass +Unsupported operand types: stdClass >> string Warning: A non-numeric value encountered -Unsupported operand types: string >> object +Unsupported operand types: string >> stdClass Unsupported operand types: resource >> null Unsupported operand types: null >> resource Unsupported operand types: resource >> bool @@ -556,13 +556,13 @@ Unsupported operand types: resource >> string Warning: A non-numeric value encountered Unsupported operand types: string >> resource Unsupported operand types: array & array -Unsupported operand types: object & array +Unsupported operand types: stdClass & array Unsupported operand types: resource & array -Unsupported operand types: object & array -Unsupported operand types: object & object -Unsupported operand types: object & resource +Unsupported operand types: stdClass & array +Unsupported operand types: stdClass & stdClass +Unsupported operand types: stdClass & resource Unsupported operand types: resource & array -Unsupported operand types: object & resource +Unsupported operand types: stdClass & resource Unsupported operand types: resource & resource Unsupported operand types: array & null Unsupported operand types: null & array @@ -579,20 +579,20 @@ Unsupported operand types: string & array Unsupported operand types: array & string Warning: A non-numeric value encountered Unsupported operand types: string & array -Unsupported operand types: object & null -Unsupported operand types: object & null -Unsupported operand types: object & bool -Unsupported operand types: object & bool -Unsupported operand types: object & bool -Unsupported operand types: object & bool -Unsupported operand types: object & int -Unsupported operand types: object & int -Unsupported operand types: object & float -Unsupported operand types: object & float -Unsupported operand types: object & string -Unsupported operand types: object & string -Unsupported operand types: object & string -Unsupported operand types: object & string +Unsupported operand types: stdClass & null +Unsupported operand types: stdClass & null +Unsupported operand types: stdClass & bool +Unsupported operand types: stdClass & bool +Unsupported operand types: stdClass & bool +Unsupported operand types: stdClass & bool +Unsupported operand types: stdClass & int +Unsupported operand types: stdClass & int +Unsupported operand types: stdClass & float +Unsupported operand types: stdClass & float +Unsupported operand types: stdClass & string +Unsupported operand types: stdClass & string +Unsupported operand types: stdClass & string +Unsupported operand types: stdClass & string Unsupported operand types: resource & null Unsupported operand types: resource & null Unsupported operand types: resource & bool @@ -608,13 +608,13 @@ Unsupported operand types: resource & string Unsupported operand types: resource & string Unsupported operand types: resource & string Unsupported operand types: array | array -Unsupported operand types: object | array +Unsupported operand types: stdClass | array Unsupported operand types: resource | array -Unsupported operand types: object | array -Unsupported operand types: object | object -Unsupported operand types: object | resource +Unsupported operand types: stdClass | array +Unsupported operand types: stdClass | stdClass +Unsupported operand types: stdClass | resource Unsupported operand types: resource | array -Unsupported operand types: object | resource +Unsupported operand types: stdClass | resource Unsupported operand types: resource | resource Unsupported operand types: array | null Unsupported operand types: null | array @@ -631,20 +631,20 @@ Unsupported operand types: string | array Unsupported operand types: array | string Warning: A non-numeric value encountered Unsupported operand types: string | array -Unsupported operand types: object | null -Unsupported operand types: object | null -Unsupported operand types: object | bool -Unsupported operand types: object | bool -Unsupported operand types: object | bool -Unsupported operand types: object | bool -Unsupported operand types: object | int -Unsupported operand types: object | int -Unsupported operand types: object | float -Unsupported operand types: object | float -Unsupported operand types: object | string -Unsupported operand types: object | string -Unsupported operand types: object | string -Unsupported operand types: object | string +Unsupported operand types: stdClass | null +Unsupported operand types: stdClass | null +Unsupported operand types: stdClass | bool +Unsupported operand types: stdClass | bool +Unsupported operand types: stdClass | bool +Unsupported operand types: stdClass | bool +Unsupported operand types: stdClass | int +Unsupported operand types: stdClass | int +Unsupported operand types: stdClass | float +Unsupported operand types: stdClass | float +Unsupported operand types: stdClass | string +Unsupported operand types: stdClass | string +Unsupported operand types: stdClass | string +Unsupported operand types: stdClass | string Unsupported operand types: resource | null Unsupported operand types: resource | null Unsupported operand types: resource | bool @@ -660,13 +660,13 @@ Unsupported operand types: resource | string Unsupported operand types: resource | string Unsupported operand types: resource | string Unsupported operand types: array ^ array -Unsupported operand types: object ^ array +Unsupported operand types: stdClass ^ array Unsupported operand types: resource ^ array -Unsupported operand types: object ^ array -Unsupported operand types: object ^ object -Unsupported operand types: object ^ resource +Unsupported operand types: stdClass ^ array +Unsupported operand types: stdClass ^ stdClass +Unsupported operand types: stdClass ^ resource Unsupported operand types: resource ^ array -Unsupported operand types: object ^ resource +Unsupported operand types: stdClass ^ resource Unsupported operand types: resource ^ resource Unsupported operand types: array ^ null Unsupported operand types: null ^ array @@ -683,20 +683,20 @@ Unsupported operand types: string ^ array Unsupported operand types: array ^ string Warning: A non-numeric value encountered Unsupported operand types: string ^ array -Unsupported operand types: object ^ null -Unsupported operand types: object ^ null -Unsupported operand types: object ^ bool -Unsupported operand types: object ^ bool -Unsupported operand types: object ^ bool -Unsupported operand types: object ^ bool -Unsupported operand types: object ^ int -Unsupported operand types: object ^ int -Unsupported operand types: object ^ float -Unsupported operand types: object ^ float -Unsupported operand types: object ^ string -Unsupported operand types: object ^ string -Unsupported operand types: object ^ string -Unsupported operand types: object ^ string +Unsupported operand types: stdClass ^ null +Unsupported operand types: stdClass ^ null +Unsupported operand types: stdClass ^ bool +Unsupported operand types: stdClass ^ bool +Unsupported operand types: stdClass ^ bool +Unsupported operand types: stdClass ^ bool +Unsupported operand types: stdClass ^ int +Unsupported operand types: stdClass ^ int +Unsupported operand types: stdClass ^ float +Unsupported operand types: stdClass ^ float +Unsupported operand types: stdClass ^ string +Unsupported operand types: stdClass ^ string +Unsupported operand types: stdClass ^ string +Unsupported operand types: stdClass ^ string Unsupported operand types: resource ^ null Unsupported operand types: resource ^ null Unsupported operand types: resource ^ bool @@ -837,13 +837,13 @@ No error for "foo" . STDOUT ASSIGN OP: No error for [] += [] -Unsupported operand types: array + object +Unsupported operand types: array + stdClass Unsupported operand types: array + resource -Unsupported operand types: object + array -Unsupported operand types: object + object -Unsupported operand types: object + resource +Unsupported operand types: stdClass + array +Unsupported operand types: stdClass + stdClass +Unsupported operand types: stdClass + resource Unsupported operand types: resource + array -Unsupported operand types: resource + object +Unsupported operand types: resource + stdClass Unsupported operand types: resource + resource Unsupported operand types: array + null Unsupported operand types: null + array @@ -860,21 +860,21 @@ Unsupported operand types: string + array Unsupported operand types: array + string Warning: A non-numeric value encountered Unsupported operand types: string + array -Unsupported operand types: object + null -Unsupported operand types: null + object -Unsupported operand types: object + bool -Unsupported operand types: bool + object -Unsupported operand types: object + bool -Unsupported operand types: bool + object -Unsupported operand types: object + int -Unsupported operand types: int + object -Unsupported operand types: object + float -Unsupported operand types: float + object -Unsupported operand types: object + string -Unsupported operand types: string + object -Unsupported operand types: object + string +Unsupported operand types: stdClass + null +Unsupported operand types: null + stdClass +Unsupported operand types: stdClass + bool +Unsupported operand types: bool + stdClass +Unsupported operand types: stdClass + bool +Unsupported operand types: bool + stdClass +Unsupported operand types: stdClass + int +Unsupported operand types: int + stdClass +Unsupported operand types: stdClass + float +Unsupported operand types: float + stdClass +Unsupported operand types: stdClass + string +Unsupported operand types: string + stdClass +Unsupported operand types: stdClass + string Warning: A non-numeric value encountered -Unsupported operand types: string + object +Unsupported operand types: string + stdClass Unsupported operand types: resource + null Unsupported operand types: null + resource Unsupported operand types: resource + bool @@ -891,13 +891,13 @@ Unsupported operand types: resource + string Warning: A non-numeric value encountered Unsupported operand types: string + resource Unsupported operand types: array - array -Unsupported operand types: array - object +Unsupported operand types: array - stdClass Unsupported operand types: array - resource -Unsupported operand types: object - array -Unsupported operand types: object - object -Unsupported operand types: object - resource +Unsupported operand types: stdClass - array +Unsupported operand types: stdClass - stdClass +Unsupported operand types: stdClass - resource Unsupported operand types: resource - array -Unsupported operand types: resource - object +Unsupported operand types: resource - stdClass Unsupported operand types: resource - resource Unsupported operand types: array - null Unsupported operand types: null - array @@ -914,21 +914,21 @@ Unsupported operand types: string - array Unsupported operand types: array - string Warning: A non-numeric value encountered Unsupported operand types: string - array -Unsupported operand types: object - null -Unsupported operand types: null - object -Unsupported operand types: object - bool -Unsupported operand types: bool - object -Unsupported operand types: object - bool -Unsupported operand types: bool - object -Unsupported operand types: object - int -Unsupported operand types: int - object -Unsupported operand types: object - float -Unsupported operand types: float - object -Unsupported operand types: object - string -Unsupported operand types: string - object -Unsupported operand types: object - string +Unsupported operand types: stdClass - null +Unsupported operand types: null - stdClass +Unsupported operand types: stdClass - bool +Unsupported operand types: bool - stdClass +Unsupported operand types: stdClass - bool +Unsupported operand types: bool - stdClass +Unsupported operand types: stdClass - int +Unsupported operand types: int - stdClass +Unsupported operand types: stdClass - float +Unsupported operand types: float - stdClass +Unsupported operand types: stdClass - string +Unsupported operand types: string - stdClass +Unsupported operand types: stdClass - string Warning: A non-numeric value encountered -Unsupported operand types: string - object +Unsupported operand types: string - stdClass Unsupported operand types: resource - null Unsupported operand types: null - resource Unsupported operand types: resource - bool @@ -945,13 +945,13 @@ Unsupported operand types: resource - string Warning: A non-numeric value encountered Unsupported operand types: string - resource Unsupported operand types: array * array -Unsupported operand types: array * object +Unsupported operand types: array * stdClass Unsupported operand types: array * resource -Unsupported operand types: object * array -Unsupported operand types: object * object -Unsupported operand types: object * resource +Unsupported operand types: stdClass * array +Unsupported operand types: stdClass * stdClass +Unsupported operand types: stdClass * resource Unsupported operand types: resource * array -Unsupported operand types: resource * object +Unsupported operand types: resource * stdClass Unsupported operand types: resource * resource Unsupported operand types: array * null Unsupported operand types: null * array @@ -968,21 +968,21 @@ Unsupported operand types: string * array Unsupported operand types: array * string Warning: A non-numeric value encountered Unsupported operand types: string * array -Unsupported operand types: object * null -Unsupported operand types: null * object -Unsupported operand types: object * bool -Unsupported operand types: bool * object -Unsupported operand types: object * bool -Unsupported operand types: bool * object -Unsupported operand types: object * int -Unsupported operand types: int * object -Unsupported operand types: object * float -Unsupported operand types: float * object -Unsupported operand types: object * string -Unsupported operand types: string * object -Unsupported operand types: object * string +Unsupported operand types: stdClass * null +Unsupported operand types: null * stdClass +Unsupported operand types: stdClass * bool +Unsupported operand types: bool * stdClass +Unsupported operand types: stdClass * bool +Unsupported operand types: bool * stdClass +Unsupported operand types: stdClass * int +Unsupported operand types: int * stdClass +Unsupported operand types: stdClass * float +Unsupported operand types: float * stdClass +Unsupported operand types: stdClass * string +Unsupported operand types: string * stdClass +Unsupported operand types: stdClass * string Warning: A non-numeric value encountered -Unsupported operand types: string * object +Unsupported operand types: string * stdClass Unsupported operand types: resource * null Unsupported operand types: null * resource Unsupported operand types: resource * bool @@ -999,13 +999,13 @@ Unsupported operand types: resource * string Warning: A non-numeric value encountered Unsupported operand types: string * resource Unsupported operand types: array / array -Unsupported operand types: array / object +Unsupported operand types: array / stdClass Unsupported operand types: array / resource -Unsupported operand types: object / array -Unsupported operand types: object / object -Unsupported operand types: object / resource +Unsupported operand types: stdClass / array +Unsupported operand types: stdClass / stdClass +Unsupported operand types: stdClass / resource Unsupported operand types: resource / array -Unsupported operand types: resource / object +Unsupported operand types: resource / stdClass Unsupported operand types: resource / resource Unsupported operand types: array / null Unsupported operand types: null / array @@ -1022,21 +1022,21 @@ Unsupported operand types: string / array Unsupported operand types: array / string Warning: A non-numeric value encountered Unsupported operand types: string / array -Unsupported operand types: object / null -Unsupported operand types: null / object -Unsupported operand types: object / bool -Unsupported operand types: bool / object -Unsupported operand types: object / bool -Unsupported operand types: bool / object -Unsupported operand types: object / int -Unsupported operand types: int / object -Unsupported operand types: object / float -Unsupported operand types: float / object -Unsupported operand types: object / string -Unsupported operand types: string / object -Unsupported operand types: object / string +Unsupported operand types: stdClass / null +Unsupported operand types: null / stdClass +Unsupported operand types: stdClass / bool +Unsupported operand types: bool / stdClass +Unsupported operand types: stdClass / bool +Unsupported operand types: bool / stdClass +Unsupported operand types: stdClass / int +Unsupported operand types: int / stdClass +Unsupported operand types: stdClass / float +Unsupported operand types: float / stdClass +Unsupported operand types: stdClass / string +Unsupported operand types: string / stdClass +Unsupported operand types: stdClass / string Warning: A non-numeric value encountered -Unsupported operand types: string / object +Unsupported operand types: string / stdClass Unsupported operand types: resource / null Unsupported operand types: null / resource Unsupported operand types: resource / bool @@ -1053,13 +1053,13 @@ Unsupported operand types: resource / string Warning: A non-numeric value encountered Unsupported operand types: string / resource Unsupported operand types: array % array -Unsupported operand types: array % object +Unsupported operand types: array % stdClass Unsupported operand types: array % resource -Unsupported operand types: object % array -Unsupported operand types: object % object -Unsupported operand types: object % resource +Unsupported operand types: stdClass % array +Unsupported operand types: stdClass % stdClass +Unsupported operand types: stdClass % resource Unsupported operand types: resource % array -Unsupported operand types: resource % object +Unsupported operand types: resource % stdClass Unsupported operand types: resource % resource Unsupported operand types: array % null Unsupported operand types: null % array @@ -1076,21 +1076,21 @@ Unsupported operand types: string % array Unsupported operand types: array % string Warning: A non-numeric value encountered Unsupported operand types: string % array -Unsupported operand types: object % null -Unsupported operand types: null % object -Unsupported operand types: object % bool -Unsupported operand types: bool % object -Unsupported operand types: object % bool -Unsupported operand types: bool % object -Unsupported operand types: object % int -Unsupported operand types: int % object -Unsupported operand types: object % float -Unsupported operand types: float % object -Unsupported operand types: object % string -Unsupported operand types: string % object -Unsupported operand types: object % string +Unsupported operand types: stdClass % null +Unsupported operand types: null % stdClass +Unsupported operand types: stdClass % bool +Unsupported operand types: bool % stdClass +Unsupported operand types: stdClass % bool +Unsupported operand types: bool % stdClass +Unsupported operand types: stdClass % int +Unsupported operand types: int % stdClass +Unsupported operand types: stdClass % float +Unsupported operand types: float % stdClass +Unsupported operand types: stdClass % string +Unsupported operand types: string % stdClass +Unsupported operand types: stdClass % string Warning: A non-numeric value encountered -Unsupported operand types: string % object +Unsupported operand types: string % stdClass Unsupported operand types: resource % null Unsupported operand types: null % resource Unsupported operand types: resource % bool @@ -1107,13 +1107,13 @@ Unsupported operand types: resource % string Warning: A non-numeric value encountered Unsupported operand types: string % resource Unsupported operand types: array ** array -Unsupported operand types: array ** object +Unsupported operand types: array ** stdClass Unsupported operand types: array ** resource -Unsupported operand types: object ** array -Unsupported operand types: object ** object -Unsupported operand types: object ** resource +Unsupported operand types: stdClass ** array +Unsupported operand types: stdClass ** stdClass +Unsupported operand types: stdClass ** resource Unsupported operand types: resource ** array -Unsupported operand types: resource ** object +Unsupported operand types: resource ** stdClass Unsupported operand types: resource ** resource Unsupported operand types: array ** null Unsupported operand types: null ** array @@ -1130,21 +1130,21 @@ Unsupported operand types: string ** array Unsupported operand types: array ** string Warning: A non-numeric value encountered Unsupported operand types: string ** array -Unsupported operand types: object ** null -Unsupported operand types: null ** object -Unsupported operand types: object ** bool -Unsupported operand types: bool ** object -Unsupported operand types: object ** bool -Unsupported operand types: bool ** object -Unsupported operand types: object ** int -Unsupported operand types: int ** object -Unsupported operand types: object ** float -Unsupported operand types: float ** object -Unsupported operand types: object ** string -Unsupported operand types: string ** object -Unsupported operand types: object ** string +Unsupported operand types: stdClass ** null +Unsupported operand types: null ** stdClass +Unsupported operand types: stdClass ** bool +Unsupported operand types: bool ** stdClass +Unsupported operand types: stdClass ** bool +Unsupported operand types: bool ** stdClass +Unsupported operand types: stdClass ** int +Unsupported operand types: int ** stdClass +Unsupported operand types: stdClass ** float +Unsupported operand types: float ** stdClass +Unsupported operand types: stdClass ** string +Unsupported operand types: string ** stdClass +Unsupported operand types: stdClass ** string Warning: A non-numeric value encountered -Unsupported operand types: string ** object +Unsupported operand types: string ** stdClass Unsupported operand types: resource ** null Unsupported operand types: null ** resource Unsupported operand types: resource ** bool @@ -1161,13 +1161,13 @@ Unsupported operand types: resource ** string Warning: A non-numeric value encountered Unsupported operand types: string ** resource Unsupported operand types: array << array -Unsupported operand types: array << object +Unsupported operand types: array << stdClass Unsupported operand types: array << resource -Unsupported operand types: object << array -Unsupported operand types: object << object -Unsupported operand types: object << resource +Unsupported operand types: stdClass << array +Unsupported operand types: stdClass << stdClass +Unsupported operand types: stdClass << resource Unsupported operand types: resource << array -Unsupported operand types: resource << object +Unsupported operand types: resource << stdClass Unsupported operand types: resource << resource Unsupported operand types: array << null Unsupported operand types: null << array @@ -1184,21 +1184,21 @@ Unsupported operand types: string << array Unsupported operand types: array << string Warning: A non-numeric value encountered Unsupported operand types: string << array -Unsupported operand types: object << null -Unsupported operand types: null << object -Unsupported operand types: object << bool -Unsupported operand types: bool << object -Unsupported operand types: object << bool -Unsupported operand types: bool << object -Unsupported operand types: object << int -Unsupported operand types: int << object -Unsupported operand types: object << float -Unsupported operand types: float << object -Unsupported operand types: object << string -Unsupported operand types: string << object -Unsupported operand types: object << string +Unsupported operand types: stdClass << null +Unsupported operand types: null << stdClass +Unsupported operand types: stdClass << bool +Unsupported operand types: bool << stdClass +Unsupported operand types: stdClass << bool +Unsupported operand types: bool << stdClass +Unsupported operand types: stdClass << int +Unsupported operand types: int << stdClass +Unsupported operand types: stdClass << float +Unsupported operand types: float << stdClass +Unsupported operand types: stdClass << string +Unsupported operand types: string << stdClass +Unsupported operand types: stdClass << string Warning: A non-numeric value encountered -Unsupported operand types: string << object +Unsupported operand types: string << stdClass Unsupported operand types: resource << null Unsupported operand types: null << resource Unsupported operand types: resource << bool @@ -1215,13 +1215,13 @@ Unsupported operand types: resource << string Warning: A non-numeric value encountered Unsupported operand types: string << resource Unsupported operand types: array >> array -Unsupported operand types: array >> object +Unsupported operand types: array >> stdClass Unsupported operand types: array >> resource -Unsupported operand types: object >> array -Unsupported operand types: object >> object -Unsupported operand types: object >> resource +Unsupported operand types: stdClass >> array +Unsupported operand types: stdClass >> stdClass +Unsupported operand types: stdClass >> resource Unsupported operand types: resource >> array -Unsupported operand types: resource >> object +Unsupported operand types: resource >> stdClass Unsupported operand types: resource >> resource Unsupported operand types: array >> null Unsupported operand types: null >> array @@ -1238,21 +1238,21 @@ Unsupported operand types: string >> array Unsupported operand types: array >> string Warning: A non-numeric value encountered Unsupported operand types: string >> array -Unsupported operand types: object >> null -Unsupported operand types: null >> object -Unsupported operand types: object >> bool -Unsupported operand types: bool >> object -Unsupported operand types: object >> bool -Unsupported operand types: bool >> object -Unsupported operand types: object >> int -Unsupported operand types: int >> object -Unsupported operand types: object >> float -Unsupported operand types: float >> object -Unsupported operand types: object >> string -Unsupported operand types: string >> object -Unsupported operand types: object >> string +Unsupported operand types: stdClass >> null +Unsupported operand types: null >> stdClass +Unsupported operand types: stdClass >> bool +Unsupported operand types: bool >> stdClass +Unsupported operand types: stdClass >> bool +Unsupported operand types: bool >> stdClass +Unsupported operand types: stdClass >> int +Unsupported operand types: int >> stdClass +Unsupported operand types: stdClass >> float +Unsupported operand types: float >> stdClass +Unsupported operand types: stdClass >> string +Unsupported operand types: string >> stdClass +Unsupported operand types: stdClass >> string Warning: A non-numeric value encountered -Unsupported operand types: string >> object +Unsupported operand types: string >> stdClass Unsupported operand types: resource >> null Unsupported operand types: null >> resource Unsupported operand types: resource >> bool @@ -1269,13 +1269,13 @@ Unsupported operand types: resource >> string Warning: A non-numeric value encountered Unsupported operand types: string >> resource Unsupported operand types: array & array -Unsupported operand types: array & object +Unsupported operand types: array & stdClass Unsupported operand types: array & resource -Unsupported operand types: object & array -Unsupported operand types: object & object -Unsupported operand types: object & resource +Unsupported operand types: stdClass & array +Unsupported operand types: stdClass & stdClass +Unsupported operand types: stdClass & resource Unsupported operand types: resource & array -Unsupported operand types: resource & object +Unsupported operand types: resource & stdClass Unsupported operand types: resource & resource Unsupported operand types: array & null Unsupported operand types: null & array @@ -1292,21 +1292,21 @@ Unsupported operand types: string & array Unsupported operand types: array & string Warning: A non-numeric value encountered Unsupported operand types: string & array -Unsupported operand types: object & null -Unsupported operand types: null & object -Unsupported operand types: object & bool -Unsupported operand types: bool & object -Unsupported operand types: object & bool -Unsupported operand types: bool & object -Unsupported operand types: object & int -Unsupported operand types: int & object -Unsupported operand types: object & float -Unsupported operand types: float & object -Unsupported operand types: object & string -Unsupported operand types: string & object -Unsupported operand types: object & string +Unsupported operand types: stdClass & null +Unsupported operand types: null & stdClass +Unsupported operand types: stdClass & bool +Unsupported operand types: bool & stdClass +Unsupported operand types: stdClass & bool +Unsupported operand types: bool & stdClass +Unsupported operand types: stdClass & int +Unsupported operand types: int & stdClass +Unsupported operand types: stdClass & float +Unsupported operand types: float & stdClass +Unsupported operand types: stdClass & string +Unsupported operand types: string & stdClass +Unsupported operand types: stdClass & string Warning: A non-numeric value encountered -Unsupported operand types: string & object +Unsupported operand types: string & stdClass Unsupported operand types: resource & null Unsupported operand types: null & resource Unsupported operand types: resource & bool @@ -1323,13 +1323,13 @@ Unsupported operand types: resource & string Warning: A non-numeric value encountered Unsupported operand types: string & resource Unsupported operand types: array | array -Unsupported operand types: array | object +Unsupported operand types: array | stdClass Unsupported operand types: array | resource -Unsupported operand types: object | array -Unsupported operand types: object | object -Unsupported operand types: object | resource +Unsupported operand types: stdClass | array +Unsupported operand types: stdClass | stdClass +Unsupported operand types: stdClass | resource Unsupported operand types: resource | array -Unsupported operand types: resource | object +Unsupported operand types: resource | stdClass Unsupported operand types: resource | resource Unsupported operand types: array | null Unsupported operand types: null | array @@ -1346,21 +1346,21 @@ Unsupported operand types: string | array Unsupported operand types: array | string Warning: A non-numeric value encountered Unsupported operand types: string | array -Unsupported operand types: object | null -Unsupported operand types: null | object -Unsupported operand types: object | bool -Unsupported operand types: bool | object -Unsupported operand types: object | bool -Unsupported operand types: bool | object -Unsupported operand types: object | int -Unsupported operand types: int | object -Unsupported operand types: object | float -Unsupported operand types: float | object -Unsupported operand types: object | string -Unsupported operand types: string | object -Unsupported operand types: object | string +Unsupported operand types: stdClass | null +Unsupported operand types: null | stdClass +Unsupported operand types: stdClass | bool +Unsupported operand types: bool | stdClass +Unsupported operand types: stdClass | bool +Unsupported operand types: bool | stdClass +Unsupported operand types: stdClass | int +Unsupported operand types: int | stdClass +Unsupported operand types: stdClass | float +Unsupported operand types: float | stdClass +Unsupported operand types: stdClass | string +Unsupported operand types: string | stdClass +Unsupported operand types: stdClass | string Warning: A non-numeric value encountered -Unsupported operand types: string | object +Unsupported operand types: string | stdClass Unsupported operand types: resource | null Unsupported operand types: null | resource Unsupported operand types: resource | bool @@ -1377,13 +1377,13 @@ Unsupported operand types: resource | string Warning: A non-numeric value encountered Unsupported operand types: string | resource Unsupported operand types: array ^ array -Unsupported operand types: array ^ object +Unsupported operand types: array ^ stdClass Unsupported operand types: array ^ resource -Unsupported operand types: object ^ array -Unsupported operand types: object ^ object -Unsupported operand types: object ^ resource +Unsupported operand types: stdClass ^ array +Unsupported operand types: stdClass ^ stdClass +Unsupported operand types: stdClass ^ resource Unsupported operand types: resource ^ array -Unsupported operand types: resource ^ object +Unsupported operand types: resource ^ stdClass Unsupported operand types: resource ^ resource Unsupported operand types: array ^ null Unsupported operand types: null ^ array @@ -1400,21 +1400,21 @@ Unsupported operand types: string ^ array Unsupported operand types: array ^ string Warning: A non-numeric value encountered Unsupported operand types: string ^ array -Unsupported operand types: object ^ null -Unsupported operand types: null ^ object -Unsupported operand types: object ^ bool -Unsupported operand types: bool ^ object -Unsupported operand types: object ^ bool -Unsupported operand types: bool ^ object -Unsupported operand types: object ^ int -Unsupported operand types: int ^ object -Unsupported operand types: object ^ float -Unsupported operand types: float ^ object -Unsupported operand types: object ^ string -Unsupported operand types: string ^ object -Unsupported operand types: object ^ string +Unsupported operand types: stdClass ^ null +Unsupported operand types: null ^ stdClass +Unsupported operand types: stdClass ^ bool +Unsupported operand types: bool ^ stdClass +Unsupported operand types: stdClass ^ bool +Unsupported operand types: bool ^ stdClass +Unsupported operand types: stdClass ^ int +Unsupported operand types: int ^ stdClass +Unsupported operand types: stdClass ^ float +Unsupported operand types: float ^ stdClass +Unsupported operand types: stdClass ^ string +Unsupported operand types: string ^ stdClass +Unsupported operand types: stdClass ^ string Warning: A non-numeric value encountered -Unsupported operand types: string ^ object +Unsupported operand types: string ^ stdClass Unsupported operand types: resource ^ null Unsupported operand types: null ^ resource Unsupported operand types: resource ^ bool @@ -1504,14 +1504,14 @@ No error for "foo" .= STDOUT UNARY OP: Cannot perform bitwise not on array -Cannot perform bitwise not on object +Cannot perform bitwise not on stdClass Cannot perform bitwise not on resource INCDEC: Cannot increment array Cannot decrement array -Cannot increment object -Cannot decrement object +Cannot increment stdClass +Cannot decrement stdClass Cannot increment resource Cannot decrement resource diff --git a/Zend/tests/throw/001.phpt b/Zend/tests/throw/001.phpt index deb8743ab566..ba2406c6d388 100644 --- a/Zend/tests/throw/001.phpt +++ b/Zend/tests/throw/001.phpt @@ -167,7 +167,7 @@ string(3) "bar" string(11) "exception 1" bool(true) string(20) "false ? true : throw" -string(39) "Unsupported operand types: object + int" +string(42) "Unsupported operand types: Exception + int" string(35) "throw $exception = new Exception();" string(37) "throw $exception ??= new Exception();" string(30) "throw null ?? new Exception();" diff --git a/Zend/tests/type_declarations/scalar_return_basic.phpt b/Zend/tests/type_declarations/scalar_return_basic.phpt index 8e353a043b10..5ecd53384056 100644 --- a/Zend/tests/type_declarations/scalar_return_basic.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic.phpt @@ -93,10 +93,10 @@ int(0) *** Caught {closure}(): Return value must be of type int, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught {closure}(): Return value must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught {closure}(): Return value must be of type int, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type int, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Return value must be of type int, resource returned in %s on line %d @@ -131,10 +131,10 @@ float(0) *** Caught {closure}(): Return value must be of type float, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught {closure}(): Return value must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught {closure}(): Return value must be of type float, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type float, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Return value must be of type float, resource returned in %s on line %d @@ -168,7 +168,7 @@ string(0) "" *** Caught {closure}(): Return value must be of type string, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught {closure}(): Return value must be of type string, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type string, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } string(6) "foobar" @@ -205,10 +205,10 @@ bool(false) *** Caught {closure}(): Return value must be of type bool, array returned in %s on line %d *** Trying object(stdClass)#6 (0) { } -*** Caught {closure}(): Return value must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, stdClass returned in %s on line %d *** Trying object(StringCapable)#7 (0) { } -*** Caught {closure}(): Return value must be of type bool, object returned in %s on line %d +*** Caught {closure}(): Return value must be of type bool, StringCapable returned in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Return value must be of type bool, resource returned in %s on line %d diff --git a/Zend/tests/type_declarations/scalar_strict.phpt b/Zend/tests/type_declarations/scalar_strict.phpt index 3c420ed4551b..6d838848e902 100644 --- a/Zend/tests/type_declarations/scalar_strict.phpt +++ b/Zend/tests/type_declarations/scalar_strict.phpt @@ -98,11 +98,11 @@ int(2147483647) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($i) must be of type int, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d @@ -151,11 +151,11 @@ float(NAN) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($f) must be of type float, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d @@ -204,11 +204,11 @@ string(0) "" *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($s) must be of type string, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d @@ -257,11 +257,11 @@ bool(false) *** Trying object(stdClass)#5 (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying object(StringCapable)#6 (0) { } -*** Caught {closure}(): Argument #1 ($b) must be of type bool, object given, called in %s on line %d +*** Caught {closure}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d *** Trying resource(5) of type (stream) *** Caught {closure}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d diff --git a/Zend/zend_API.c b/Zend/zend_API.c index cb8446d2ea88..5aa249611806 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -140,6 +140,22 @@ ZEND_API const char *zend_zval_type_name(const zval *arg) /* {{{ */ } /* }}} */ +ZEND_API const char *zend_zval_type_error_name(const zval *arg) /* {{{ */ +{ + ZVAL_DEREF(arg); + + if (Z_ISUNDEF_P(arg)) { + return "null"; + } + + if (Z_TYPE_P(arg) == IS_OBJECT) { + return ZSTR_VAL(Z_OBJCE_P(arg)->name); + } + + return zend_get_type_by_const(Z_TYPE_P(arg)); +} +/* }}} */ + /* This API exists *only* for use in gettype(). * For anything else, you likely want zend_zval_type_name(). */ ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg) /* {{{ */ @@ -220,7 +236,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z return; } - zend_argument_type_error(num, "must 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_error_name(arg)); } /* }}} */ @@ -230,7 +246,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, return; } - zend_argument_type_error(num, "must 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_error_name(arg)); } /* }}} */ @@ -240,7 +256,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(i return; } - zend_argument_type_error(num, "must 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_error_name(arg)); } /* }}} */ @@ -607,7 +623,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec size_t *pl = va_arg(*va, size_t *); if (!zend_parse_arg_path(arg, p, pl, check_null)) { zend_spprintf(error, 0, "a valid path%s, %s given", - check_null ? " or null" : "", zend_zval_type_name(arg) + check_null ? " or null" : "", zend_zval_type_error_name(arg) ); return ""; } @@ -619,7 +635,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec zend_string **str = va_arg(*va, zend_string **); if (!zend_parse_arg_path_str(arg, str, check_null)) { zend_spprintf(error, 0, "a valid path%s, %s given", - check_null ? " or null" : "", zend_zval_type_name(arg) + check_null ? " or null" : "", zend_zval_type_error_name(arg) ); return ""; } @@ -700,7 +716,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec if (!zend_parse_arg_object(arg, p, ce, check_null)) { if (ce) { if (check_null) { - zend_spprintf(error, 0, "of type ?%s, %s given", ZSTR_VAL(ce->name), zend_zval_type_name(arg)); + zend_spprintf(error, 0, "of type ?%s, %s given", ZSTR_VAL(ce->name), zend_zval_type_error_name(arg)); return ""; } else { return ZSTR_VAL(ce->name); @@ -811,7 +827,7 @@ static int zend_parse_arg(uint32_t arg_num, zval *arg, va_list *va, const char * zend_argument_type_error(arg_num, "must be %s", error); efree(error); } else { - zend_argument_type_error(arg_num, "must 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_error_name(arg)); } } else if (error) { efree(error); diff --git a/Zend/zend_API.h b/Zend/zend_API.h index 44d43d46dedc..2512959136ba 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -301,6 +301,7 @@ ZEND_API int zend_parse_parameters_ex(int flags, uint32_t num_args, const char * #define zend_parse_parameters_throw(num_args, ...) \ zend_parse_parameters(num_args, __VA_ARGS__) ZEND_API const char *zend_zval_type_name(const zval *arg); +ZEND_API const char *zend_zval_type_error_name(const zval *arg); ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg); ZEND_API int zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec, ...); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 9062cf6f5c3c..cd80c430b009 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -986,7 +986,7 @@ ZEND_FUNCTION(method_exists) RETURN_FALSE; } } else { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(klass)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(klass)); RETURN_THROWS(); } @@ -1043,7 +1043,7 @@ ZEND_FUNCTION(property_exists) } else if (Z_TYPE_P(object) == IS_OBJECT) { ce = Z_OBJCE_P(object); } else { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(object)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(object)); RETURN_THROWS(); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index d8a54dbd44e5..4dc87647f7c6 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6437,7 +6437,7 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags) / } else { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as default value for property %s::$%s of type %s", - zend_zval_type_name(&value_zv), + zend_zval_type_error_name(&value_zv), ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(str)); } } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 0061910b1943..33d073cd1611 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -663,11 +663,7 @@ static ZEND_COLD void zend_verify_type_error_common( *need_msg = zend_type_to_string_resolved(arg_info->type, zf->common.scope); if (value) { - if (Z_TYPE_P(value) == IS_OBJECT) { - *given_kind = ZSTR_VAL(Z_OBJCE_P(value)->name); - } else { - *given_kind = zend_zval_type_name(value); - } + *given_kind = zend_zval_type_error_name(value); } else { *given_kind = "none"; } @@ -847,7 +843,7 @@ ZEND_COLD zend_never_inline void zend_verify_property_type_error(zend_property_i type_str = zend_type_to_string(info->type); zend_type_error("Cannot assign %s to property %s::$%s of type %s", - Z_TYPE_P(property) == IS_OBJECT ? ZSTR_VAL(Z_OBJCE_P(property)->name) : zend_zval_type_name(property), + zend_zval_type_error_name(property), ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name), ZSTR_VAL(type_str)); @@ -1233,7 +1229,7 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret) if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_VOID) { if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) { - zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); + zend_verify_void_return_error(zf, zend_zval_type_error_name(ret), ""); return 0; } return 1; @@ -2365,7 +2361,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z } if (!is_list && type != BP_VAR_IS) { zend_error(E_WARNING, "Trying to access array offset on value of type %s", - zend_zval_type_name(container)); + zend_zval_type_error_name(container)); } ZVAL_NULL(result); } @@ -2564,7 +2560,7 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( } if (!EG(exception)) { zend_type_error("array_key_exists(): Argument #2 ($array) must be of type array, %s given", - zend_zval_type_name(subject)); + zend_zval_type_error_name(subject)); } } @@ -2950,7 +2946,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1 zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Reference with value of type %s held by property %s::$%s of type %s is not compatible with property %s::$%s of type %s", - Z_TYPE_P(zv) == IS_OBJECT ? ZSTR_VAL(Z_OBJCE_P(zv)->name) : zend_zval_type_name(zv), + zend_zval_type_error_name(zv), ZSTR_VAL(prop1->ce->name), zend_get_unmangled_property_name(prop1->name), ZSTR_VAL(type1_str), @@ -2965,7 +2961,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1 ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(zend_property_info *prop, zval *zv) { zend_string *type_str = zend_type_to_string(prop->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s", - Z_TYPE_P(zv) == IS_OBJECT ? ZSTR_VAL(Z_OBJCE_P(zv)->name) : zend_zval_type_name(zv), + zend_zval_type_error_name(zv), ZSTR_VAL(prop->ce->name), zend_get_unmangled_property_name(prop->name), ZSTR_VAL(type_str) @@ -2977,7 +2973,7 @@ ZEND_API ZEND_COLD void zend_throw_conflicting_coercion_error(zend_property_info zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s and property %s::$%s of type %s, as this would result in an inconsistent type conversion", - Z_TYPE_P(zv) == IS_OBJECT ? ZSTR_VAL(Z_OBJCE_P(zv)->name) : zend_zval_type_name(zv), + zend_zval_type_error_name(zv), ZSTR_VAL(prop1->ce->name), zend_get_unmangled_property_name(prop1->name), ZSTR_VAL(type1_str), diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index c8360fbf3951..af6c4dc4c03f 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -936,7 +936,7 @@ static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const cha } zend_type_error("Unsupported operand types: %s %s %s", - zend_zval_type_name(op1), operator, zend_zval_type_name(op2)); + zend_zval_type_error_name(op1), operator, zend_zval_type_error_name(op2)); } /* }}} */ @@ -1468,7 +1468,7 @@ ZEND_API int ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1) /* {{{ if (result != op1) { ZVAL_UNDEF(result); } - zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_name(op1)); + zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_error_name(op1)); return FAILURE; } } @@ -2375,7 +2375,7 @@ ZEND_API int ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ /* break missing intentionally */ case IS_RESOURCE: case IS_ARRAY: - zend_type_error("Cannot increment %s", zend_zval_type_name(op1)); + zend_type_error("Cannot increment %s", zend_zval_type_error_name(op1)); return FAILURE; EMPTY_SWITCH_DEFAULT_CASE() } @@ -2437,7 +2437,7 @@ ZEND_API int ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ /* break missing intentionally */ case IS_RESOURCE: case IS_ARRAY: - zend_type_error("Cannot decrement %s", zend_zval_type_name(op1)); + zend_type_error("Cannot decrement %s", zend_zval_type_error_name(op1)); return FAILURE; EMPTY_SWITCH_DEFAULT_CASE() } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index b8b0dc5e3a80..6c845fa22ab7 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3695,7 +3695,7 @@ ZEND_VM_C_LABEL(try_function_name): } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_name(function_name)); + zend_zval_type_error_name(function_name)); call = NULL; } @@ -4932,7 +4932,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM) ZEND_VM_C_GOTO(send_array); } } - zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_name(args)); + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_error_name(args)); FREE_UNFETCHED_OP2(); FREE_OP1(); HANDLE_EXCEPTION(); @@ -6186,7 +6186,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR) } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; FREE_OP1(); @@ -6275,7 +6275,7 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (OP1_TYPE == IS_VAR) { @@ -6585,7 +6585,7 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR) value_type = Z_TYPE_INFO_P(value); } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array)); if (UNEXPECTED(EG(exception))) { UNDEF_RESULT(); HANDLE_EXCEPTION(); @@ -7915,7 +7915,7 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -8010,7 +8010,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, CV|TMPVAR|UNUSED|CLASS_FETCH, ANY) if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); FREE_OP1(); HANDLE_EXCEPTION(); @@ -8522,7 +8522,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 16779b66167d..6865ddd3ea09 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1977,7 +1977,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(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_name(args)); + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_error_name(args)); FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var); FREE_OP(opline->op1_type, opline->op1.var); HANDLE_EXCEPTION(); @@ -2900,7 +2900,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_H } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_name(function_name)); + zend_zval_type_error_name(function_name)); call = NULL; } @@ -3067,7 +3067,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_ } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_name(function_name)); + zend_zval_type_error_name(function_name)); call = NULL; } @@ -3185,7 +3185,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HAND } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_name(function_name)); + zend_zval_type_error_name(function_name)); call = NULL; } @@ -4094,7 +4094,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER( } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; @@ -4182,7 +4182,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_ } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_CONST == IS_VAR) { @@ -4471,7 +4471,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -9340,7 +9340,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -13312,7 +13312,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -13369,7 +13369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_H if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -16418,7 +16418,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -17691,7 +17691,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -17779,7 +17779,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_TMP_VAR == IS_VAR) { @@ -20351,7 +20351,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -20440,7 +20440,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_VAR == IS_VAR) { @@ -20750,7 +20750,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z value_type = Z_TYPE_INFO_P(value); } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array)); if (UNEXPECTED(EG(exception))) { UNDEF_RESULT(); HANDLE_EXCEPTION(); @@ -29108,7 +29108,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_H if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); @@ -33313,7 +33313,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -36339,7 +36339,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; @@ -36427,7 +36427,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_CV == IS_VAR) { @@ -36707,7 +36707,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -36764,7 +36764,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_CV_HANDL if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); @@ -45263,7 +45263,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 575c1294221f..83a55bc0c7cc 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -408,7 +408,7 @@ PHP_FUNCTION(bzopen) stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); } else { - zend_argument_type_error(1, "must be of type string or file-resource, %s given", zend_zval_type_name(file)); + zend_argument_type_error(1, "must be of type string or file-resource, %s given", zend_zval_type_error_name(file)); RETURN_THROWS(); } diff --git a/ext/date/tests/014.phpt b/ext/date/tests/014.phpt index a2f81090e77e..acb641beb0c7 100644 --- a/ext/date/tests/014.phpt +++ b/ext/date/tests/014.phpt @@ -33,7 +33,7 @@ object(DateTimeZone)#%d (2) { } int(0) -Fatal error: Uncaught TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, object given in %s:%d +Fatal error: Uncaught TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, DateTime given in %s:%d Stack trace: #0 %s(%d): timezone_offset_get(Object(DateTime), Object(DateTimeZone)) #1 {main} diff --git a/ext/date/tests/DateTimeImmutable_createFromMutable.phpt b/ext/date/tests/DateTimeImmutable_createFromMutable.phpt index 3ac17de49f0c..4f542c82c800 100644 --- a/ext/date/tests/DateTimeImmutable_createFromMutable.phpt +++ b/ext/date/tests/DateTimeImmutable_createFromMutable.phpt @@ -24,4 +24,4 @@ object(DateTimeImmutable)#%d (3) { ["timezone"]=> string(13) "Europe/London" } -DateTimeImmutable::createFromMutable(): Argument #1 ($object) must be of type DateTime, object given +DateTimeImmutable::createFromMutable(): Argument #1 ($object) must be of type DateTime, DateTimeImmutable given diff --git a/ext/date/tests/DateTime_createFromImmutable.phpt b/ext/date/tests/DateTime_createFromImmutable.phpt index 6407333f0688..59f61922141b 100644 --- a/ext/date/tests/DateTime_createFromImmutable.phpt +++ b/ext/date/tests/DateTime_createFromImmutable.phpt @@ -30,4 +30,4 @@ object(DateTime)#%d (3) { string(13) "Europe/London" } bool(true) -DateTime::createFromImmutable(): Argument #1 ($object) must be of type DateTimeImmutable, object given +DateTime::createFromImmutable(): Argument #1 ($object) must be of type DateTimeImmutable, DateTime given diff --git a/ext/date/tests/bug70245.phpt b/ext/date/tests/bug70245.phpt index b45e8be93116..58e7f10e1302 100644 --- a/ext/date/tests/bug70245.phpt +++ b/ext/date/tests/bug70245.phpt @@ -10,4 +10,4 @@ try { } ?> --EXPECT-- -strtotime(): Argument #2 ($now) must be of type ?int, object given +strtotime(): Argument #2 ($now) must be of type ?int, DateTime given diff --git a/ext/date/tests/microtime_error.phpt b/ext/date/tests/microtime_error.phpt index 9ab11355e8b3..1b13e62b2549 100644 --- a/ext/date/tests/microtime_error.phpt +++ b/ext/date/tests/microtime_error.phpt @@ -51,7 +51,7 @@ microtime(): Argument #1 ($get_as_float) must be of type bool, array given --> bad arg: object(stdClass)#%d (0) { } -microtime(): Argument #1 ($get_as_float) must be of type bool, object given +microtime(): Argument #1 ($get_as_float) must be of type bool, stdClass given --> bad arg: int(1) float(%s) diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index 864dc54c2a9f..2d2f032dfdbe 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -65,7 +65,7 @@ try { *** Testing timezone_offset_get() : error conditions *** -- Testing timezone_offset_get() function with an invalid values for $object argument -- -string(87) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, object given" +string(89) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, stdClass given" string(84) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, int given" @@ -73,7 +73,7 @@ string(85) "timezone_offset_get(): Argument #1 ($object) must be of type DateTim -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- -string(94) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, object given" +string(96) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, stdClass given" string(91) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, int given" diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index a7627cb84c1c..b8c67b04f524 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -187,7 +187,7 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod } else { xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_error_name(&nodes[i])); return NULL; } } else if (Z_TYPE(nodes[i]) == IS_STRING) { @@ -203,7 +203,7 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod } else { xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_error_name(&nodes[i])); return NULL; } diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index a5e5f5048588..0823f2892b88 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1292,7 +1292,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_TIMEOUT_SEC: if (Z_TYPE_P(z_value) != IS_LONG) { php_error_docref(NULL, E_WARNING, "Option TIMEOUT_SEC expects value of type int, %s given", - zend_zval_type_name(z_value)); + zend_zval_type_error_name(z_value)); RETURN_FALSE; } if (Z_LVAL_P(z_value) <= 0) { @@ -1305,7 +1305,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_AUTOSEEK: if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) { php_error_docref(NULL, E_WARNING, "Option AUTOSEEK expects value of type bool, %s given", - zend_zval_type_name(z_value)); + zend_zval_type_error_name(z_value)); RETURN_FALSE; } ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; @@ -1314,7 +1314,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_USEPASVADDRESS: if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) { php_error_docref(NULL, E_WARNING, "Option USEPASVADDRESS expects value of type bool, %s given", - zend_zval_type_name(z_value)); + zend_zval_type_error_name(z_value)); RETURN_FALSE; } ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 31ead3716379..4d1a897027be 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -861,12 +861,12 @@ PHP_FUNCTION(hash_equals) /* We only allow comparing string to prevent unexpected results. */ if (Z_TYPE_P(known_zval) != IS_STRING) { - zend_argument_type_error(1, "must be of type string, %s given", zend_zval_type_name(known_zval)); + zend_argument_type_error(1, "must be of type string, %s given", zend_zval_type_error_name(known_zval)); RETURN_THROWS(); } if (Z_TYPE_P(user_zval) != IS_STRING) { - zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_name(user_zval)); + zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_error_name(user_zval)); RETURN_THROWS(); } diff --git a/ext/intl/tests/bug48227.phpt b/ext/intl/tests/bug48227.phpt index a1e66f99e9de..d44b5fc28280 100644 --- a/ext/intl/tests/bug48227.phpt +++ b/ext/intl/tests/bug48227.phpt @@ -19,4 +19,4 @@ foreach (['', 1, NULL, $x] as $value) { NumberFormatter::format(): Argument #1 ($value) must be of type int|float, string given string(1) "1" string(1) "0" -NumberFormatter::format(): Argument #1 ($value) must be of type int|float, object given +NumberFormatter::format(): Argument #1 ($value) must be of type int|float, NumberFormatter given diff --git a/ext/intl/tests/calendar_equals_error.phpt b/ext/intl/tests/calendar_equals_error.phpt index 9da547fe5a27..dbed3349622f 100644 --- a/ext/intl/tests/calendar_equals_error.phpt +++ b/ext/intl/tests/calendar_equals_error.phpt @@ -47,7 +47,7 @@ try { --EXPECT-- error: 0, IntlCalendar::equals() expects exactly 1 parameter, 0 given -error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, object given +error: 0, IntlCalendar::equals(): Argument #1 ($calendar) must be of type IntlCalendar, stdClass given error: 0, IntlCalendar::equals() expects exactly 1 parameter, 2 given diff --git a/ext/libxml/tests/004.phpt b/ext/libxml/tests/004.phpt index 93c3c497a29d..e3cb4bb5679c 100644 --- a/ext/libxml/tests/004.phpt +++ b/ext/libxml/tests/004.phpt @@ -34,7 +34,7 @@ libxml_set_streams_context(): Argument #1 ($context) must be of type resource, s bool(true) libxml_set_streams_context(): Argument #1 ($context) must be of type resource, int given bool(true) -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, object given +libxml_set_streams_context(): Argument #1 ($context) must be of type resource, stdClass given bool(true) libxml_set_streams_context(): Argument #1 ($context) must be of type resource, array given bool(true) diff --git a/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt b/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt index 3abb5c23bae0..4a7455d2a1ed 100644 --- a/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt +++ b/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt @@ -166,9 +166,9 @@ ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must --heredoc-- ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must be 'none', 'long', 'entity' or a valid codepoint --instance of classWithToString-- -TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, object given +TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, classWithToString given --instance of classWithoutToString-- -TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, object given +TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, classWithoutToString given --undefined var-- int(12345) --unset var-- diff --git a/ext/mbstring/tests/mb_substitute_character_variation_weak_types.phpt b/ext/mbstring/tests/mb_substitute_character_variation_weak_types.phpt index f9bf85a371f0..99b4288192b0 100644 --- a/ext/mbstring/tests/mb_substitute_character_variation_weak_types.phpt +++ b/ext/mbstring/tests/mb_substitute_character_variation_weak_types.phpt @@ -167,7 +167,7 @@ ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must --instance of classWithToString-- ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must be 'none', 'long', 'entity' or a valid codepoint --instance of classWithoutToString-- -TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, object given +TypeError: mb_substitute_character(): Argument #1 ($substitute_character) must be of type string|int|null, classWithoutToString given --undefined var-- int(0) --unset var-- diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index eb3c79b7985a..2d7955b5b782 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1244,7 +1244,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags * single value is an array. Also we'd have to make that one * argument passed by reference. */ - zend_argument_error(zend_ce_exception, 3, "must be of type array, %s given", zend_zval_type_name(ctor_params)); + zend_argument_error(zend_ce_exception, 3, "must be of type array, %s given", zend_zval_type_error_name(ctor_params)); RETURN_THROWS(); } } diff --git a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt index 341a08ef7923..564751a25bab 100644 --- a/ext/mysqli/tests/mysqli_fetch_object_oo.phpt +++ b/ext/mysqli/tests/mysqli_fetch_object_oo.phpt @@ -130,7 +130,7 @@ require_once('skipifconnectfailure.inc'); ?> --EXPECTF-- mysqli object is not fully initialized -[0] mysqli_result::fetch_object(): Argument #1 ($class_name) must be of type string, object given in %s on line %d +[0] mysqli_result::fetch_object(): Argument #1 ($class_name) must be of type string, mysqli given in %s on line %d [0] mysqli_result::fetch_object() expects at most 2 parameters, 3 given in %s on line %d [0] mysqli_result::fetch_object(): Argument #2 ($params) must be of type array, null given in %s on line %d Exception: Too few arguments to function mysqli_fetch_object_construct::__construct(), 1 passed and exactly 2 expected diff --git a/ext/opcache/tests/iterable_type_optimization.phpt b/ext/opcache/tests/iterable_type_optimization.phpt index ed836ffd5acd..146e1544e6b1 100644 --- a/ext/opcache/tests/iterable_type_optimization.phpt +++ b/ext/opcache/tests/iterable_type_optimization.phpt @@ -10,7 +10,7 @@ test(new stdClass); ?> --EXPECTF-- -Fatal error: Uncaught TypeError: test(): Return value must be of type iterable, object returned in %s:%d +Fatal error: Uncaught TypeError: test(): Return value must be of type iterable, stdClass returned in %s:%d Stack trace: #0 %s(%d): test(Object(stdClass)) #1 {main} diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index 9f67bff14cc9..b82370d6c571 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2302,7 +2302,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter) } } else { if (Z_TYPE_P(regex) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array when argument #2 ($replace) is an array, %s given", zend_zval_type_name(regex)); + zend_argument_type_error(1, "must be of type array when argument #2 ($replace) is an array, %s given", zend_zval_type_error_name(regex)); RETURN_THROWS(); } } diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index b3450beff71a..0d7b5e1b8b58 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -66,5 +66,5 @@ array(2) { [2]=> string(4) "test" } -preg_grep(): Argument #1 ($regex) must be of type string, object given +preg_grep(): Argument #1 ($regex) must be of type string, stdClass given Done diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt index e052327ceab9..055579cb6830 100644 --- a/ext/pcre/tests/preg_match_all_error1.phpt +++ b/ext/pcre/tests/preg_match_all_error1.phpt @@ -80,5 +80,5 @@ array(1) { string(1) "t" } } -preg_match_all(): Argument #1 ($pattern) must be of type string, object given +preg_match_all(): Argument #1 ($pattern) must be of type string, stdClass given NULL diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index b4540bf5da15..011ba6f97b52 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -60,4 +60,4 @@ preg_match(): Argument #1 ($pattern) must be of type string, array given Arg value is /[a-zA-Z]/ int(1) -preg_match(): Argument #1 ($pattern) must be of type string, object given +preg_match(): Argument #1 ($pattern) must be of type string, stdClass given diff --git a/ext/pcre/tests/preg_match_error2.phpt b/ext/pcre/tests/preg_match_error2.phpt index a03bcf4417b0..ebc91d97fd0f 100644 --- a/ext/pcre/tests/preg_match_error2.phpt +++ b/ext/pcre/tests/preg_match_error2.phpt @@ -36,5 +36,5 @@ int(1) Arg value is: Array preg_match(): Argument #2 ($subject) must be of type string, array given -preg_match(): Argument #2 ($subject) must be of type string, object given +preg_match(): Argument #2 ($subject) must be of type string, stdClass given Done diff --git a/ext/pcre/tests/preg_split_error1.phpt b/ext/pcre/tests/preg_split_error1.phpt index daf785276702..552b668082d5 100644 --- a/ext/pcre/tests/preg_split_error1.phpt +++ b/ext/pcre/tests/preg_split_error1.phpt @@ -67,4 +67,4 @@ array(3) { [2]=> string(4) " 5 6" } -preg_split(): Argument #1 ($pattern) must be of type string, object given +preg_split(): Argument #1 ($pattern) must be of type string, stdClass given diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 9aac065e38be..5af8bd59170c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2215,7 +2215,7 @@ ZEND_METHOD(ReflectionParameter, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_name(reference)); + zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_error_name(reference)); RETURN_THROWS(); } @@ -2923,7 +2923,7 @@ ZEND_METHOD(ReflectionMethod, __construct) if (classname == &ztmp) { zval_ptr_dtor_str(&ztmp); } - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); RETURN_THROWS(); } @@ -3457,7 +3457,7 @@ ZEND_METHOD(ReflectionClassConstant, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); RETURN_THROWS(); } @@ -4929,7 +4929,7 @@ ZEND_METHOD(ReflectionClass, isSubclassOf) } /* no break */ default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_name(class_name)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_error_name(class_name)); RETURN_THROWS(); } @@ -4971,7 +4971,7 @@ ZEND_METHOD(ReflectionClass, implementsInterface) } /* no break */ default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_name(interface)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_error_name(interface)); RETURN_THROWS(); } @@ -5152,7 +5152,7 @@ ZEND_METHOD(ReflectionProperty, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); RETURN_THROWS(); } @@ -6133,7 +6133,7 @@ ZEND_METHOD(ReflectionReference, fromArrayElement) } else if (Z_TYPE_P(key) == IS_STRING) { item = zend_symtable_find(ht, Z_STR_P(key)); } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(key)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(key)); RETURN_THROWS(); } diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index e48d43587e52..e5dce7536748 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -63,4 +63,4 @@ Method 1 does not exist Method 1.5 does not exist Method 1 does not exist ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, object given +ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index 86060c8acf11..61d29b89d70e 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -61,4 +61,4 @@ Property 1 does not exist Property 1.5 does not exist Property 1 does not exist ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, object given +ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionReference_errors.phpt b/ext/reflection/tests/ReflectionReference_errors.phpt index 88244b794037..0d1d63eb28b4 100644 --- a/ext/reflection/tests/ReflectionReference_errors.phpt +++ b/ext/reflection/tests/ReflectionReference_errors.phpt @@ -41,7 +41,7 @@ var_dump(unserialize('O:19:"ReflectionReference":0:{}')); ?> --EXPECTF-- Call to private ReflectionReference::__construct() from invalid context -ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, object given +ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, stdClass given ReflectionReference::fromArrayElement(): Argument #2 ($key) must be of type string|int, float given Array key not found Serialization of 'ReflectionReference' is not allowed diff --git a/ext/session/tests/session_set_save_handler_iface_002.phpt b/ext/session/tests/session_set_save_handler_iface_002.phpt index 6c1184995678..bae8ecb6259c 100644 --- a/ext/session/tests/session_set_save_handler_iface_002.phpt +++ b/ext/session/tests/session_set_save_handler_iface_002.phpt @@ -86,5 +86,5 @@ session_start(); --EXPECT-- *** Testing session_set_save_handler() function: interface wrong *** bool(true) -session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, object given +session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given good handler writing diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index b6b04cb269f4..a2045746cd42 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -93,7 +93,7 @@ PHP_FUNCTION(class_parents) } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); RETURN_THROWS(); } @@ -126,7 +126,7 @@ PHP_FUNCTION(class_implements) RETURN_THROWS(); } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); RETURN_THROWS(); } @@ -155,7 +155,7 @@ PHP_FUNCTION(class_uses) RETURN_THROWS(); } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); RETURN_THROWS(); } diff --git a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt index 12e632514e2b..ab9b430d2a7e 100644 --- a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt +++ b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt @@ -12,4 +12,4 @@ try { ?> --EXPECT-- -Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, object given +Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, SplFixedArray given diff --git a/ext/spl/tests/fixedarray_005.phpt b/ext/spl/tests/fixedarray_005.phpt index 573a995cb1fc..f726c9d956d5 100644 --- a/ext/spl/tests/fixedarray_005.phpt +++ b/ext/spl/tests/fixedarray_005.phpt @@ -23,6 +23,6 @@ try { ?> --EXPECT-- -Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, object given +Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, stdClass given Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index 21ab075cc92d..38dfde3f03d6 100644 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -83,8 +83,8 @@ NULL ===1=== object(stdClass)#%d (0) { } -CachingIterator::offsetExists(): Argument #1 ($index) must be of type string, object given -CachingIterator::offsetGet(): Argument #1 ($index) must be of type string, object given +CachingIterator::offsetExists(): Argument #1 ($index) must be of type string, stdClass given +CachingIterator::offsetGet(): Argument #1 ($index) must be of type string, stdClass given ===2=== object(MyFoo)#%d (0) { } @@ -124,8 +124,8 @@ int(0) ===1=== object(stdClass)#1 (0) { } -CachingIterator::offsetExists(): Argument #1 ($index) must be of type string, object given -CachingIterator::offsetGet(): Argument #1 ($index) must be of type string, object given +CachingIterator::offsetExists(): Argument #1 ($index) must be of type string, stdClass given +CachingIterator::offsetGet(): Argument #1 ($index) must be of type string, stdClass given ===2=== object(MyFoo)#2 (0) { } diff --git a/ext/spl/tests/recursive_tree_iterator_003.phpt b/ext/spl/tests/recursive_tree_iterator_003.phpt index 39a94ba8d32c..80225720f27b 100644 --- a/ext/spl/tests/recursive_tree_iterator_003.phpt +++ b/ext/spl/tests/recursive_tree_iterator_003.phpt @@ -9,4 +9,4 @@ try { } ?> --EXPECT-- -RecursiveCachingIterator::__construct(): Argument #1 ($iterator) must be of type RecursiveIterator, object given +RecursiveCachingIterator::__construct(): Argument #1 ($iterator) must be of type RecursiveIterator, ArrayIterator given diff --git a/ext/standard/array.c b/ext/standard/array.c index 51386148588e..71487e32652b 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1191,7 +1191,7 @@ PHP_FUNCTION(min) zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); RETURN_THROWS(); } else { if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) { @@ -1238,7 +1238,7 @@ PHP_FUNCTION(max) zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); RETURN_THROWS(); } else { if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) { @@ -3718,7 +3718,7 @@ static zend_always_inline void php_array_replace_wrapper(INTERNAL_FUNCTION_PARAM zval *arg = args + i; if (Z_TYPE_P(arg) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(arg)); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(arg)); RETURN_THROWS(); } } @@ -3762,7 +3762,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET zval *arg = args + i; if (Z_TYPE_P(arg) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(arg)); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(arg)); RETURN_THROWS(); } count += zend_hash_num_elements(Z_ARRVAL_P(arg)); @@ -4590,7 +4590,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } } @@ -4755,7 +4755,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -4997,7 +4997,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } } @@ -5162,7 +5162,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -5341,7 +5341,7 @@ PHP_FUNCTION(array_diff) ZEND_PARSE_PARAMETERS_END(); if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); RETURN_THROWS(); } @@ -5349,7 +5349,7 @@ PHP_FUNCTION(array_diff) if (num == 0) { for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } } @@ -5366,7 +5366,7 @@ PHP_FUNCTION(array_diff) if (!value) { for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } } @@ -5377,7 +5377,7 @@ PHP_FUNCTION(array_diff) for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } if (!found) { @@ -5407,7 +5407,7 @@ PHP_FUNCTION(array_diff) num = 0; for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); RETURN_THROWS(); } num += zend_hash_num_elements(Z_ARRVAL(args[i])); @@ -6056,7 +6056,7 @@ PHP_FUNCTION(array_map) int ret; if (Z_TYPE(arrays[0]) != IS_ARRAY) { - zend_argument_type_error(2, "must be of type array, %s given", zend_zval_type_name(&arrays[0])); + zend_argument_type_error(2, "must be of type array, %s given", zend_zval_type_error_name(&arrays[0])); RETURN_THROWS(); } maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0])); @@ -6097,7 +6097,7 @@ PHP_FUNCTION(array_map) for (i = 0; i < n_arrays; i++) { if (Z_TYPE(arrays[i]) != IS_ARRAY) { - zend_argument_type_error(i + 2, "must be of type array, %s given", zend_zval_type_name(&arrays[i])); + zend_argument_type_error(i + 2, "must be of type array, %s given", zend_zval_type_error_name(&arrays[i])); efree(array_pos); RETURN_THROWS(); } diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index c4b4717c0e39..67b6249729e6 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -353,7 +353,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ option = PHP_STREAM_META_GROUP_NAME; value = Z_STRVAL_P(group); } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(group)); RETURN_THROWS(); } if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { @@ -382,7 +382,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ RETURN_FALSE; } } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(group)); RETURN_THROWS(); } @@ -489,7 +489,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ option = PHP_STREAM_META_OWNER_NAME; value = Z_STRVAL_P(user); } else { - php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user)); + php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_error_name(user)); RETURN_FALSE; } if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { @@ -519,7 +519,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ RETURN_FALSE; } } else { - php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user)); + php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_error_name(user)); RETURN_FALSE; } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 94099b710186..aac07818e041 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -789,7 +789,7 @@ static int set_proc_descriptor_from_array(zval *descitem, descriptorspec_item *d goto finish; } if (Z_TYPE_P(ztarget) != IS_LONG) { - zend_value_error("Redirection target must be of type int, %s given", zend_zval_type_name(ztarget)); + zend_value_error("Redirection target must be of type int, %s given", zend_zval_type_error_name(ztarget)); goto finish; } diff --git a/ext/standard/tests/array/array_diff_assoc_variation1.phpt b/ext/standard/tests/array/array_diff_assoc_variation1.phpt index 8966c5469117..95064b739ae7 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation1.phpt @@ -172,7 +172,7 @@ array_diff_assoc(): Argument #1 ($arr1) must be of type array, string given array_diff_assoc(): Argument #1 ($arr1) must be of type array, string given -- Iteration 23 -- -array_diff_assoc(): Argument #1 ($arr1) must be of type array, object given +array_diff_assoc(): Argument #1 ($arr1) must be of type array, classA given -- Iteration 24 -- array_diff_assoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_assoc_variation2.phpt b/ext/standard/tests/array/array_diff_assoc_variation2.phpt index c5d5383e9de3..b96db1326a81 100644 --- a/ext/standard/tests/array/array_diff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_assoc_variation2.phpt @@ -172,7 +172,7 @@ array_diff_assoc(): Argument #2 ($arr2) must be of type array, string given array_diff_assoc(): Argument #2 ($arr2) must be of type array, string given -- Iteration 23 -- -array_diff_assoc(): Argument #2 ($arr2) must be of type array, object given +array_diff_assoc(): Argument #2 ($arr2) must be of type array, classA given -- Iteration 24 -- array_diff_assoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_key_variation1.phpt b/ext/standard/tests/array/array_diff_key_variation1.phpt index af334626cb61..192257ae3552 100644 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ b/ext/standard/tests/array/array_diff_key_variation1.phpt @@ -192,12 +192,12 @@ array_diff_key(): Argument #1 ($arr1) must be of type array, string given array_diff_key(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #1 ($arr1) must be of type array, object given -array_diff_key(): Argument #1 ($arr1) must be of type array, object given +array_diff_key(): Argument #1 ($arr1) must be of type array, classWithToString given +array_diff_key(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #1 ($arr1) must be of type array, object given -array_diff_key(): Argument #1 ($arr1) must be of type array, object given +array_diff_key(): Argument #1 ($arr1) must be of type array, classWithoutToString given +array_diff_key(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_diff_key(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_key_variation2.phpt b/ext/standard/tests/array/array_diff_key_variation2.phpt index 2dd3c9590737..ec7749ebba1c 100644 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ b/ext/standard/tests/array/array_diff_key_variation2.phpt @@ -193,12 +193,12 @@ array_diff_key(): Argument #2 ($arr2) must be of type array, string given array_diff_key(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #2 ($arr2) must be of type array, object given -array_diff_key(): Argument #2 ($arr2) must be of type array, object given +array_diff_key(): Argument #2 ($arr2) must be of type array, classWithToString given +array_diff_key(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #2 ($arr2) must be of type array, object given -array_diff_key(): Argument #2 ($arr2) must be of type array, object given +array_diff_key(): Argument #2 ($arr2) must be of type array, classWithoutToString given +array_diff_key(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_diff_key(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt index 368fce24db56..f888f69b2b0e 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt @@ -179,10 +179,10 @@ array_diff_uassoc(): Argument #1 ($arr1) must be of type array, string given array_diff_uassoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_diff_uassoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_diff_uassoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_diff_uassoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt index e906b450e544..5781f1e9bd47 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt @@ -179,10 +179,10 @@ array_diff_uassoc(): Argument #2 ($arr2) must be of type array, string given array_diff_uassoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_diff_uassoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_diff_uassoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_diff_uassoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt index 5aef21c0c358..dffb3be7c95d 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -200,12 +200,12 @@ array_diff_ukey(): Argument #1 ($arr1) must be of type array, string given array_diff_ukey(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #1 ($arr1) must be of type array, object given -array_diff_ukey(): Argument #1 ($arr1) must be of type array, object given +array_diff_ukey(): Argument #1 ($arr1) must be of type array, classWithToString given +array_diff_ukey(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #1 ($arr1) must be of type array, object given -array_diff_ukey(): Argument #1 ($arr1) must be of type array, object given +array_diff_ukey(): Argument #1 ($arr1) must be of type array, classWithoutToString given +array_diff_ukey(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_diff_ukey(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_ukey_variation2.phpt b/ext/standard/tests/array/array_diff_ukey_variation2.phpt index 368e9873cae2..1af7b5567d20 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation2.phpt @@ -204,12 +204,12 @@ array_diff_ukey(): Argument #2 ($arr2) must be of type array, string given array_diff_ukey(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #2 ($arr2) must be of type array, object given -array_diff_ukey(): Argument #2 ($arr2) must be of type array, object given +array_diff_ukey(): Argument #2 ($arr2) must be of type array, classWithToString given +array_diff_ukey(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #2 ($arr2) must be of type array, object given -array_diff_ukey(): Argument #2 ($arr2) must be of type array, object given +array_diff_ukey(): Argument #2 ($arr2) must be of type array, classWithoutToString given +array_diff_ukey(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_diff_ukey(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_variation1.phpt b/ext/standard/tests/array/array_diff_variation1.phpt index 94025ec65455..44734ad85603 100644 --- a/ext/standard/tests/array/array_diff_variation1.phpt +++ b/ext/standard/tests/array/array_diff_variation1.phpt @@ -150,7 +150,7 @@ echo "Done"; -- Iteration 22 --array_diff(): Argument #1 ($arr1) must be of type array, string given --- Iteration 23 --array_diff(): Argument #1 ($arr1) must be of type array, object given +-- Iteration 23 --array_diff(): Argument #1 ($arr1) must be of type array, classA given -- Iteration 24 --array_diff(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_diff_variation2.phpt b/ext/standard/tests/array/array_diff_variation2.phpt index f81f81388a52..9dc1c737bd84 100644 --- a/ext/standard/tests/array/array_diff_variation2.phpt +++ b/ext/standard/tests/array/array_diff_variation2.phpt @@ -149,7 +149,7 @@ echo "Done"; -- Iteration 22 --array_diff(): Argument #2 ($arr2) must be of type array, string given --- Iteration 23 --array_diff(): Argument #2 ($arr2) must be of type array, object given +-- Iteration 23 --array_diff(): Argument #2 ($arr2) must be of type array, classA given -- Iteration 24 --array_diff(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt index fee88db0b08f..4ef72323ca7a 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt @@ -179,8 +179,8 @@ array_intersect_assoc(): Argument #1 ($arr1) must be of type array, string given -- Iteration 20 --array_intersect_assoc(): Argument #1 ($arr1) must be of type array, string given array_intersect_assoc(): Argument #1 ($arr1) must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #1 ($arr1) must be of type array, object given -array_intersect_assoc(): Argument #1 ($arr1) must be of type array, object given +-- Iteration 21 --array_intersect_assoc(): Argument #1 ($arr1) must be of type array, classA given +array_intersect_assoc(): Argument #1 ($arr1) must be of type array, classA given -- Iteration 22 --array_intersect_assoc(): Argument #1 ($arr1) must be of type array, null given array_intersect_assoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt index e79d6c86dfb7..453d5206a516 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt @@ -180,8 +180,8 @@ array_intersect_assoc(): Argument #2 ($arr2) must be of type array, string given -- Iteration 20 --array_intersect_assoc(): Argument #2 ($arr2) must be of type array, string given array_intersect_assoc(): Argument #2 ($arr2) must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #2 ($arr2) must be of type array, object given -array_intersect_assoc(): Argument #2 ($arr2) must be of type array, object given +-- Iteration 21 --array_intersect_assoc(): Argument #2 ($arr2) must be of type array, classA given +array_intersect_assoc(): Argument #2 ($arr2) must be of type array, classA given -- Iteration 22 --array_intersect_assoc(): Argument #2 ($arr2) must be of type array, null given array_intersect_assoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt index 821e5f5a1ada..62ae4b9ea460 100644 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation1.phpt @@ -196,12 +196,12 @@ array_intersect_key(): Argument #1 ($arr1) must be of type array, string given array_intersect_key(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #1 ($arr1) must be of type array, object given -array_intersect_key(): Argument #1 ($arr1) must be of type array, object given +array_intersect_key(): Argument #1 ($arr1) must be of type array, classWithToString given +array_intersect_key(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #1 ($arr1) must be of type array, object given -array_intersect_key(): Argument #1 ($arr1) must be of type array, object given +array_intersect_key(): Argument #1 ($arr1) must be of type array, classWithoutToString given +array_intersect_key(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_intersect_key(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_key_variation2.phpt b/ext/standard/tests/array/array_intersect_key_variation2.phpt index b6c791ce57d4..a494f81fc612 100644 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation2.phpt @@ -197,12 +197,12 @@ array_intersect_key(): Argument #2 ($arr2) must be of type array, string given array_intersect_key(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #2 ($arr2) must be of type array, object given -array_intersect_key(): Argument #2 ($arr2) must be of type array, object given +array_intersect_key(): Argument #2 ($arr2) must be of type array, classWithToString given +array_intersect_key(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #2 ($arr2) must be of type array, object given -array_intersect_key(): Argument #2 ($arr2) must be of type array, object given +array_intersect_key(): Argument #2 ($arr2) must be of type array, classWithoutToString given +array_intersect_key(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_intersect_key(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt index f6872377326a..872fe595360e 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt @@ -204,12 +204,12 @@ array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, string give array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, object given -array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithToString given +array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, object given -array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given +array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_intersect_uassoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt index 32633b6a0fbd..3c3781ef27d0 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt @@ -204,12 +204,12 @@ array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, string give array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, object given -array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithToString given +array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, object given -array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given +array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_intersect_uassoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt index fd0b9f603863..7837bee8ec37 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt @@ -202,12 +202,12 @@ array_intersect_ukey(): Argument #1 ($arr1) must be of type array, string given array_intersect_ukey(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #1 ($arr1) must be of type array, object given -array_intersect_ukey(): Argument #1 ($arr1) must be of type array, object given +array_intersect_ukey(): Argument #1 ($arr1) must be of type array, classWithToString given +array_intersect_ukey(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #1 ($arr1) must be of type array, object given -array_intersect_ukey(): Argument #1 ($arr1) must be of type array, object given +array_intersect_ukey(): Argument #1 ($arr1) must be of type array, classWithoutToString given +array_intersect_ukey(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_intersect_ukey(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt index dc272a78119b..312066709fc1 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt @@ -202,12 +202,12 @@ array_intersect_ukey(): Argument #2 ($arr2) must be of type array, string given array_intersect_ukey(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #2 ($arr2) must be of type array, object given -array_intersect_ukey(): Argument #2 ($arr2) must be of type array, object given +array_intersect_ukey(): Argument #2 ($arr2) must be of type array, classWithToString given +array_intersect_ukey(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #2 ($arr2) must be of type array, object given -array_intersect_ukey(): Argument #2 ($arr2) must be of type array, object given +array_intersect_ukey(): Argument #2 ($arr2) must be of type array, classWithoutToString given +array_intersect_ukey(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_intersect_ukey(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_variation1.phpt b/ext/standard/tests/array/array_intersect_variation1.phpt index 9fb64263ecd2..9b7f1824946e 100644 --- a/ext/standard/tests/array/array_intersect_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_variation1.phpt @@ -178,8 +178,8 @@ array_intersect(): Argument #1 ($arr1) must be of type array, string given -- Iterator 20 --array_intersect(): Argument #1 ($arr1) must be of type array, string given array_intersect(): Argument #1 ($arr1) must be of type array, string given --- Iterator 21 --array_intersect(): Argument #1 ($arr1) must be of type array, object given -array_intersect(): Argument #1 ($arr1) must be of type array, object given +-- Iterator 21 --array_intersect(): Argument #1 ($arr1) must be of type array, classA given +array_intersect(): Argument #1 ($arr1) must be of type array, classA given -- Iterator 22 --array_intersect(): Argument #1 ($arr1) must be of type array, null given array_intersect(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_intersect_variation2.phpt b/ext/standard/tests/array/array_intersect_variation2.phpt index e4986c103bb9..518cfeb7ccff 100644 --- a/ext/standard/tests/array/array_intersect_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_variation2.phpt @@ -179,8 +179,8 @@ array_intersect(): Argument #2 ($arr2) must be of type array, string given -- Iterator 20 --array_intersect(): Argument #2 ($arr2) must be of type array, string given array_intersect(): Argument #2 ($arr2) must be of type array, string given --- Iterator 21 --array_intersect(): Argument #2 ($arr2) must be of type array, object given -array_intersect(): Argument #2 ($arr2) must be of type array, object given +-- Iterator 21 --array_intersect(): Argument #2 ($arr2) must be of type array, classA given +array_intersect(): Argument #2 ($arr2) must be of type array, classA given -- Iterator 22 --array_intersect(): Argument #2 ($arr2) must be of type array, null given array_intersect(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index 0024ae18672b..cd68e33515a8 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -224,5 +224,5 @@ bool(true) Illegal offset type *** Testing operation on objects *** -array_key_exists(): Argument #2 ($array) must be of type array, object given +array_key_exists(): Argument #2 ($array) must be of type array, key_check given Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation1.phpt b/ext/standard/tests/array/array_merge_recursive_variation1.phpt index 55ed56cbcc0b..3e33cb148003 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation1.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation1.phpt @@ -210,6 +210,6 @@ echo "Done"; -- With more arguments --array_merge_recursive(): Argument #1 must be of type array, resource given -- Iteration 24 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, object given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, object given +-- With default argument --array_merge_recursive(): Argument #1 must be of type array, A given +-- With more arguments --array_merge_recursive(): Argument #1 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation2.phpt b/ext/standard/tests/array/array_merge_recursive_variation2.phpt index ef1c52928f5b..da52edaf5406 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation2.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation2.phpt @@ -151,5 +151,5 @@ echo "Done"; -- Iteration 23 --array_merge_recursive(): Argument #2 must be of type array, resource given --- Iteration 24 --array_merge_recursive(): Argument #2 must be of type array, object given +-- Iteration 24 --array_merge_recursive(): Argument #2 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_variation2.phpt b/ext/standard/tests/array/array_merge_variation2.phpt index 21148cdb9118..6dbf3b112852 100644 --- a/ext/standard/tests/array/array_merge_variation2.phpt +++ b/ext/standard/tests/array/array_merge_variation2.phpt @@ -173,7 +173,7 @@ array_merge(): Argument #2 must be of type array, string given array_merge(): Argument #2 must be of type array, string given -- Iteration 22 -- -array_merge(): Argument #2 must be of type array, object given +array_merge(): Argument #2 must be of type array, classA given -- Iteration 23 -- array_merge(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_search_variation3.phpt b/ext/standard/tests/array/array_search_variation3.phpt index 4ff919d8a830..bdb2973c9fe9 100644 --- a/ext/standard/tests/array/array_search_variation3.phpt +++ b/ext/standard/tests/array/array_search_variation3.phpt @@ -56,7 +56,7 @@ string(5) "three" int(5) *** Testing objects with array_search() *** -array_search(): Argument #2 ($haystack) must be of type array, object given -array_search(): Argument #2 ($haystack) must be of type array, object given +array_search(): Argument #2 ($haystack) must be of type array, array_search_check given +array_search(): Argument #2 ($haystack) must be of type array, array_search_check given int(1) Done diff --git a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt index dfb6ce0f645f..20db93065bfa 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt @@ -167,10 +167,10 @@ array_udiff_assoc(): Argument #1 ($arr1) must be of type array, string given array_udiff_assoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #1 ($arr1) must be of type array, object given +array_udiff_assoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #1 ($arr1) must be of type array, object given +array_udiff_assoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_udiff_assoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt index 3a4bbda98a6a..f6b4065b01b4 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt @@ -167,10 +167,10 @@ array_udiff_assoc(): Argument #2 ($arr2) must be of type array, string given array_udiff_assoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #2 ($arr2) must be of type array, object given +array_udiff_assoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #2 ($arr2) must be of type array, object given +array_udiff_assoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_udiff_assoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt index 10180cbce14e..c2a4e4fd16cf 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt @@ -168,10 +168,10 @@ array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, string given array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_udiff_uassoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt index 8540bc3d3bfe..c17a016a1dde 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt @@ -168,10 +168,10 @@ array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, string given array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_udiff_uassoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation1.phpt b/ext/standard/tests/array/array_udiff_variation1.phpt index 35ab7f52878f..7d0830a5adf8 100644 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_variation1.phpt @@ -167,10 +167,10 @@ array_udiff(): Argument #1 ($arr1) must be of type array, string given array_udiff(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #1 ($arr1) must be of type array, object given +array_udiff(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #1 ($arr1) must be of type array, object given +array_udiff(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_udiff(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation2.phpt b/ext/standard/tests/array/array_udiff_variation2.phpt index a11bc787e49e..17de2540c15c 100644 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_variation2.phpt @@ -167,10 +167,10 @@ array_udiff(): Argument #2 ($arr2) must be of type array, string given array_udiff(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #2 ($arr2) must be of type array, object given +array_udiff(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #2 ($arr2) must be of type array, object given +array_udiff(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_udiff(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt index 70d8ab88c7e8..0c51526e01da 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt @@ -167,10 +167,10 @@ array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, string give array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, object given +array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, object given +array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_uintersect_assoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt index 6eb40634a8b2..01f495914569 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt @@ -167,10 +167,10 @@ array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, string give array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, object given +array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, object given +array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_uintersect_assoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt index 15ed8461d696..d61eccd05a13 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt @@ -168,10 +168,10 @@ array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, string giv array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, object given +array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_uintersect_uassoc(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt index 0e7aff3d23fb..e6af0887da0e 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt @@ -168,10 +168,10 @@ array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, string giv array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, object given +array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_uintersect_uassoc(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation1.phpt b/ext/standard/tests/array/array_uintersect_variation1.phpt index 4acf4b1d56df..78b1f514ae58 100644 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_variation1.phpt @@ -167,10 +167,10 @@ array_uintersect(): Argument #1 ($arr1) must be of type array, string given array_uintersect(): Argument #1 ($arr1) must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #1 ($arr1) must be of type array, object given +array_uintersect(): Argument #1 ($arr1) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #1 ($arr1) must be of type array, object given +array_uintersect(): Argument #1 ($arr1) must be of type array, classWithoutToString given --undefined var-- array_uintersect(): Argument #1 ($arr1) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation2.phpt b/ext/standard/tests/array/array_uintersect_variation2.phpt index ce2d3117029e..d9b926077986 100644 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_variation2.phpt @@ -167,10 +167,10 @@ array_uintersect(): Argument #2 ($arr2) must be of type array, string given array_uintersect(): Argument #2 ($arr2) must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #2 ($arr2) must be of type array, object given +array_uintersect(): Argument #2 ($arr2) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #2 ($arr2) must be of type array, object given +array_uintersect(): Argument #2 ($arr2) must be of type array, classWithoutToString given --undefined var-- array_uintersect(): Argument #2 ($arr2) must be of type array, null given diff --git a/ext/standard/tests/array/bug40191.phpt b/ext/standard/tests/array/bug40191.phpt index 9ad8f7e28029..2cfa6279cc35 100644 --- a/ext/standard/tests/array/bug40191.phpt +++ b/ext/standard/tests/array/bug40191.phpt @@ -17,5 +17,5 @@ try { echo "Done\n"; ?> --EXPECT-- -array_unique(): Argument #1 ($arg) must be of type array, object given +array_unique(): Argument #1 ($arg) must be of type array, ArrayObject given Done diff --git a/ext/standard/tests/array/in_array_variation3.phpt b/ext/standard/tests/array/in_array_variation3.phpt index 2e6bd0330ef8..e495b11b714b 100644 --- a/ext/standard/tests/array/in_array_variation3.phpt +++ b/ext/standard/tests/array/in_array_variation3.phpt @@ -59,7 +59,7 @@ bool(true) bool(true) *** Testing objects with in_array() *** -in_array(): Argument #2 ($haystack) must be of type array, object given -in_array(): Argument #2 ($haystack) must be of type array, object given +in_array(): Argument #2 ($haystack) must be of type array, in_array_check given +in_array(): Argument #2 ($haystack) must be of type array, in_array_check given bool(true) Done diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt index d1e6dc269a40..4360b915256d 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -35,7 +35,7 @@ var_dump(max(0, true, false, true)); --EXPECT-- max(): Argument #1 ($arg) must be of type array, int given max(): Argument #1 ($arg) must contain at least one element -max(): Argument #1 ($arg) must be of type array, object given +max(): Argument #1 ($arg) must be of type array, stdClass given int(2) float(2.11) string(1) "t" diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt index eac37be7ddac..ad32ae422692 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -35,7 +35,7 @@ var_dump(min(0, true, false, true)); --EXPECT-- min(): Argument #1 ($arg) must be of type array, int given min(): Argument #1 ($arg) must contain at least one element -min(): Argument #1 ($arg) must be of type array, object given +min(): Argument #1 ($arg) must be of type array, stdClass given int(1) float(2.09) string(0) "" diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index f6ebeba2efd4..9541c08bc23b 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -123,7 +123,7 @@ abs(): Argument #1 ($number) must be of type int|float, string given abs(): Argument #1 ($number) must be of type int|float, string given -- Iteration 13 -- -abs(): Argument #1 ($number) must be of type int|float, object given +abs(): Argument #1 ($number) must be of type int|float, classA given -- Iteration 14 -- int(0) diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index 4140738e0248..2a494ebcdf09 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -116,7 +116,7 @@ ceil(): Argument #1 ($number) must be of type int|float, string given ceil(): Argument #1 ($number) must be of type int|float, string given -- Iteration 13 -- -ceil(): Argument #1 ($number) must be of type int|float, object given +ceil(): Argument #1 ($number) must be of type int|float, classA given -- Iteration 14 -- float(0) diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index f5b3e984618a..1679d23989dd 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -116,7 +116,7 @@ floor(): Argument #1 ($number) must be of type int|float, string given floor(): Argument #1 ($number) must be of type int|float, string given -- Iteration 13 -- -floor(): Argument #1 ($number) must be of type int|float, object given +floor(): Argument #1 ($number) must be of type int|float, classA given -- Iteration 14 -- float(0) diff --git a/ext/standard/tests/math/pow_variation1.phpt b/ext/standard/tests/math/pow_variation1.phpt index f205c18a8364..f7e5a5c9e295 100644 --- a/ext/standard/tests/math/pow_variation1.phpt +++ b/ext/standard/tests/math/pow_variation1.phpt @@ -174,7 +174,7 @@ Warning: A non-numeric value encountered in %s on line %d int(0) -- Iteration 23 -- -Unsupported operand types: object ** int +Unsupported operand types: classA ** int -- Iteration 24 -- int(0) diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt index 05cb9151ae1f..1743cf206a1a 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -174,7 +174,7 @@ Warning: A non-numeric value encountered in %s on line %d int(0) -- Iteration 23 -- -Unsupported operand types: object ** int +Unsupported operand types: classA ** int -- Iteration 24 -- int(0) diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt index 5d106ed9d2e7..e120abebe4db 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -170,7 +170,7 @@ Warning: A non-numeric value encountered in %s on line %d float(1) -- Iteration 23 -- -Unsupported operand types: float ** object +Unsupported operand types: float ** classA -- Iteration 24 -- float(1) diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index 5371d0fb94e3..43ad4deae777 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -161,7 +161,7 @@ round(): Argument #1 ($number) must be of type int|float, string given round(): Argument #1 ($number) must be of type int|float, string given -- Iteration 23 -- -round(): Argument #1 ($number) must be of type int|float, object given +round(): Argument #1 ($number) must be of type int|float, classA given -- Iteration 24 -- float(0) diff --git a/ext/standard/tests/network/bug73594.phpt b/ext/standard/tests/network/bug73594.phpt index 370b6162fde9..79607cacec0c 100644 --- a/ext/standard/tests/network/bug73594.phpt +++ b/ext/standard/tests/network/bug73594.phpt @@ -24,4 +24,4 @@ $res = dns_get_record('php.net', DNS_MX, $auth, $additional); var_dump(!empty($res) && empty($additional)); ?> --EXPECT-- -bool(false) +bool(true) diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index 3def367df080..0dc056ea34b2 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -40,6 +40,6 @@ password_hash() expects at least 2 parameters, 1 given Warning: Array to string conversion in %s on line %d password_hash(): Argument #2 ($algo) must be a valid password hashing algorithm -password_hash(): Argument #3 ($options) must be of type array, object given +password_hash(): Argument #3 ($options) must be of type array, stdClass given password_hash(): Argument #3 ($options) must be of type array, string given password_hash(): Argument #1 ($password) must be of type string, array given diff --git a/ext/standard/tests/strings/join_variation2.phpt b/ext/standard/tests/strings/join_variation2.phpt index 37d9b64e1d93..169b912cd918 100644 --- a/ext/standard/tests/strings/join_variation2.phpt +++ b/ext/standard/tests/strings/join_variation2.phpt @@ -138,7 +138,7 @@ join(): Argument #2 ($pieces) must be of type array, string given -- Iteration 15 -- join(): Argument #2 ($pieces) must be of type array, string given -- Iteration 16 -- -join(): Argument #2 ($pieces) must be of type array, object given +join(): Argument #2 ($pieces) must be of type array, test given -- Iteration 17 -- join(): Argument #2 ($pieces) must be of type array, string given -- Iteration 18 -- diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index 30892395fed2..40b526f1e3a4 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -161,7 +161,7 @@ vprintf(): Argument #2 ($args) must be of type array, string given vprintf(): Argument #2 ($args) must be of type array, string given -- Iteration 20 -- -vprintf(): Argument #2 ($args) must be of type array, object given +vprintf(): Argument #2 ($args) must be of type array, sample given -- Iteration 21 -- vprintf(): Argument #2 ($args) must be of type array, null given diff --git a/ext/standard/var.c b/ext/standard/var.c index 5b4fd8fe54fd..12fb1ca77721 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1241,7 +1241,7 @@ PHP_FUNCTION(unserialize) max_depth = zend_hash_str_find_deref(Z_ARRVAL_P(options), "max_depth", sizeof("max_depth") - 1); if (max_depth) { if (Z_TYPE_P(max_depth) != IS_LONG) { - zend_type_error("unserialize(): 'max_depth' option must be of type int, %s given", zend_zval_type_name(max_depth)); + zend_type_error("unserialize(): 'max_depth' option must be of type int, %s given", zend_zval_type_error_name(max_depth)); goto cleanup; } if (Z_LVAL_P(max_depth) < 0) { diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index db573232233a..a51ce6396844 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -192,13 +192,13 @@ PHP_METHOD(PhpToken, is) RETURN_TRUE; } } else { - zend_argument_type_error(1, "must only have elements of type string|int, %s given", zend_zval_type_name(entry)); + zend_argument_type_error(1, "must only have elements of type string|int, %s given", zend_zval_type_error_name(entry)); RETURN_THROWS(); } } ZEND_HASH_FOREACH_END(); RETURN_FALSE; } else { - zend_argument_type_error(1, "must be of type string|int|array, %s given", zend_zval_type_name(kind)); + zend_argument_type_error(1, "must be of type string|int|array, %s given", zend_zval_type_error_name(kind)); RETURN_THROWS(); } } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index f131966c1ffa..bfa66c4fe246 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2779,7 +2779,7 @@ PHP_METHOD(ZipArchive, extractTo) } break; default: - zend_argument_type_error(2, "must be of type array|string|null, %s given", zend_zval_type_name(zval_files)); + zend_argument_type_error(2, "must be of type array|string|null, %s given", zend_zval_type_error_name(zval_files)); RETURN_THROWS(); } } else { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index ae65ba439624..abb8765620ff 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -818,7 +818,7 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict, } break; default: - zend_argument_type_error(2, "must be of type zero-terminated string or array, %s given", zend_zval_type_name(option_buffer)); + zend_argument_type_error(2, "must be of type zero-terminated string or array, %s given", zend_zval_type_error_name(option_buffer)); return 0; } } diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt index 8d2869868e0c..48ac2770ddf9 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -53,7 +53,7 @@ try { --EXPECT-- Object with no __toString(): Try 1: -printf(): Argument #1 ($format) must be of type string, object given +printf(): Argument #1 ($format) must be of type string, stdClass given Try 2: From e9783435c0a7c2f7d301f6d6e70919968b6fc7c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A1t=C3=A9=20Kocsis?= Date: Tue, 26 May 2020 17:16:35 +0200 Subject: [PATCH 3/3] Use zend_zval_type_name instead of zend_zval_type_error_name --- Zend/zend_API.c | 22 +++++----------- Zend/zend_API.h | 1 - Zend/zend_builtin_functions.c | 4 +-- Zend/zend_compile.c | 2 +- Zend/zend_execute.c | 16 ++++++------ Zend/zend_operators.c | 8 +++--- Zend/zend_vm_def.h | 16 ++++++------ Zend/zend_vm_execute.h | 46 ++++++++++++++++----------------- ext/bz2/bz2.c | 2 +- ext/dom/parentnode.c | 4 +-- ext/ftp/php_ftp.c | 6 ++--- ext/hash/hash.c | 4 +-- ext/mysqli/mysqli.c | 2 +- ext/pcre/php_pcre.c | 2 +- ext/reflection/php_reflection.c | 14 +++++----- ext/spl/php_spl.c | 6 ++--- ext/standard/array.c | 30 ++++++++++----------- ext/standard/filestat.c | 8 +++--- ext/standard/proc_open.c | 2 +- ext/standard/var.c | 2 +- ext/tokenizer/tokenizer.c | 4 +-- ext/zip/php_zip.c | 2 +- ext/zlib/zlib.c | 2 +- sapi/phpdbg/phpdbg_info.c | 4 +-- 24 files changed, 100 insertions(+), 109 deletions(-) diff --git a/Zend/zend_API.c b/Zend/zend_API.c index 5aa249611806..ba5cb9c747a0 100644 --- a/Zend/zend_API.c +++ b/Zend/zend_API.c @@ -136,14 +136,6 @@ ZEND_API const char *zend_zval_type_name(const zval *arg) /* {{{ */ { ZVAL_DEREF(arg); - return Z_ISUNDEF_P(arg) ? "null" : zend_get_type_by_const(Z_TYPE_P(arg)); -} -/* }}} */ - -ZEND_API const char *zend_zval_type_error_name(const zval *arg) /* {{{ */ -{ - ZVAL_DEREF(arg); - if (Z_ISUNDEF_P(arg)) { return "null"; } @@ -236,7 +228,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_type_error(int num, z return; } - zend_argument_type_error(num, "must be %s, %s given", expected_error[expected_type], zend_zval_type_error_name(arg)); + zend_argument_type_error(num, "must be %s, %s given", expected_error[expected_type], zend_zval_type_name(arg)); } /* }}} */ @@ -246,7 +238,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_error(int num, return; } - zend_argument_type_error(num, "must be of type %s, %s given", name, zend_zval_type_error_name(arg)); + zend_argument_type_error(num, "must be of type %s, %s given", name, zend_zval_type_name(arg)); } /* }}} */ @@ -256,7 +248,7 @@ ZEND_API ZEND_COLD void ZEND_FASTCALL zend_wrong_parameter_class_or_null_error(i return; } - zend_argument_type_error(num, "must be of type ?%s, %s given", name, zend_zval_type_error_name(arg)); + zend_argument_type_error(num, "must be of type ?%s, %s given", name, zend_zval_type_name(arg)); } /* }}} */ @@ -623,7 +615,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec size_t *pl = va_arg(*va, size_t *); if (!zend_parse_arg_path(arg, p, pl, check_null)) { zend_spprintf(error, 0, "a valid path%s, %s given", - check_null ? " or null" : "", zend_zval_type_error_name(arg) + check_null ? " or null" : "", zend_zval_type_name(arg) ); return ""; } @@ -635,7 +627,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec zend_string **str = va_arg(*va, zend_string **); if (!zend_parse_arg_path_str(arg, str, check_null)) { zend_spprintf(error, 0, "a valid path%s, %s given", - check_null ? " or null" : "", zend_zval_type_error_name(arg) + check_null ? " or null" : "", zend_zval_type_name(arg) ); return ""; } @@ -716,7 +708,7 @@ static const char *zend_parse_arg_impl(zval *arg, va_list *va, const char **spec if (!zend_parse_arg_object(arg, p, ce, check_null)) { if (ce) { if (check_null) { - zend_spprintf(error, 0, "of type ?%s, %s given", ZSTR_VAL(ce->name), zend_zval_type_error_name(arg)); + zend_spprintf(error, 0, "of type ?%s, %s given", ZSTR_VAL(ce->name), zend_zval_type_name(arg)); return ""; } else { return ZSTR_VAL(ce->name); @@ -827,7 +819,7 @@ static int zend_parse_arg(uint32_t arg_num, zval *arg, va_list *va, const char * zend_argument_type_error(arg_num, "must be %s", error); efree(error); } else { - zend_argument_type_error(arg_num, "must be of type %s, %s given", expected_type, zend_zval_type_error_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_API.h b/Zend/zend_API.h index 2512959136ba..44d43d46dedc 100644 --- a/Zend/zend_API.h +++ b/Zend/zend_API.h @@ -301,7 +301,6 @@ ZEND_API int zend_parse_parameters_ex(int flags, uint32_t num_args, const char * #define zend_parse_parameters_throw(num_args, ...) \ zend_parse_parameters(num_args, __VA_ARGS__) ZEND_API const char *zend_zval_type_name(const zval *arg); -ZEND_API const char *zend_zval_type_error_name(const zval *arg); ZEND_API zend_string *zend_zval_get_legacy_type(const zval *arg); ZEND_API int zend_parse_method_parameters(uint32_t num_args, zval *this_ptr, const char *type_spec, ...); diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index cd80c430b009..9062cf6f5c3c 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -986,7 +986,7 @@ ZEND_FUNCTION(method_exists) RETURN_FALSE; } } else { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(klass)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(klass)); RETURN_THROWS(); } @@ -1043,7 +1043,7 @@ ZEND_FUNCTION(property_exists) } else if (Z_TYPE_P(object) == IS_OBJECT) { ce = Z_OBJCE_P(object); } else { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(object)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(object)); RETURN_THROWS(); } diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c index 4dc87647f7c6..d8a54dbd44e5 100644 --- a/Zend/zend_compile.c +++ b/Zend/zend_compile.c @@ -6437,7 +6437,7 @@ void zend_compile_prop_decl(zend_ast *ast, zend_ast *type_ast, uint32_t flags) / } else { zend_error_noreturn(E_COMPILE_ERROR, "Cannot use %s as default value for property %s::$%s of type %s", - zend_zval_type_error_name(&value_zv), + zend_zval_type_name(&value_zv), ZSTR_VAL(ce->name), ZSTR_VAL(name), ZSTR_VAL(str)); } } diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 33d073cd1611..224dfb71d07f 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -663,7 +663,7 @@ static ZEND_COLD void zend_verify_type_error_common( *need_msg = zend_type_to_string_resolved(arg_info->type, zf->common.scope); if (value) { - *given_kind = zend_zval_type_error_name(value); + *given_kind = zend_zval_type_name(value); } else { *given_kind = "none"; } @@ -843,7 +843,7 @@ ZEND_COLD zend_never_inline void zend_verify_property_type_error(zend_property_i type_str = zend_type_to_string(info->type); zend_type_error("Cannot assign %s to property %s::$%s of type %s", - zend_zval_type_error_name(property), + zend_zval_type_name(property), ZSTR_VAL(info->ce->name), zend_get_unmangled_property_name(info->name), ZSTR_VAL(type_str)); @@ -1229,7 +1229,7 @@ static int zend_verify_internal_return_type(zend_function *zf, zval *ret) if (ZEND_TYPE_FULL_MASK(ret_info->type) & MAY_BE_VOID) { if (UNEXPECTED(Z_TYPE_P(ret) != IS_NULL)) { - zend_verify_void_return_error(zf, zend_zval_type_error_name(ret), ""); + zend_verify_void_return_error(zf, zend_zval_type_name(ret), ""); return 0; } return 1; @@ -2361,7 +2361,7 @@ static zend_always_inline void zend_fetch_dimension_address_read(zval *result, z } if (!is_list && type != BP_VAR_IS) { zend_error(E_WARNING, "Trying to access array offset on value of type %s", - zend_zval_type_error_name(container)); + zend_zval_type_name(container)); } ZVAL_NULL(result); } @@ -2560,7 +2560,7 @@ static ZEND_COLD void ZEND_FASTCALL zend_array_key_exists_error( } if (!EG(exception)) { zend_type_error("array_key_exists(): Argument #2 ($array) must be of type array, %s given", - zend_zval_type_error_name(subject)); + zend_zval_type_name(subject)); } } @@ -2946,7 +2946,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1 zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Reference with value of type %s held by property %s::$%s of type %s is not compatible with property %s::$%s of type %s", - zend_zval_type_error_name(zv), + zend_zval_type_name(zv), ZSTR_VAL(prop1->ce->name), zend_get_unmangled_property_name(prop1->name), ZSTR_VAL(type1_str), @@ -2961,7 +2961,7 @@ ZEND_API ZEND_COLD void zend_throw_ref_type_error_type(zend_property_info *prop1 ZEND_API ZEND_COLD void zend_throw_ref_type_error_zval(zend_property_info *prop, zval *zv) { zend_string *type_str = zend_type_to_string(prop->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s", - zend_zval_type_error_name(zv), + zend_zval_type_name(zv), ZSTR_VAL(prop->ce->name), zend_get_unmangled_property_name(prop->name), ZSTR_VAL(type_str) @@ -2973,7 +2973,7 @@ ZEND_API ZEND_COLD void zend_throw_conflicting_coercion_error(zend_property_info zend_string *type1_str = zend_type_to_string(prop1->type); zend_string *type2_str = zend_type_to_string(prop2->type); zend_type_error("Cannot assign %s to reference held by property %s::$%s of type %s and property %s::$%s of type %s, as this would result in an inconsistent type conversion", - zend_zval_type_error_name(zv), + zend_zval_type_name(zv), ZSTR_VAL(prop1->ce->name), zend_get_unmangled_property_name(prop1->name), ZSTR_VAL(type1_str), diff --git a/Zend/zend_operators.c b/Zend/zend_operators.c index af6c4dc4c03f..c8360fbf3951 100644 --- a/Zend/zend_operators.c +++ b/Zend/zend_operators.c @@ -936,7 +936,7 @@ static ZEND_COLD zend_never_inline void ZEND_FASTCALL zend_binop_error(const cha } zend_type_error("Unsupported operand types: %s %s %s", - zend_zval_type_error_name(op1), operator, zend_zval_type_error_name(op2)); + zend_zval_type_name(op1), operator, zend_zval_type_name(op2)); } /* }}} */ @@ -1468,7 +1468,7 @@ ZEND_API int ZEND_FASTCALL bitwise_not_function(zval *result, zval *op1) /* {{{ if (result != op1) { ZVAL_UNDEF(result); } - zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_error_name(op1)); + zend_type_error("Cannot perform bitwise not on %s", zend_zval_type_name(op1)); return FAILURE; } } @@ -2375,7 +2375,7 @@ ZEND_API int ZEND_FASTCALL increment_function(zval *op1) /* {{{ */ /* break missing intentionally */ case IS_RESOURCE: case IS_ARRAY: - zend_type_error("Cannot increment %s", zend_zval_type_error_name(op1)); + zend_type_error("Cannot increment %s", zend_zval_type_name(op1)); return FAILURE; EMPTY_SWITCH_DEFAULT_CASE() } @@ -2437,7 +2437,7 @@ ZEND_API int ZEND_FASTCALL decrement_function(zval *op1) /* {{{ */ /* break missing intentionally */ case IS_RESOURCE: case IS_ARRAY: - zend_type_error("Cannot decrement %s", zend_zval_type_error_name(op1)); + zend_type_error("Cannot decrement %s", zend_zval_type_name(op1)); return FAILURE; EMPTY_SWITCH_DEFAULT_CASE() } diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 6c845fa22ab7..b8b0dc5e3a80 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -3695,7 +3695,7 @@ ZEND_VM_C_LABEL(try_function_name): } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_error_name(function_name)); + zend_zval_type_name(function_name)); call = NULL; } @@ -4932,7 +4932,7 @@ ZEND_VM_HANDLER(119, ZEND_SEND_ARRAY, ANY, ANY, NUM) ZEND_VM_C_GOTO(send_array); } } - zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_error_name(args)); + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_name(args)); FREE_UNFETCHED_OP2(); FREE_OP1(); HANDLE_EXCEPTION(); @@ -6186,7 +6186,7 @@ ZEND_VM_HANDLER(77, ZEND_FE_RESET_R, CONST|TMP|VAR|CV, JMP_ADDR) } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; FREE_OP1(); @@ -6275,7 +6275,7 @@ ZEND_VM_COLD_CONST_HANDLER(125, ZEND_FE_RESET_RW, CONST|TMP|VAR|CV, JMP_ADDR) } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (OP1_TYPE == IS_VAR) { @@ -6585,7 +6585,7 @@ ZEND_VM_HANDLER(126, ZEND_FE_FETCH_RW, VAR, ANY, JMP_ADDR) value_type = Z_TYPE_INFO_P(value); } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array)); if (UNEXPECTED(EG(exception))) { UNDEF_RESULT(); HANDLE_EXCEPTION(); @@ -7915,7 +7915,7 @@ ZEND_VM_COLD_CONST_HANDLER(121, ZEND_STRLEN, CONST|TMPVAR|CV, ANY) zval_ptr_dtor(&tmp); } if (!EG(exception)) { - zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -8010,7 +8010,7 @@ ZEND_VM_HANDLER(157, ZEND_FETCH_CLASS_NAME, CV|TMPVAR|UNUSED|CLASS_FETCH, ANY) if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); FREE_OP1(); HANDLE_EXCEPTION(); @@ -8522,7 +8522,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 6865ddd3ea09..16779b66167d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1977,7 +1977,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(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_error_name(args)); + zend_type_error("call_user_func_array(): Argument #2 ($args) must be of type array, %s given", zend_zval_type_name(args)); FREE_UNFETCHED_OP(opline->op2_type, opline->op2.var); FREE_OP(opline->op1_type, opline->op1.var); HANDLE_EXCEPTION(); @@ -2900,7 +2900,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CONST_H } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_error_name(function_name)); + zend_zval_type_name(function_name)); call = NULL; } @@ -3067,7 +3067,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_TMPVAR_ } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_error_name(function_name)); + zend_zval_type_name(function_name)); call = NULL; } @@ -3185,7 +3185,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_INIT_DYNAMIC_CALL_SPEC_CV_HAND } } zend_throw_error(NULL, "Value of type %s is not callable", - zend_zval_type_error_name(function_name)); + zend_zval_type_name(function_name)); call = NULL; } @@ -4094,7 +4094,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CONST_HANDLER( } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; @@ -4182,7 +4182,7 @@ static ZEND_VM_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_ } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_CONST == IS_VAR) { @@ -4471,7 +4471,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -9340,7 +9340,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -13312,7 +13312,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -13369,7 +13369,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_TMPVAR_H if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); HANDLE_EXCEPTION(); @@ -16418,7 +16418,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -17691,7 +17691,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_TMP_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -17779,7 +17779,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_TMP_HANDLER(Z } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_TMP_VAR == IS_VAR) { @@ -20351,7 +20351,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_VAR_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; zval_ptr_dtor_nogc(EX_VAR(opline->op1.var)); @@ -20440,7 +20440,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_VAR_HANDLER(Z } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_VAR == IS_VAR) { @@ -20750,7 +20750,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_FETCH_RW_SPEC_VAR_HANDLER(Z value_type = Z_TYPE_INFO_P(value); } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array)); if (UNEXPECTED(EG(exception))) { UNDEF_RESULT(); HANDLE_EXCEPTION(); @@ -29108,7 +29108,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_UNUSED_H if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); @@ -33313,7 +33313,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; @@ -36339,7 +36339,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_R_SPEC_CV_HANDLER(ZEN } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; @@ -36427,7 +36427,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FE_RESET_RW_SPEC_CV_HANDLER(ZE } } } else { - zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_error_name(array_ptr)); + zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array_ptr)); ZVAL_UNDEF(EX_VAR(opline->result.var)); Z_FE_ITER_P(EX_VAR(opline->result.var)) = (uint32_t)-1; if (IS_CV == IS_VAR) { @@ -36707,7 +36707,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(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_error_name(value)); + zend_type_error("strlen(): Argument #1 ($str) must be of type string, %s given", zend_zval_type_name(value)); } ZVAL_UNDEF(EX_VAR(opline->result.var)); } while (0); @@ -36764,7 +36764,7 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_FETCH_CLASS_NAME_SPEC_CV_HANDL if (UNEXPECTED(Z_TYPE_P(op) != IS_OBJECT)) { ZVAL_DEREF(op); if (Z_TYPE_P(op) != IS_OBJECT) { - zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_error_name(op)); + zend_type_error("Cannot use ::class on value of type %s", zend_zval_type_name(op)); ZVAL_UNDEF(EX_VAR(opline->result.var)); HANDLE_EXCEPTION(); @@ -45263,7 +45263,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(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_error_name(op1)); + zend_type_error("get_class(): Argument #1 ($object) must be of type object, %s given", zend_zval_type_name(op1)); ZVAL_UNDEF(EX_VAR(opline->result.var)); } break; diff --git a/ext/bz2/bz2.c b/ext/bz2/bz2.c index 83a55bc0c7cc..575c1294221f 100644 --- a/ext/bz2/bz2.c +++ b/ext/bz2/bz2.c @@ -408,7 +408,7 @@ PHP_FUNCTION(bzopen) stream = php_stream_bz2open_from_BZFILE(bz, mode, stream); } else { - zend_argument_type_error(1, "must be of type string or file-resource, %s given", zend_zval_type_error_name(file)); + zend_argument_type_error(1, "must be of type string or file-resource, %s given", zend_zval_type_name(file)); RETURN_THROWS(); } diff --git a/ext/dom/parentnode.c b/ext/dom/parentnode.c index b8c67b04f524..a7627cb84c1c 100644 --- a/ext/dom/parentnode.c +++ b/ext/dom/parentnode.c @@ -187,7 +187,7 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod } else { xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_error_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); return NULL; } } else if (Z_TYPE(nodes[i]) == IS_STRING) { @@ -203,7 +203,7 @@ xmlNode* dom_zvals_to_fragment(php_libxml_ref_obj *document, xmlNode *contextNod } else { xmlFree(fragment); - zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_error_name(&nodes[i])); + zend_argument_type_error(i + 1, "must be of type DOMNode|string, %s given", zend_zval_type_name(&nodes[i])); return NULL; } diff --git a/ext/ftp/php_ftp.c b/ext/ftp/php_ftp.c index 0823f2892b88..a5e5f5048588 100644 --- a/ext/ftp/php_ftp.c +++ b/ext/ftp/php_ftp.c @@ -1292,7 +1292,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_TIMEOUT_SEC: if (Z_TYPE_P(z_value) != IS_LONG) { php_error_docref(NULL, E_WARNING, "Option TIMEOUT_SEC expects value of type int, %s given", - zend_zval_type_error_name(z_value)); + zend_zval_type_name(z_value)); RETURN_FALSE; } if (Z_LVAL_P(z_value) <= 0) { @@ -1305,7 +1305,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_AUTOSEEK: if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) { php_error_docref(NULL, E_WARNING, "Option AUTOSEEK expects value of type bool, %s given", - zend_zval_type_error_name(z_value)); + zend_zval_type_name(z_value)); RETURN_FALSE; } ftp->autoseek = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; @@ -1314,7 +1314,7 @@ PHP_FUNCTION(ftp_set_option) case PHP_FTP_OPT_USEPASVADDRESS: if (Z_TYPE_P(z_value) != IS_TRUE && Z_TYPE_P(z_value) != IS_FALSE) { php_error_docref(NULL, E_WARNING, "Option USEPASVADDRESS expects value of type bool, %s given", - zend_zval_type_error_name(z_value)); + zend_zval_type_name(z_value)); RETURN_FALSE; } ftp->usepasvaddress = Z_TYPE_P(z_value) == IS_TRUE ? 1 : 0; diff --git a/ext/hash/hash.c b/ext/hash/hash.c index 4d1a897027be..31ead3716379 100644 --- a/ext/hash/hash.c +++ b/ext/hash/hash.c @@ -861,12 +861,12 @@ PHP_FUNCTION(hash_equals) /* We only allow comparing string to prevent unexpected results. */ if (Z_TYPE_P(known_zval) != IS_STRING) { - zend_argument_type_error(1, "must be of type string, %s given", zend_zval_type_error_name(known_zval)); + zend_argument_type_error(1, "must be of type string, %s given", zend_zval_type_name(known_zval)); RETURN_THROWS(); } if (Z_TYPE_P(user_zval) != IS_STRING) { - zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_error_name(user_zval)); + zend_argument_type_error(2, "must be of type string, %s given", zend_zval_type_name(user_zval)); RETURN_THROWS(); } diff --git a/ext/mysqli/mysqli.c b/ext/mysqli/mysqli.c index 2d7955b5b782..eb3c79b7985a 100644 --- a/ext/mysqli/mysqli.c +++ b/ext/mysqli/mysqli.c @@ -1244,7 +1244,7 @@ void php_mysqli_fetch_into_hash(INTERNAL_FUNCTION_PARAMETERS, int override_flags * single value is an array. Also we'd have to make that one * argument passed by reference. */ - zend_argument_error(zend_ce_exception, 3, "must be of type array, %s given", zend_zval_type_error_name(ctor_params)); + zend_argument_error(zend_ce_exception, 3, "must be of type array, %s given", zend_zval_type_name(ctor_params)); RETURN_THROWS(); } } diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c index b82370d6c571..9f67bff14cc9 100644 --- a/ext/pcre/php_pcre.c +++ b/ext/pcre/php_pcre.c @@ -2302,7 +2302,7 @@ static void preg_replace_common(INTERNAL_FUNCTION_PARAMETERS, int is_filter) } } else { if (Z_TYPE_P(regex) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array when argument #2 ($replace) is an array, %s given", zend_zval_type_error_name(regex)); + zend_argument_type_error(1, "must be of type array when argument #2 ($replace) is an array, %s given", zend_zval_type_name(regex)); RETURN_THROWS(); } } diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index 5af8bd59170c..9aac065e38be 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -2215,7 +2215,7 @@ ZEND_METHOD(ReflectionParameter, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_error_name(reference)); + zend_argument_error(reflection_exception_ptr, 1, "must be either a string, an array(class, method) or a callable object, %s given", zend_zval_type_name(reference)); RETURN_THROWS(); } @@ -2923,7 +2923,7 @@ ZEND_METHOD(ReflectionMethod, __construct) if (classname == &ztmp) { zval_ptr_dtor_str(&ztmp); } - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); RETURN_THROWS(); } @@ -3457,7 +3457,7 @@ ZEND_METHOD(ReflectionClassConstant, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); RETURN_THROWS(); } @@ -4929,7 +4929,7 @@ ZEND_METHOD(ReflectionClass, isSubclassOf) } /* no break */ default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_error_name(class_name)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_name(class_name)); RETURN_THROWS(); } @@ -4971,7 +4971,7 @@ ZEND_METHOD(ReflectionClass, implementsInterface) } /* no break */ default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_error_name(interface)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type ReflectionClass|string, %s given", zend_zval_type_name(interface)); RETURN_THROWS(); } @@ -5152,7 +5152,7 @@ ZEND_METHOD(ReflectionProperty, __construct) break; default: - zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_error_name(classname)); + zend_argument_error(reflection_exception_ptr, 1, "must be of type object|string, %s given", zend_zval_type_name(classname)); RETURN_THROWS(); } @@ -6133,7 +6133,7 @@ ZEND_METHOD(ReflectionReference, fromArrayElement) } else if (Z_TYPE_P(key) == IS_STRING) { item = zend_symtable_find(ht, Z_STR_P(key)); } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(key)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(key)); RETURN_THROWS(); } diff --git a/ext/spl/php_spl.c b/ext/spl/php_spl.c index a2045746cd42..b6b04cb269f4 100644 --- a/ext/spl/php_spl.c +++ b/ext/spl/php_spl.c @@ -93,7 +93,7 @@ PHP_FUNCTION(class_parents) } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); RETURN_THROWS(); } @@ -126,7 +126,7 @@ PHP_FUNCTION(class_implements) RETURN_THROWS(); } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); RETURN_THROWS(); } @@ -155,7 +155,7 @@ PHP_FUNCTION(class_uses) RETURN_THROWS(); } if (Z_TYPE_P(obj) != IS_OBJECT && Z_TYPE_P(obj) != IS_STRING) { - zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_error_name(obj)); + zend_argument_type_error(1, "must be of type object|string, %s given", zend_zval_type_name(obj)); RETURN_THROWS(); } diff --git a/ext/standard/array.c b/ext/standard/array.c index 71487e32652b..51386148588e 100644 --- a/ext/standard/array.c +++ b/ext/standard/array.c @@ -1191,7 +1191,7 @@ PHP_FUNCTION(min) zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); RETURN_THROWS(); } else { if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 0)) != NULL) { @@ -1238,7 +1238,7 @@ PHP_FUNCTION(max) zval *result; if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); RETURN_THROWS(); } else { if ((result = zend_hash_minmax(Z_ARRVAL(args[0]), php_array_data_compare, 1)) != NULL) { @@ -3718,7 +3718,7 @@ static zend_always_inline void php_array_replace_wrapper(INTERNAL_FUNCTION_PARAM zval *arg = args + i; if (Z_TYPE_P(arg) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(arg)); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(arg)); RETURN_THROWS(); } } @@ -3762,7 +3762,7 @@ static zend_always_inline void php_array_merge_wrapper(INTERNAL_FUNCTION_PARAMET zval *arg = args + i; if (Z_TYPE_P(arg) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(arg)); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(arg)); RETURN_THROWS(); } count += zend_hash_num_elements(Z_ARRVAL_P(arg)); @@ -4590,7 +4590,7 @@ static void php_array_intersect_key(INTERNAL_FUNCTION_PARAMETERS, int data_compa for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } } @@ -4755,7 +4755,7 @@ static void php_array_intersect(INTERNAL_FUNCTION_PARAMETERS, int behavior, int for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -4997,7 +4997,7 @@ static void php_array_diff_key(INTERNAL_FUNCTION_PARAMETERS, int data_compare_ty for (i = 0; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } } @@ -5162,7 +5162,7 @@ static void php_array_diff(INTERNAL_FUNCTION_PARAMETERS, int behavior, int data_ for (i = 0; i < arr_argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); arr_argc = i; /* only free up to i - 1 */ goto out; } @@ -5341,7 +5341,7 @@ PHP_FUNCTION(array_diff) ZEND_PARSE_PARAMETERS_END(); if (Z_TYPE(args[0]) != IS_ARRAY) { - zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_error_name(&args[0])); + zend_argument_type_error(1, "must be of type array, %s given", zend_zval_type_name(&args[0])); RETURN_THROWS(); } @@ -5349,7 +5349,7 @@ PHP_FUNCTION(array_diff) if (num == 0) { for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } } @@ -5366,7 +5366,7 @@ PHP_FUNCTION(array_diff) if (!value) { for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } } @@ -5377,7 +5377,7 @@ PHP_FUNCTION(array_diff) for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } if (!found) { @@ -5407,7 +5407,7 @@ PHP_FUNCTION(array_diff) num = 0; for (i = 1; i < argc; i++) { if (Z_TYPE(args[i]) != IS_ARRAY) { - zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_error_name(&args[i])); + zend_argument_type_error(i + 1, "must be of type array, %s given", zend_zval_type_name(&args[i])); RETURN_THROWS(); } num += zend_hash_num_elements(Z_ARRVAL(args[i])); @@ -6056,7 +6056,7 @@ PHP_FUNCTION(array_map) int ret; if (Z_TYPE(arrays[0]) != IS_ARRAY) { - zend_argument_type_error(2, "must be of type array, %s given", zend_zval_type_error_name(&arrays[0])); + zend_argument_type_error(2, "must be of type array, %s given", zend_zval_type_name(&arrays[0])); RETURN_THROWS(); } maxlen = zend_hash_num_elements(Z_ARRVAL(arrays[0])); @@ -6097,7 +6097,7 @@ PHP_FUNCTION(array_map) for (i = 0; i < n_arrays; i++) { if (Z_TYPE(arrays[i]) != IS_ARRAY) { - zend_argument_type_error(i + 2, "must be of type array, %s given", zend_zval_type_error_name(&arrays[i])); + zend_argument_type_error(i + 2, "must be of type array, %s given", zend_zval_type_name(&arrays[i])); efree(array_pos); RETURN_THROWS(); } diff --git a/ext/standard/filestat.c b/ext/standard/filestat.c index 67b6249729e6..c4b4717c0e39 100644 --- a/ext/standard/filestat.c +++ b/ext/standard/filestat.c @@ -353,7 +353,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ option = PHP_STREAM_META_GROUP_NAME; value = Z_STRVAL_P(group); } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(group)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group)); RETURN_THROWS(); } if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { @@ -382,7 +382,7 @@ static void php_do_chgrp(INTERNAL_FUNCTION_PARAMETERS, int do_lchgrp) /* {{{ */ RETURN_FALSE; } } else { - zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_error_name(group)); + zend_argument_type_error(2, "must be of type string|int, %s given", zend_zval_type_name(group)); RETURN_THROWS(); } @@ -489,7 +489,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ option = PHP_STREAM_META_OWNER_NAME; value = Z_STRVAL_P(user); } else { - php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_error_name(user)); + php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user)); RETURN_FALSE; } if(wrapper->wops->stream_metadata(wrapper, filename, option, value, NULL)) { @@ -519,7 +519,7 @@ static void php_do_chown(INTERNAL_FUNCTION_PARAMETERS, int do_lchown) /* {{{ */ RETURN_FALSE; } } else { - php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_error_name(user)); + php_error_docref(NULL, E_WARNING, "Parameter 2 should be string or int, %s given", zend_zval_type_name(user)); RETURN_FALSE; } diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index aac07818e041..94099b710186 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -789,7 +789,7 @@ static int set_proc_descriptor_from_array(zval *descitem, descriptorspec_item *d goto finish; } if (Z_TYPE_P(ztarget) != IS_LONG) { - zend_value_error("Redirection target must be of type int, %s given", zend_zval_type_error_name(ztarget)); + zend_value_error("Redirection target must be of type int, %s given", zend_zval_type_name(ztarget)); goto finish; } diff --git a/ext/standard/var.c b/ext/standard/var.c index 12fb1ca77721..5b4fd8fe54fd 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -1241,7 +1241,7 @@ PHP_FUNCTION(unserialize) max_depth = zend_hash_str_find_deref(Z_ARRVAL_P(options), "max_depth", sizeof("max_depth") - 1); if (max_depth) { if (Z_TYPE_P(max_depth) != IS_LONG) { - zend_type_error("unserialize(): 'max_depth' option must be of type int, %s given", zend_zval_type_error_name(max_depth)); + zend_type_error("unserialize(): 'max_depth' option must be of type int, %s given", zend_zval_type_name(max_depth)); goto cleanup; } if (Z_LVAL_P(max_depth) < 0) { diff --git a/ext/tokenizer/tokenizer.c b/ext/tokenizer/tokenizer.c index a51ce6396844..db573232233a 100644 --- a/ext/tokenizer/tokenizer.c +++ b/ext/tokenizer/tokenizer.c @@ -192,13 +192,13 @@ PHP_METHOD(PhpToken, is) RETURN_TRUE; } } else { - zend_argument_type_error(1, "must only have elements of type string|int, %s given", zend_zval_type_error_name(entry)); + zend_argument_type_error(1, "must only have elements of type string|int, %s given", zend_zval_type_name(entry)); RETURN_THROWS(); } } ZEND_HASH_FOREACH_END(); RETURN_FALSE; } else { - zend_argument_type_error(1, "must be of type string|int|array, %s given", zend_zval_type_error_name(kind)); + zend_argument_type_error(1, "must be of type string|int|array, %s given", zend_zval_type_name(kind)); RETURN_THROWS(); } } diff --git a/ext/zip/php_zip.c b/ext/zip/php_zip.c index bfa66c4fe246..f131966c1ffa 100644 --- a/ext/zip/php_zip.c +++ b/ext/zip/php_zip.c @@ -2779,7 +2779,7 @@ PHP_METHOD(ZipArchive, extractTo) } break; default: - zend_argument_type_error(2, "must be of type array|string|null, %s given", zend_zval_type_error_name(zval_files)); + zend_argument_type_error(2, "must be of type array|string|null, %s given", zend_zval_type_name(zval_files)); RETURN_THROWS(); } } else { diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c index abb8765620ff..ae65ba439624 100644 --- a/ext/zlib/zlib.c +++ b/ext/zlib/zlib.c @@ -818,7 +818,7 @@ static zend_bool zlib_create_dictionary_string(HashTable *options, char **dict, } break; default: - zend_argument_type_error(2, "must be of type zero-terminated string or array, %s given", zend_zval_type_error_name(option_buffer)); + zend_argument_type_error(2, "must be of type zero-terminated string or array, %s given", zend_zval_type_name(option_buffer)); return 0; } } diff --git a/sapi/phpdbg/phpdbg_info.c b/sapi/phpdbg/phpdbg_info.c index b576187c7a9a..783681009e7a 100644 --- a/sapi/phpdbg/phpdbg_info.c +++ b/sapi/phpdbg/phpdbg_info.c @@ -123,7 +123,7 @@ PHPDBG_INFO(constants) /* {{{ */ "address=\"%p\" refcount=\"%d\" type=\"%s\" name=\"%.*s\" " attrs, \ "%-18p %-7d %-9s %.*s" msg, &data->value, \ Z_REFCOUNTED(data->value) ? Z_REFCOUNT(data->value) : 1, \ - zend_zval_type_name(&data->value), \ + zend_get_type_by_const(Z_TYPE(data->value)), \ (int) ZSTR_LEN(data->name), ZSTR_VAL(data->name), ##__VA_ARGS__) switch (Z_TYPE(data->value)) { @@ -231,7 +231,7 @@ static int phpdbg_print_symbols(zend_bool show_globals) { #define VARIABLEINFO(attrs, msg, ...) \ phpdbg_writeln("variable", \ "address=\"%p\" refcount=\"%d\" type=\"%s\" refstatus=\"%s\" name=\"%.*s\" " attrs, \ - "%-18p %-7d %-9s %s$%.*s" msg, data, Z_REFCOUNTED_P(data) ? Z_REFCOUNT_P(data) : 1, zend_zval_type_name(data), isref, (int) ZSTR_LEN(var), ZSTR_VAL(var), ##__VA_ARGS__) + "%-18p %-7d %-9s %s$%.*s" msg, data, Z_REFCOUNTED_P(data) ? Z_REFCOUNT_P(data) : 1, zend_get_type_by_const(Z_TYPE_P(data)), isref, (int) ZSTR_LEN(var), ZSTR_VAL(var), ##__VA_ARGS__) retry_switch: switch (Z_TYPE_P(data)) { case IS_RESOURCE: