diff --git a/Zend/tests/type_declarations/scalar_none.phpt b/Zend/tests/type_declarations/scalar_none.phpt index 8316b51fa9ef..764f6a8a5745 100644 --- a/Zend/tests/type_declarations/scalar_none.phpt +++ b/Zend/tests/type_declarations/scalar_none.phpt @@ -19,20 +19,20 @@ foreach ($functions as $type => $function) { try { var_dump($function()); } catch (Throwable $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo PHP_EOL . "Done"; ?> --EXPECTF-- Testing int: -*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected Testing float: -*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected Testing string: -*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected Testing bool: -*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected Testing int nullable: NULL Testing float nullable: diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt index f69aec3b5b6e..8f619ebe5b38 100644 --- a/Zend/tests/type_declarations/scalar_null.phpt +++ b/Zend/tests/type_declarations/scalar_null.phpt @@ -19,7 +19,7 @@ foreach ($functions as $type => $function) { try { var_dump($function(null)); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -27,13 +27,13 @@ echo PHP_EOL . "Done"; ?> --EXPECTF-- Testing int: -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d Testing float: -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d Testing string: -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d Testing bool: -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d Testing int nullable: NULL Testing float nullable: diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt index 498092e8ac54..60808dc8b933 100644 --- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt @@ -55,7 +55,7 @@ foreach ($functions as $type => $function) { try { var_dump($function($value)); } catch (TypeError $e) { - echo "*** Caught ", $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } } } @@ -74,32 +74,32 @@ int(1) E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line %d int(1) *** Trying string(2) "1a" -*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d *** Trying string(1) "a" -*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d *** Trying string(0) "" -*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught {closure:%s:%d}(): Return value must be of type int, float returned in %s on line %d +TypeError: {closure:%s:%d}(): 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 {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d Testing 'float' type: *** Trying int(1) @@ -111,11 +111,11 @@ float(1) *** Trying float(1.5) float(1.5) *** Trying string(2) "1a" -*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d *** Trying string(1) "a" -*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d *** Trying string(0) "" -*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d +TypeError: {closure:%s:%d}(): 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 {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d Testing 'string' type: *** Trying int(1) @@ -163,18 +163,18 @@ string(1) "1" *** Trying bool(false) string(0) "" *** Trying NULL -*** Caught {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d *** Trying object(StringCapable)#%d (0) { } string(6) "foobar" *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d Testing 'bool' type: *** Trying int(1) @@ -201,17 +201,17 @@ bool(true) *** Trying bool(false) bool(false) *** Trying NULL -*** Caught {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d +TypeError: {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Return value must be of type bool, resource returned in %s on line %d +TypeError: {closure:%s:%d}(): 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 b7f2ce0de439..2876c4222746 100644 --- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt +++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt @@ -46,7 +46,7 @@ foreach ($functions as $type => $function) { try { var_dump($function($value)); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -60,52 +60,52 @@ Testing 'int' type: int(1) *** Trying string(1) "1" -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying int(9223372036854775807) int(9223372036854775807) *** Trying float(NAN) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d *** Trying bool(false) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d *** Trying NULL -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -113,7 +113,7 @@ Testing 'float' type: float(1) *** Trying string(1) "1" -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying float(1) float(1) @@ -122,13 +122,13 @@ float(1) float(1.5) *** Trying string(2) "1a" -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying int(9223372036854775807) float(9.223372036854776E+18) @@ -137,42 +137,42 @@ float(9.223372036854776E+18) float(NAN) *** Trying bool(true) -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d *** Trying bool(false) -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d *** Trying NULL -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: *** Trying int(1) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying string(1) "1" string(1) "1" *** Trying float(1) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying string(2) "1a" string(2) "1a" @@ -184,63 +184,63 @@ string(1) "a" string(0) "" *** Trying int(9223372036854775807) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying bool(true) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d *** Trying bool(false) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d *** Trying NULL -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: *** Trying int(1) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying string(1) "1" -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying float(1) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying float(1.5) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying string(2) "1a" -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(1) "a" -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying string(0) "" -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying int(9223372036854775807) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying float(NAN) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying bool(true) bool(true) @@ -249,21 +249,21 @@ bool(true) bool(false) *** Trying NULL -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array(0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object(stdClass)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying object(StringCapable)#%d (0) { } -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d *** Trying resource(%d) of type (stream) -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt index 462bed7983d6..5ec9a075f374 100644 --- a/Zend/tests/type_declarations/scalar_strict_basic.phpt +++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt @@ -44,7 +44,7 @@ foreach ($functions as $type => $function) { try { var_dump($function($value)); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -57,28 +57,28 @@ Testing 'int' type: int(1) *** Trying float value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d *** Trying string value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d *** Trying true value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d *** Trying false value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d *** Trying null value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d *** Trying array value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d *** Trying object value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d *** Trying resource value -*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d Testing 'float' type: @@ -89,65 +89,65 @@ float(1) float(1) *** Trying string value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d *** Trying true value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d *** Trying false value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d *** Trying null value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d *** Trying array value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d *** Trying object value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d *** Trying resource value -*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d Testing 'string' type: *** Trying integer value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d *** Trying float value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d *** Trying string value string(1) "1" *** Trying true value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d *** Trying false value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d *** Trying null value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d *** Trying array value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d *** Trying object value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d *** Trying resource value -*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d Testing 'bool' type: *** Trying integer value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d *** Trying float value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d *** Trying string value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d *** Trying true value bool(true) @@ -156,15 +156,15 @@ bool(true) bool(false) *** Trying null value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d *** Trying array value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d *** Trying object value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d *** Trying resource value -*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d Done diff --git a/Zend/tests/type_declarations/static_type_return.phpt b/Zend/tests/type_declarations/static_type_return.phpt index 0d37a8004650..4baa1c6a4157 100644 --- a/Zend/tests/type_declarations/static_type_return.phpt +++ b/Zend/tests/type_declarations/static_type_return.phpt @@ -37,7 +37,7 @@ var_dump($a->test2()); try { var_dump($b->test2()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -49,7 +49,7 @@ var_dump($a->test4()); try { var_dump($b->test4()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -60,7 +60,7 @@ $test = function($x): static { try { var_dump($test(new stdClass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $test = $test->bindTo($a); @@ -75,7 +75,7 @@ object(B)#%d (0) { object(A)#%d (0) { } -A::test2(): Return value must be of type B, A returned +TypeError: A::test2(): Return value must be of type B, A returned object(A)#%d (0) { } @@ -84,8 +84,8 @@ object(C)#%d (0) { object(A)#%d (0) { } -A::test4(): Return value must be of type B|array, A returned +TypeError: A::test4(): Return value must be of type B|array, A returned -{closure:%s:%d}(): Return value must be of type static, stdClass returned +TypeError: {closure:%s:%d}(): Return value must be of type static, stdClass returned object(A)#%d (0) { } diff --git a/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt b/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt index dd4957f2269c..174f35b9be87 100644 --- a/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt @@ -8,11 +8,11 @@ try { public const int X = 1; }); } catch (AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && new class { +AssertionError: assert(false && new class { public const int X = 1; }) diff --git a/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt b/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt index 059c3cb2005b..59e78e532855 100644 --- a/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt @@ -9,8 +9,8 @@ class A { try { define("C", new A()); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "C" +Error: Undefined constant "C" diff --git a/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt b/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt index 40e079c3596e..9091bb80f9fa 100644 --- a/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_inheritance_success2.phpt @@ -45,4 +45,4 @@ object(Z)#%d (%d) { object(Z)#%d (%d) { } object(Z)#%d (%d) { -} \ No newline at end of file +} diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt index 714e5a00995c..16d1d32003a1 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt @@ -13,9 +13,9 @@ enum E2 { try { var_dump(E1::C); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign E2 to class constant E1::C of type static +TypeError: Cannot assign E2 to class constant E1::C of type static diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt index 8acffaa38399..8877f3091218 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt @@ -11,16 +11,16 @@ define("C", "c"); try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign string to class constant A::CONST1 of type int -Cannot assign string to class constant A::CONST1 of type int +TypeError: Cannot assign string to class constant A::CONST1 of type int +TypeError: Cannot assign string to class constant A::CONST1 of type int diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt index 1e6ab277dec8..0a8640449b0d 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt @@ -11,15 +11,15 @@ define('C', new stdClass); try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign stdClass to class constant A::CONST1 of type string -Cannot assign stdClass to class constant A::CONST1 of type string +TypeError: Cannot assign stdClass to class constant A::CONST1 of type string +TypeError: Cannot assign stdClass to class constant A::CONST1 of type string diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt index 6fce75016630..4f0e4d15172e 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt @@ -11,15 +11,15 @@ define("C", new stdClass); try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt index cbd3720a5ea4..192febf09c7b 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt @@ -12,29 +12,29 @@ define("C", new stdClass); try { var_dump(A::CONST2); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST2); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(A::CONST1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable -Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable +TypeError: Cannot assign stdClass to class constant A::CONST1 of type stdClass&Stringable diff --git a/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt b/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt index b0f42b2078a5..6ded91b21231 100644 --- a/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt +++ b/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt @@ -18,8 +18,8 @@ define("S", new S()); try { var_dump(A::S); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign S to class constant A::S of type string +TypeError: Cannot assign S to class constant A::S of type string diff --git a/Zend/tests/type_declarations/typed_properties_019.phpt b/Zend/tests/type_declarations/typed_properties_019.phpt index d804b9c799d1..0f9fd4648d40 100644 --- a/Zend/tests/type_declarations/typed_properties_019.phpt +++ b/Zend/tests/type_declarations/typed_properties_019.phpt @@ -15,8 +15,8 @@ $foo = new Foo(); try { $foo->inc(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot increment property Foo::$bar of type int past its maximal value +TypeError: Cannot increment property Foo::$bar of type int past its maximal value diff --git a/Zend/tests/type_declarations/typed_properties_020.phpt b/Zend/tests/type_declarations/typed_properties_020.phpt index 3b16a9d81d0e..3f2e41a9b13c 100644 --- a/Zend/tests/type_declarations/typed_properties_020.phpt +++ b/Zend/tests/type_declarations/typed_properties_020.phpt @@ -12,7 +12,7 @@ class Foo { try { $this->bar += 1.5; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -22,5 +22,5 @@ $foo = new Foo(); var_dump($foo->bar); ?> --EXPECT-- -Cannot assign float to property Foo::$bar of type int +TypeError: Cannot assign float to property Foo::$bar of type int int(2) diff --git a/Zend/tests/type_declarations/typed_properties_021.phpt b/Zend/tests/type_declarations/typed_properties_021.phpt index d4d4d0ed19d2..eaea976b1bf2 100644 --- a/Zend/tests/type_declarations/typed_properties_021.phpt +++ b/Zend/tests/type_declarations/typed_properties_021.phpt @@ -9,8 +9,8 @@ class Foo { try { $foo = new Foo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "BAR" not found +Error: Class "BAR" not found diff --git a/Zend/tests/type_declarations/typed_properties_033.phpt b/Zend/tests/type_declarations/typed_properties_033.phpt index 665026f07565..f3764d0fd746 100644 --- a/Zend/tests/type_declarations/typed_properties_033.phpt +++ b/Zend/tests/type_declarations/typed_properties_033.phpt @@ -20,12 +20,12 @@ try { foreach ($foo->fetch() as &$prop) { $prop += 1; } -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); ?> --EXPECTF-- -Cannot assign float to reference held by property class@anonymous::$qux of type int +TypeError: Cannot assign float to reference held by property class@anonymous::$qux of type int object(class@anonymous)#1 (4) { ["foo"]=> int(2) diff --git a/Zend/tests/type_declarations/typed_properties_034.phpt b/Zend/tests/type_declarations/typed_properties_034.phpt index 4af6baa80aef..b591a87dae4b 100644 --- a/Zend/tests/type_declarations/typed_properties_034.phpt +++ b/Zend/tests/type_declarations/typed_properties_034.phpt @@ -22,7 +22,7 @@ foo($foo->bar); try { $foo->baz = &$foo->bar; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->bar = 10; foreach ($foo->getIterator() as &$item) { @@ -32,17 +32,17 @@ foreach ($foo->getIterator() as &$item) { try { foo($foo->bar); -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); ?> --EXPECT-- int(42) -Cannot assign null to property class@anonymous::$baz of type int +TypeError: Cannot assign null to property class@anonymous::$baz of type int int(1) int(10) int(10) -Cannot assign null to reference held by property class@anonymous::$baz of type int +TypeError: Cannot assign null to reference held by property class@anonymous::$baz of type int object(class@anonymous)#1 (2) { ["bar"]=> &int(10) diff --git a/Zend/tests/type_declarations/typed_properties_038.phpt b/Zend/tests/type_declarations/typed_properties_038.phpt index 4bb5b75a28fe..fe4a90b70e69 100644 --- a/Zend/tests/type_declarations/typed_properties_038.phpt +++ b/Zend/tests/type_declarations/typed_properties_038.phpt @@ -10,7 +10,7 @@ $foo = new class { try { $foo->bar++; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump($foo); @@ -18,7 +18,7 @@ var_dump($foo); try { $foo->bar += 1; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump($foo); @@ -26,7 +26,7 @@ var_dump($foo); try { ++$foo->bar; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump($foo); @@ -34,28 +34,28 @@ var_dump($foo); try { $foo->bar = $foo->bar + 1; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump($foo); ?> --EXPECTF-- -string(82) "Cannot increment property class@anonymous::$bar of type int past its maximal value" +TypeError: Cannot increment property class@anonymous::$bar of type int past its maximal value object(class@anonymous)#1 (1) { ["bar"]=> int(%d) } -string(65) "Cannot assign float to property class@anonymous::$bar of type int" +TypeError: Cannot assign float to property class@anonymous::$bar of type int object(class@anonymous)#1 (1) { ["bar"]=> int(%d) } -string(82) "Cannot increment property class@anonymous::$bar of type int past its maximal value" +TypeError: Cannot increment property class@anonymous::$bar of type int past its maximal value object(class@anonymous)#1 (1) { ["bar"]=> int(%d) } -string(65) "Cannot assign float to property class@anonymous::$bar of type int" +TypeError: Cannot assign float to property class@anonymous::$bar of type int object(class@anonymous)#1 (1) { ["bar"]=> int(%d) diff --git a/Zend/tests/type_declarations/typed_properties_043.phpt b/Zend/tests/type_declarations/typed_properties_043.phpt index ed4951f39c37..a5fc81f99346 100644 --- a/Zend/tests/type_declarations/typed_properties_043.phpt +++ b/Zend/tests/type_declarations/typed_properties_043.phpt @@ -12,17 +12,17 @@ trait Test { try { Test::$selfProp = new stdClass; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::$selfNullProp = new stdClass; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::$parentProp = new stdClass; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } Test::$selfNullProp = null; @@ -42,13 +42,13 @@ var_dump(Bar::$selfProp, Bar::$selfNullProp, Bar::$parentProp); ?> --EXPECTF-- Deprecated: Accessing static trait property Test::$selfProp is deprecated, it should only be accessed on a class using the trait in %s on line %d -Cannot assign stdClass to property Test::$selfProp of type self +TypeError: Cannot assign stdClass to property Test::$selfProp of type self Deprecated: Accessing static trait property Test::$selfNullProp is deprecated, it should only be accessed on a class using the trait in %s on line %d -Cannot assign stdClass to property Test::$selfNullProp of type ?self +TypeError: Cannot assign stdClass to property Test::$selfNullProp of type ?self Deprecated: Accessing static trait property Test::$parentProp is deprecated, it should only be accessed on a class using the trait in %s on line %d -Cannot assign stdClass to property Test::$parentProp of type parent +TypeError: Cannot assign stdClass to property Test::$parentProp of type parent Deprecated: Accessing static trait property Test::$selfNullProp is deprecated, it should only be accessed on a class using the trait in %s on line %d diff --git a/Zend/tests/type_declarations/typed_properties_044.phpt b/Zend/tests/type_declarations/typed_properties_044.phpt index f32cd928444e..9933c15203a4 100644 --- a/Zend/tests/type_declarations/typed_properties_044.phpt +++ b/Zend/tests/type_declarations/typed_properties_044.phpt @@ -22,13 +22,13 @@ $bar = PHP_INT_MAX; try { var_dump($bar++); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(++$bar); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $bar = PHP_INT_MIN; @@ -37,13 +37,13 @@ $bar = PHP_INT_MIN; try { var_dump($bar--); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(--$bar); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -52,7 +52,7 @@ int(0) int(-2) int(-1) int(-1) -Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value -Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value -Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value -Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value +TypeError: Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$bar of type ?int past its maximal value +TypeError: Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$bar of type ?int past its minimal value diff --git a/Zend/tests/type_declarations/typed_properties_045.phpt b/Zend/tests/type_declarations/typed_properties_045.phpt index 7e4dc8e43fef..4398bc8ab8d0 100644 --- a/Zend/tests/type_declarations/typed_properties_045.phpt +++ b/Zend/tests/type_declarations/typed_properties_045.phpt @@ -16,7 +16,7 @@ class Foo { try { $val = []; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -34,7 +34,7 @@ foreach ($foo as $k => &$val) { $val = []; var_dump($foo->$k); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } $foo->test(); @@ -42,10 +42,10 @@ $foo->test(); --EXPECT-- int(0) int(20) -Cannot assign array to reference held by property Foo::$bar of type int +TypeError: Cannot assign array to reference held by property Foo::$bar of type int float(0.5) float(20) -Cannot assign array to reference held by property Foo::$baz of type float +TypeError: Cannot assign array to reference held by property Foo::$baz of type float float(0.5) float(20) -Cannot assign array to reference held by property Foo::$privateProp of type float +TypeError: Cannot assign array to reference held by property Foo::$privateProp of type float diff --git a/Zend/tests/type_declarations/typed_properties_046.phpt b/Zend/tests/type_declarations/typed_properties_046.phpt index 2048455fe5f1..c66a69e334f4 100644 --- a/Zend/tests/type_declarations/typed_properties_046.phpt +++ b/Zend/tests/type_declarations/typed_properties_046.phpt @@ -18,13 +18,13 @@ for ($i = 0; $i < 5; $i++) { try { foo()->{bar()} = str_repeat("a", 3); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Cannot assign string to property Foo::$bbb of type int -Cannot assign string to property Foo::$bbb of type int -Cannot assign string to property Foo::$bbb of type int -Cannot assign string to property Foo::$bbb of type int -Cannot assign string to property Foo::$bbb of type int +TypeError: Cannot assign string to property Foo::$bbb of type int +TypeError: Cannot assign string to property Foo::$bbb of type int +TypeError: Cannot assign string to property Foo::$bbb of type int +TypeError: Cannot assign string to property Foo::$bbb of type int +TypeError: Cannot assign string to property Foo::$bbb of type int diff --git a/Zend/tests/type_declarations/typed_properties_047.phpt b/Zend/tests/type_declarations/typed_properties_047.phpt index 5de7b254d993..3e5bd90f832f 100644 --- a/Zend/tests/type_declarations/typed_properties_047.phpt +++ b/Zend/tests/type_declarations/typed_properties_047.phpt @@ -20,12 +20,12 @@ unset($x->foo); try { var_dump($x->foo); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x->foo = "ops"; } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -36,5 +36,5 @@ object(Foo)#1 (1) { NULL int(5) NULL -Typed property Foo::$foo must not be accessed before initialization -Cannot assign string to property Foo::$foo of type ?int +Error: Typed property Foo::$foo must not be accessed before initialization +TypeError: Cannot assign string to property Foo::$foo of type ?int diff --git a/Zend/tests/type_declarations/typed_properties_051.phpt b/Zend/tests/type_declarations/typed_properties_051.phpt index 37972c967b14..47103a4efac5 100644 --- a/Zend/tests/type_declarations/typed_properties_051.phpt +++ b/Zend/tests/type_declarations/typed_properties_051.phpt @@ -19,9 +19,9 @@ var_dump($o->a); try { $o->a = new C; } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(4) "okok" -Cannot assign C to property A::$a of type string +TypeError: Cannot assign C to property A::$a of type string diff --git a/Zend/tests/type_declarations/typed_properties_056.phpt b/Zend/tests/type_declarations/typed_properties_056.phpt index 868594b38adc..b62c7c969add 100644 --- a/Zend/tests/type_declarations/typed_properties_056.phpt +++ b/Zend/tests/type_declarations/typed_properties_056.phpt @@ -13,11 +13,11 @@ $o->foo = "1" . str_repeat("0", 2); try { $o->foo += 5; } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o->foo); unset($o); ?> --EXPECT-- -Cannot assign int to property A::$foo of type string +TypeError: Cannot assign int to property A::$foo of type string string(3) "100" diff --git a/Zend/tests/type_declarations/typed_properties_057.phpt b/Zend/tests/type_declarations/typed_properties_057.phpt index eb565f0c36b4..140eaf4b45ef 100644 --- a/Zend/tests/type_declarations/typed_properties_057.phpt +++ b/Zend/tests/type_declarations/typed_properties_057.phpt @@ -13,19 +13,19 @@ $o->foo = "1" . str_repeat("0", 2); try { $x = ++$o->foo; } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o->foo); try { $x = $o->foo++; } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o->foo); unset($o); ?> --EXPECT-- -Cannot assign int to property A::$foo of type string +TypeError: Cannot assign int to property A::$foo of type string string(3) "100" -Cannot assign int to property A::$foo of type string +TypeError: Cannot assign int to property A::$foo of type string string(3) "100" diff --git a/Zend/tests/type_declarations/typed_properties_058.phpt b/Zend/tests/type_declarations/typed_properties_058.phpt index 47c75037d163..0934d7de0f6b 100644 --- a/Zend/tests/type_declarations/typed_properties_058.phpt +++ b/Zend/tests/type_declarations/typed_properties_058.phpt @@ -22,11 +22,11 @@ for ($i = 0; $i < 2; $i++) { $o = new B(); var_dump($o->foo); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- int(5) -Cannot assign int to property B::$foo of type string -Cannot assign int to property B::$foo of type string +TypeError: Cannot assign int to property B::$foo of type string +TypeError: Cannot assign int to property B::$foo of type string diff --git a/Zend/tests/type_declarations/typed_properties_062.phpt b/Zend/tests/type_declarations/typed_properties_062.phpt index 6e1242e9901e..82f3896668d8 100644 --- a/Zend/tests/type_declarations/typed_properties_062.phpt +++ b/Zend/tests/type_declarations/typed_properties_062.phpt @@ -18,7 +18,7 @@ var_dump($a->foo); try { $a->_ .= "e50"; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $a->_--; @@ -31,30 +31,30 @@ $a->foo = PHP_INT_MIN; try { $a->_--; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { --$a->_; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $a->foo = PHP_INT_MAX; try { $a->_++; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { ++$a->_; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $a->_ = 0; try { $a->_ = []; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $a->_ = 1; @@ -64,18 +64,18 @@ var_dump($a->foo); --EXPECT-- int(2) int(21) -Cannot assign string to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int int(21) int(20) int(19) -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot assign array to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int int(0) int(1) diff --git a/Zend/tests/type_declarations/typed_properties_063.phpt b/Zend/tests/type_declarations/typed_properties_063.phpt index b67e95c24b39..141fc114387d 100644 --- a/Zend/tests/type_declarations/typed_properties_063.phpt +++ b/Zend/tests/type_declarations/typed_properties_063.phpt @@ -17,7 +17,7 @@ var_dump($a->foo); try { $_ .= "e50"; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $_--; @@ -30,30 +30,30 @@ $a->foo = PHP_INT_MIN; try { $_--; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { --$_; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $a->foo = PHP_INT_MAX; try { $_++; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { ++$_; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $_ = 0; try { $_ = []; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $_ = 1; @@ -63,18 +63,18 @@ var_dump($a->foo); --EXPECT-- int(2) int(21) -Cannot assign string to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int int(21) int(20) int(19) -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot assign array to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int int(0) int(1) diff --git a/Zend/tests/type_declarations/typed_properties_064.phpt b/Zend/tests/type_declarations/typed_properties_064.phpt index dd7b5517a7f1..daf648bfb51d 100644 --- a/Zend/tests/type_declarations/typed_properties_064.phpt +++ b/Zend/tests/type_declarations/typed_properties_064.phpt @@ -17,7 +17,7 @@ var_dump($a->foo); try { $_[0] .= "e50"; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $_[0]--; @@ -30,30 +30,30 @@ $a->foo = PHP_INT_MIN; try { $_[0]--; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { --$_[0]; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $a->foo = PHP_INT_MAX; try { $_[0]++; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { ++$_[0]; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $_[0] = 0; try { $_[0] = []; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->foo); $_[0] = 1; @@ -63,18 +63,18 @@ var_dump($a->foo); --EXPECT-- int(2) int(21) -Cannot assign string to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign string to reference held by property class@anonymous::$foo of type int int(21) int(20) int(19) -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property class@anonymous::$foo of type int past its minimal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property class@anonymous::$foo of type int past its maximal value integer -Cannot assign array to reference held by property class@anonymous::$foo of type int +TypeError: Cannot assign array to reference held by property class@anonymous::$foo of type int int(0) int(1) diff --git a/Zend/tests/type_declarations/typed_properties_065.phpt b/Zend/tests/type_declarations/typed_properties_065.phpt index a3a536da07e1..9b12d117b34a 100644 --- a/Zend/tests/type_declarations/typed_properties_065.phpt +++ b/Zend/tests/type_declarations/typed_properties_065.phpt @@ -31,24 +31,24 @@ $a->foo = PHP_INT_MIN; try { $a[0]--; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { --$a[0]; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; $a->foo = PHP_INT_MAX; try { $a[0]++; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; try { ++$a[0]; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } echo gettype($a->foo),"\n"; ?> @@ -61,11 +61,11 @@ offsetSet(1e50) int(1) int(0) int(-1) -Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value integer -Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property ArrayAccess@anonymous::$foo of type int past its minimal value integer -Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value integer -Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property ArrayAccess@anonymous::$foo of type int past its maximal value integer diff --git a/Zend/tests/type_declarations/typed_properties_068.phpt b/Zend/tests/type_declarations/typed_properties_068.phpt index 38597559cf04..0594dcae99f9 100644 --- a/Zend/tests/type_declarations/typed_properties_068.phpt +++ b/Zend/tests/type_declarations/typed_properties_068.phpt @@ -28,12 +28,12 @@ var_dump($i, Foo::$i); try { $i = null; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($i, Foo::$i); try { Foo::$i = null; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($i, Foo::$i); Foo::$s = &ref(5); @@ -44,17 +44,17 @@ var_dump(Foo::$i, ref()); try { Foo::$i = &ref("x"); -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::$i, ref()); try { Foo::$i = &Foo::$s; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::$i, Foo::$s); try { Foo::$s = &Foo::$i; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::$i, Foo::$s); ?> @@ -66,22 +66,22 @@ int(3) int(3) int(4) int(4) -Cannot assign null to reference held by property Foo::$i of type int +TypeError: Cannot assign null to reference held by property Foo::$i of type int int(4) int(4) -Cannot assign null to property Foo::$i of type int +TypeError: Cannot assign null to property Foo::$i of type int int(4) int(4) string(1) "5" string(1) "5" int(0) int(0) -Cannot assign string to property Foo::$i of type int +TypeError: Cannot assign string to property Foo::$i of type int int(0) string(1) "x" -Reference with value of type string held by property Foo::$s of type string is not compatible with property Foo::$i of type int +TypeError: Reference with value of type string held by property Foo::$s of type string is not compatible with property Foo::$i of type int int(0) string(1) "5" -Reference with value of type int held by property Foo::$i of type int is not compatible with property Foo::$s of type string +TypeError: Reference with value of type int held by property Foo::$i of type int is not compatible with property Foo::$s of type string int(0) string(1) "5" diff --git a/Zend/tests/type_declarations/typed_properties_069.phpt b/Zend/tests/type_declarations/typed_properties_069.phpt index 7d84407102d9..4d961c6c113d 100644 --- a/Zend/tests/type_declarations/typed_properties_069.phpt +++ b/Zend/tests/type_declarations/typed_properties_069.phpt @@ -14,14 +14,14 @@ class Foo { try { Foo::$i = &nonNumericStringRef(); -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::$i); -} catch (Error $e) { print $e->getMessage()."\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(nonNumericStringRef()); ?> --EXPECT-- -Cannot assign string to property Foo::$i of type int -Typed static property Foo::$i must not be accessed before initialization +TypeError: Cannot assign string to property Foo::$i of type int +Error: Typed static property Foo::$i must not be accessed before initialization string(1) "x" diff --git a/Zend/tests/type_declarations/typed_properties_070.phpt b/Zend/tests/type_declarations/typed_properties_070.phpt index d039fca3b143..49bcc7a43735 100644 --- a/Zend/tests/type_declarations/typed_properties_070.phpt +++ b/Zend/tests/type_declarations/typed_properties_070.phpt @@ -29,12 +29,12 @@ var_dump(Foo::$i); try { Foo::$i += PHP_INT_MAX; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::$i); try { Foo::$i .= PHP_INT_MAX; -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::$i); ?> @@ -43,7 +43,7 @@ string(2) "11" string(2) "13" string(2) "12" int(1) -Cannot assign float to property Foo::$i of type int +TypeError: Cannot assign float to property Foo::$i of type int int(1) -Cannot assign string to property Foo::$i of type int +TypeError: Cannot assign string to property Foo::$i of type int int(1) diff --git a/Zend/tests/type_declarations/typed_properties_074.phpt b/Zend/tests/type_declarations/typed_properties_074.phpt index 3f98e72f7366..aa7e4cff8e33 100644 --- a/Zend/tests/type_declarations/typed_properties_074.phpt +++ b/Zend/tests/type_declarations/typed_properties_074.phpt @@ -18,7 +18,7 @@ unset($test->val); var_dump($test); try { var_dump($test->val); -} catch (TypeError $e) { print $e->getMessage()."\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); $test->prop = "y"; @@ -32,7 +32,7 @@ object(Test)#1 (1) { ["val"]=> uninitialized(int) } -Value of type string returned from Test::__get() must be compatible with unset property Test::$val of type int +TypeError: Value of type string returned from Test::__get() must be compatible with unset property Test::$val of type int object(Test)#1 (1) { ["prop"]=> &string(1) "x" diff --git a/Zend/tests/type_declarations/typed_properties_075.phpt b/Zend/tests/type_declarations/typed_properties_075.phpt index 42e74ebce441..d674a736d451 100644 --- a/Zend/tests/type_declarations/typed_properties_075.phpt +++ b/Zend/tests/type_declarations/typed_properties_075.phpt @@ -12,7 +12,7 @@ class Foo { try { Foo::$bar++; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump(Foo::$bar); @@ -20,7 +20,7 @@ var_dump(Foo::$bar); try { Foo::$bar += 1; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump(Foo::$bar); @@ -28,7 +28,7 @@ var_dump(Foo::$bar); try { ++Foo::$bar; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump(Foo::$bar); @@ -36,18 +36,18 @@ var_dump(Foo::$bar); try { Foo::$bar = Foo::$bar + 1; } catch(TypeError $t) { - var_dump($t->getMessage()); + echo $t::class, ': ', $t->getMessage(), "\n"; } var_dump(Foo::$bar); ?> --EXPECT-- -string(70) "Cannot increment property Foo::$bar of type int past its maximal value" +TypeError: Cannot increment property Foo::$bar of type int past its maximal value int(9223372036854775807) -string(53) "Cannot assign float to property Foo::$bar of type int" +TypeError: Cannot assign float to property Foo::$bar of type int int(9223372036854775807) -string(70) "Cannot increment property Foo::$bar of type int past its maximal value" +TypeError: Cannot increment property Foo::$bar of type int past its maximal value int(9223372036854775807) -string(53) "Cannot assign float to property Foo::$bar of type int" +TypeError: Cannot assign float to property Foo::$bar of type int int(9223372036854775807) diff --git a/Zend/tests/type_declarations/typed_properties_076.phpt b/Zend/tests/type_declarations/typed_properties_076.phpt index b0d0bfedf808..da3346458308 100644 --- a/Zend/tests/type_declarations/typed_properties_076.phpt +++ b/Zend/tests/type_declarations/typed_properties_076.phpt @@ -37,13 +37,13 @@ function valid(Test $test, string $prop1, string $prop2, $value) { $test->$prop2 = $value; $test->$prop1 =& $test->$prop2; } catch (TypeError $e) { - echo "Valid assignment $prop1 =& $prop2 threw {$e->getMessage()}\n"; + echo "Valid assignment $prop1 =& $prop2 ", $e::class, ': ', $e->getMessage(), "\n"; } try { $test->$prop1 = $value; $test->$prop2 =& $test->$prop1; } catch (TypeError $e) { - echo "Valid assignment $prop2 =& $prop1 threw {$e->getMessage()}\n"; + echo "Valid assignment $prop2 =& $prop1 ", $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/type_declarations/typed_properties_078.phpt b/Zend/tests/type_declarations/typed_properties_078.phpt index 07e9384b6f54..dd1e772c3f94 100644 --- a/Zend/tests/type_declarations/typed_properties_078.phpt +++ b/Zend/tests/type_declarations/typed_properties_078.phpt @@ -16,7 +16,7 @@ var_dump($ref); try { $a->t = &$ref; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref); $a->it = [1]; // type is still assignable @@ -24,7 +24,7 @@ var_dump($ref); try { $ref = new ArrayIterator(); -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref instanceof ArrayIterator); unset($a->a); @@ -35,7 +35,7 @@ $a->t = &$ref; try { $ref = []; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref instanceof ArrayIterator); $ref = new ArrayIterator(); @@ -45,15 +45,15 @@ var_dump($ref instanceof ArrayIterator); --EXPECT-- array(0) { } -string(72) "Cannot assign array to property class@anonymous::$t of type ?Traversable" +TypeError: Cannot assign array to property class@anonymous::$t of type ?Traversable array(0) { } array(1) { [0]=> int(1) } -string(92) "Cannot assign ArrayIterator to reference held by property class@anonymous::$a of type ?array" +TypeError: Cannot assign ArrayIterator to reference held by property class@anonymous::$a of type ?array bool(false) -string(90) "Cannot assign array to reference held by property class@anonymous::$t of type ?Traversable" +TypeError: Cannot assign array to reference held by property class@anonymous::$t of type ?Traversable bool(false) bool(true) diff --git a/Zend/tests/type_declarations/typed_properties_079.phpt b/Zend/tests/type_declarations/typed_properties_079.phpt index d189cec6d4ce..f734885fa2c7 100644 --- a/Zend/tests/type_declarations/typed_properties_079.phpt +++ b/Zend/tests/type_declarations/typed_properties_079.phpt @@ -12,7 +12,7 @@ A::$a = &A::$it; try { A::$it = new ArrayIterator(); -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(A::$it); A::$a = &$a; @@ -21,13 +21,13 @@ A::$it = new ArrayIterator(); try { $a = 1; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); ?> --EXPECT-- -string(78) "Cannot assign ArrayIterator to reference held by property A::$a of type ?array" +TypeError: Cannot assign ArrayIterator to reference held by property A::$a of type ?array array(0) { } -string(68) "Cannot assign int to reference held by property A::$a of type ?array" +TypeError: Cannot assign int to reference held by property A::$a of type ?array NULL diff --git a/Zend/tests/type_declarations/typed_properties_080.phpt b/Zend/tests/type_declarations/typed_properties_080.phpt index 58a17a1a965f..21977ab0b822 100644 --- a/Zend/tests/type_declarations/typed_properties_080.phpt +++ b/Zend/tests/type_declarations/typed_properties_080.phpt @@ -12,17 +12,17 @@ class Test { try { self::$a; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { self::$b; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { self::$c; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -31,6 +31,6 @@ Test::run(); ?> --EXPECT-- -Typed static property Test::$a must not be accessed before initialization -Typed static property Test::$b must not be accessed before initialization -Typed static property Test::$c must not be accessed before initialization +Error: Typed static property Test::$a must not be accessed before initialization +Error: Typed static property Test::$b must not be accessed before initialization +Error: Typed static property Test::$c must not be accessed before initialization diff --git a/Zend/tests/type_declarations/typed_properties_081.phpt b/Zend/tests/type_declarations/typed_properties_081.phpt index f6d2114c6f25..ebab48f5156b 100644 --- a/Zend/tests/type_declarations/typed_properties_081.phpt +++ b/Zend/tests/type_declarations/typed_properties_081.phpt @@ -13,10 +13,10 @@ $test2 = clone $test; unset($test); try { $x = "foo"; -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test2->x); ?> --EXPECT-- -Cannot assign string to reference held by property Test::$x of type int +TypeError: Cannot assign string to reference held by property Test::$x of type int int(42) diff --git a/Zend/tests/type_declarations/typed_properties_082.phpt b/Zend/tests/type_declarations/typed_properties_082.phpt index d212f1852cbf..cdafa31b6cba 100644 --- a/Zend/tests/type_declarations/typed_properties_082.phpt +++ b/Zend/tests/type_declarations/typed_properties_082.phpt @@ -14,7 +14,7 @@ class Test2 extends Test { $x =& Test::$x; try { $x = "foo"; -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($x, Test::$x); Test::$x =& Test2::$y; // remove the typed ref from $x @@ -23,7 +23,7 @@ var_dump($x, Test::$x); ?> --EXPECT-- -Cannot assign string to reference held by property Test::$x of type int +TypeError: Cannot assign string to reference held by property Test::$x of type int int(0) int(0) string(3) "foo" diff --git a/Zend/tests/type_declarations/typed_properties_083.phpt b/Zend/tests/type_declarations/typed_properties_083.phpt index f67eec302a4e..611e07beb30e 100644 --- a/Zend/tests/type_declarations/typed_properties_083.phpt +++ b/Zend/tests/type_declarations/typed_properties_083.phpt @@ -17,15 +17,15 @@ var_dump($a->i); try { $a->p[] = "test"; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { // must be uninit var_dump($a->p); // WRONG! -} catch (Error $e) { var_dump($e->getMessage()); } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } $a->p = null; try { $a->p[] = "test"; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->p); Foo::$a["bar"] = 2; @@ -33,10 +33,10 @@ var_dump(Foo::$a); try { Foo::$s["baz"][] = "baz"; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { // must be uninit var_dump(Foo::$s); -} catch (Error $e) { var_dump($e->getMessage()); } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } Foo::$a = null; $ref = &Foo::$a; @@ -46,12 +46,12 @@ var_dump($ref); $ref = &$a->p; try { $ref[] = "bar"; -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref); try { $ref["baz"][] = "bar"; // indirect assign -} catch (TypeError $e) { var_dump($e->getMessage()); } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref); ?> @@ -60,21 +60,21 @@ array(1) { [0]=> int(1) } -string(71) "Cannot auto-initialize an array inside property Foo::$p of type ?string" -string(65) "Typed property Foo::$p must not be accessed before initialization" -string(71) "Cannot auto-initialize an array inside property Foo::$p of type ?string" +TypeError: Cannot auto-initialize an array inside property Foo::$p of type ?string +Error: Typed property Foo::$p must not be accessed before initialization +TypeError: Cannot auto-initialize an array inside property Foo::$p of type ?string NULL array(1) { ["bar"]=> int(2) } -string(71) "Cannot auto-initialize an array inside property Foo::$s of type ?string" -string(72) "Typed static property Foo::$s must not be accessed before initialization" +TypeError: Cannot auto-initialize an array inside property Foo::$s of type ?string +Error: Typed static property Foo::$s must not be accessed before initialization array(1) { [0]=> int(3) } -string(91) "Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string" +TypeError: Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string NULL -string(91) "Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string" +TypeError: Cannot auto-initialize an array inside a reference held by property Foo::$p of type ?string NULL diff --git a/Zend/tests/type_declarations/typed_properties_093.phpt b/Zend/tests/type_declarations/typed_properties_093.phpt index 1f4bf4cb8cae..4ecf61d57f70 100644 --- a/Zend/tests/type_declarations/typed_properties_093.phpt +++ b/Zend/tests/type_declarations/typed_properties_093.phpt @@ -18,13 +18,13 @@ $ref = "foobar"; try { $test->$name =& $ref; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); ?> --EXPECT-- -Cannot assign string to property Test::$prop of type int +TypeError: Cannot assign string to property Test::$prop of type int object(Test)#2 (0) { ["prop"]=> uninitialized(int) diff --git a/Zend/tests/type_declarations/typed_properties_095.phpt b/Zend/tests/type_declarations/typed_properties_095.phpt index 4d8e5168e15e..966edaf2bd99 100644 --- a/Zend/tests/type_declarations/typed_properties_095.phpt +++ b/Zend/tests/type_declarations/typed_properties_095.phpt @@ -13,14 +13,14 @@ var_dump($obj->intProp); try { $obj->intProp = "foobar"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj->intProp = 456; try { $obj->classProp = $obj; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj->classProp = new stdClass; var_dump($obj); @@ -35,14 +35,14 @@ var_dump($obj->intProp); try { $obj->intProp = "foobar"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj->intProp = 456; try { $obj->classProp = $obj; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj->classProp = new stdClass; var_dump($obj); @@ -53,7 +53,7 @@ var_dump(_ZendTestClass::$staticIntProp); try { _ZendTestClass::$staticIntProp = "foobar"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } _ZendTestClass::$staticIntProp = 456; var_dump(_ZendTestClass::$staticIntProp); @@ -61,8 +61,8 @@ var_dump(_ZendTestClass::$staticIntProp); ?> --EXPECT-- int(123) -Cannot assign string to property _ZendTestClass::$intProp of type int -Cannot assign _ZendTestClass to property _ZendTestClass::$classProp of type ?stdClass +TypeError: Cannot assign string to property _ZendTestClass::$intProp of type int +TypeError: Cannot assign _ZendTestClass to property _ZendTestClass::$classProp of type ?stdClass object(_ZendTestClass)#1 (3) { ["intProp"]=> int(456) @@ -81,8 +81,8 @@ object(_ZendTestClass)#1 (3) { uninitialized(Iterator|(Traversable&Countable)) } int(123) -Cannot assign string to property _ZendTestClass::$intProp of type int -Cannot assign Test to property _ZendTestClass::$classProp of type ?stdClass +TypeError: Cannot assign string to property _ZendTestClass::$intProp of type int +TypeError: Cannot assign Test to property _ZendTestClass::$classProp of type ?stdClass object(Test)#4 (3) { ["intProp"]=> int(456) @@ -101,5 +101,5 @@ object(Test)#4 (3) { uninitialized(Iterator|(Traversable&Countable)) } int(123) -Cannot assign string to property _ZendTestClass::$staticIntProp of type int +TypeError: Cannot assign string to property _ZendTestClass::$staticIntProp of type int int(456) diff --git a/Zend/tests/type_declarations/typed_properties_096.phpt b/Zend/tests/type_declarations/typed_properties_096.phpt index 83f086d345a5..9002fd7c9b3d 100644 --- a/Zend/tests/type_declarations/typed_properties_096.phpt +++ b/Zend/tests/type_declarations/typed_properties_096.phpt @@ -14,7 +14,7 @@ $ref =& $test->prop2; try { $test->prop =& $ref; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); @@ -31,7 +31,7 @@ var_dump($test); ?> --EXPECT-- -Cannot assign int to property Test1::$prop of type Foobar +TypeError: Cannot assign int to property Test1::$prop of type Foobar object(Test1)#1 (1) { ["prop"]=> uninitialized(Foobar) diff --git a/Zend/tests/type_declarations/typed_properties_097.phpt b/Zend/tests/type_declarations/typed_properties_097.phpt index 6697f2ad2755..40a3837af2a2 100644 --- a/Zend/tests/type_declarations/typed_properties_097.phpt +++ b/Zend/tests/type_declarations/typed_properties_097.phpt @@ -15,13 +15,13 @@ $test->foo = PHP_INT_MIN; try { --$test->foo; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); try { $test->foo--; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); @@ -29,13 +29,13 @@ $test->foo = PHP_INT_MAX; try { ++$test->foo; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); try { $test->foo++; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); @@ -46,13 +46,13 @@ $test->foo = PHP_INT_MIN; try { --$test->foo; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); try { $test->foo--; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); @@ -60,31 +60,31 @@ $test->foo = PHP_INT_MAX; try { ++$test->foo; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); try { $test->foo++; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->foo); ?> --EXPECT-- -Cannot decrement property Test::$foo of type int past its minimal value +TypeError: Cannot decrement property Test::$foo of type int past its minimal value int(-9223372036854775808) -Cannot decrement property Test::$foo of type int past its minimal value +TypeError: Cannot decrement property Test::$foo of type int past its minimal value int(-9223372036854775808) -Cannot increment property Test::$foo of type int past its maximal value +TypeError: Cannot increment property Test::$foo of type int past its maximal value int(9223372036854775807) -Cannot increment property Test::$foo of type int past its maximal value +TypeError: Cannot increment property Test::$foo of type int past its maximal value int(9223372036854775807) -Cannot decrement a reference held by property Test::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property Test::$foo of type int past its minimal value int(-9223372036854775808) -Cannot decrement a reference held by property Test::$foo of type int past its minimal value +TypeError: Cannot decrement a reference held by property Test::$foo of type int past its minimal value int(-9223372036854775808) -Cannot increment a reference held by property Test::$foo of type int past its maximal value +TypeError: Cannot increment a reference held by property Test::$foo of type int past its maximal value +int(9223372036854775807) +TypeError: Cannot increment a reference held by property Test::$foo of type int past its maximal value int(9223372036854775807) -Cannot increment a reference held by property Test::$foo of type int past its maximal value -int(9223372036854775807) \ No newline at end of file diff --git a/Zend/tests/type_declarations/typed_properties_102.phpt b/Zend/tests/type_declarations/typed_properties_102.phpt index 83f3c26186fc..c1fe26a61552 100644 --- a/Zend/tests/type_declarations/typed_properties_102.phpt +++ b/Zend/tests/type_declarations/typed_properties_102.phpt @@ -12,11 +12,11 @@ Test::$prop =& Test::$intProp; try { Test::$prop .= "foobar"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Test::$prop, Test::$intProp); ?> --EXPECT-- -Cannot assign string to reference held by property Test::$intProp of type int +TypeError: Cannot assign string to reference held by property Test::$intProp of type int int(123) int(123) diff --git a/Zend/tests/type_declarations/typed_properties_105.phpt b/Zend/tests/type_declarations/typed_properties_105.phpt index 747ff9f19052..98fca7ce7d9f 100644 --- a/Zend/tests/type_declarations/typed_properties_105.phpt +++ b/Zend/tests/type_declarations/typed_properties_105.phpt @@ -17,4 +17,3 @@ var_dump(array_key_exists('c', $defaults)); array(0) { } bool(false) - diff --git a/Zend/tests/type_declarations/typed_properties_106.phpt b/Zend/tests/type_declarations/typed_properties_106.phpt index 344cfa5349ee..7276e5f33a54 100644 --- a/Zend/tests/type_declarations/typed_properties_106.phpt +++ b/Zend/tests/type_declarations/typed_properties_106.phpt @@ -10,17 +10,17 @@ $ref =& $obj->prop; try { $ref = [1]; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ary = [1]; $ref = $ary; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref); ?> --EXPECT-- -Cannot assign array to reference held by property Test::$prop of type ?Type -Cannot assign array to reference held by property Test::$prop of type ?Type +TypeError: Cannot assign array to reference held by property Test::$prop of type ?Type +TypeError: Cannot assign array to reference held by property Test::$prop of type ?Type NULL diff --git a/Zend/tests/type_declarations/typed_properties_110.phpt b/Zend/tests/type_declarations/typed_properties_110.phpt index 6a108b4529c6..f6c94f0bed3d 100644 --- a/Zend/tests/type_declarations/typed_properties_110.phpt +++ b/Zend/tests/type_declarations/typed_properties_110.phpt @@ -12,9 +12,9 @@ $foo->value = null; try { $foo->value = 1; } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign int to property Foo::$value of type null +TypeError: Cannot assign int to property Foo::$value of type null diff --git a/Zend/tests/type_declarations/typed_properties_111.phpt b/Zend/tests/type_declarations/typed_properties_111.phpt index 20236e8a19bb..74cb5597b488 100644 --- a/Zend/tests/type_declarations/typed_properties_111.phpt +++ b/Zend/tests/type_declarations/typed_properties_111.phpt @@ -12,9 +12,9 @@ $foo->value = false; try { $foo->value = true; } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign true to property Foo::$value of type false +TypeError: Cannot assign true to property Foo::$value of type false diff --git a/Zend/tests/type_declarations/typed_properties_112.phpt b/Zend/tests/type_declarations/typed_properties_112.phpt index 8b1157759fec..b6a52cd87bf5 100644 --- a/Zend/tests/type_declarations/typed_properties_112.phpt +++ b/Zend/tests/type_declarations/typed_properties_112.phpt @@ -11,9 +11,9 @@ $foo = new Foo(); try { $foo->value = false; } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign false to property Foo::$value of type true +TypeError: Cannot assign false to property Foo::$value of type true diff --git a/Zend/tests/type_declarations/typed_properties_114.phpt b/Zend/tests/type_declarations/typed_properties_114.phpt index 5f3093dd3308..1d4b30184625 100644 --- a/Zend/tests/type_declarations/typed_properties_114.phpt +++ b/Zend/tests/type_declarations/typed_properties_114.phpt @@ -17,14 +17,14 @@ foreach ($obj as $k => &$v) { try { $v = []; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } foreach ($obj as $k => &$v) { try { $v = []; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -32,10 +32,10 @@ var_dump($obj); ?> --EXPECTF-- Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d -Cannot assign array to reference held by property A::$foo of type string +TypeError: Cannot assign array to reference held by property A::$foo of type string Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d -Cannot assign array to reference held by property A::$foo of type string +TypeError: Cannot assign array to reference held by property A::$foo of type string object(A)#1 (1) { ["foo"]=> &string(3) "bar" diff --git a/Zend/tests/type_declarations/typed_properties_115.phpt b/Zend/tests/type_declarations/typed_properties_115.phpt index 6347ee0c35d6..d929fb60dc86 100644 --- a/Zend/tests/type_declarations/typed_properties_115.phpt +++ b/Zend/tests/type_declarations/typed_properties_115.phpt @@ -17,14 +17,14 @@ $obj = new A; try { foreach ($obj as $k => &$v) {} } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($obj); ?> --EXPECTF-- Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d -Cannot acquire reference to readonly property A::$foo +Error: Cannot acquire reference to readonly property A::$foo object(A)#1 (1) { ["foo"]=> string(3) "bar" diff --git a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt index 72cff1058f22..ebc60be52b28 100644 --- a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt +++ b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt @@ -12,7 +12,7 @@ class Test { try { $this->prop = "foobar"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($this->prop); } @@ -24,7 +24,7 @@ $test->method(); ?> --EXPECT-- -Cannot assign string to property Test::$prop of type int +TypeError: Cannot assign string to property Test::$prop of type int int(1) -Cannot assign string to property Test::$prop of type int +TypeError: Cannot assign string to property Test::$prop of type int int(1) diff --git a/Zend/tests/type_declarations/typed_properties_class_loading.phpt b/Zend/tests/type_declarations/typed_properties_class_loading.phpt index a81bc5b4fe09..a9205fb2948d 100644 --- a/Zend/tests/type_declarations/typed_properties_class_loading.phpt +++ b/Zend/tests/type_declarations/typed_properties_class_loading.phpt @@ -16,7 +16,7 @@ $test = new Test; try { $test->propX = new stdClass; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (true) { @@ -31,7 +31,7 @@ $r =& $test->propY; try { $test->propY = new stdClass; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (true) { @@ -43,9 +43,9 @@ var_dump($test->propY); ?> --EXPECT-- -Cannot assign stdClass to property Test::$propX of type X +TypeError: Cannot assign stdClass to property Test::$propX of type X object(X)#3 (0) { } -Cannot assign stdClass to property Test::$propY of type ?Y +TypeError: Cannot assign stdClass to property Test::$propY of type ?Y object(Y)#4 (0) { } diff --git a/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt b/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt index 5754591ce7d5..a380cac92d51 100644 --- a/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt +++ b/Zend/tests/type_declarations/typed_properties_failed_assign_is_not_init.phpt @@ -16,21 +16,21 @@ $test = new Test; try { $test->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop = "foo"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property Test::$prop must not be accessed before initialization -Cannot assign string to property Test::$prop of type int -Typed property Test::$prop must not be accessed before initialization +Error: Typed property Test::$prop must not be accessed before initialization +TypeError: Cannot assign string to property Test::$prop of type int +Error: Typed property Test::$prop must not be accessed before initialization diff --git a/Zend/tests/type_declarations/typed_properties_magic_set.phpt b/Zend/tests/type_declarations/typed_properties_magic_set.phpt index 70a7d4fe6f07..7c77a4adfcc6 100644 --- a/Zend/tests/type_declarations/typed_properties_magic_set.phpt +++ b/Zend/tests/type_declarations/typed_properties_magic_set.phpt @@ -25,7 +25,7 @@ $test = new Test; try { var_dump($test->foo); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($test->foo)); $test->foo = 42; @@ -61,7 +61,7 @@ $test->foo = 42; ?> --EXPECT-- -Typed property Test::$foo must not be accessed before initialization +Error: Typed property Test::$foo must not be accessed before initialization bool(false) int(42) __set foo = 42 diff --git a/Zend/tests/type_declarations/union_types/anonymous_class.phpt b/Zend/tests/type_declarations/union_types/anonymous_class.phpt index 1e009f22b00f..1ffec32de05e 100644 --- a/Zend/tests/type_declarations/union_types/anonymous_class.phpt +++ b/Zend/tests/type_declarations/union_types/anonymous_class.phpt @@ -16,15 +16,15 @@ $a = new class { try { $a->testParam(null); } catch (\Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->test(); } catch (\Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d -class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned +TypeError: class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d +TypeError: class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned diff --git a/Zend/tests/type_declarations/union_types/incdec_prop.phpt b/Zend/tests/type_declarations/union_types/incdec_prop.phpt index 7b61fc9fe60c..b1ad4dd3d260 100644 --- a/Zend/tests/type_declarations/union_types/incdec_prop.phpt +++ b/Zend/tests/type_declarations/union_types/incdec_prop.phpt @@ -56,28 +56,28 @@ try { $test->prop2 = PHP_INT_MAX; $x = $test->prop2++; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop2 = PHP_INT_MAX; $x = ++$test->prop2; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop2 = PHP_INT_MIN; $x = $test->prop2--; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop2 = PHP_INT_MIN; $x = --$test->prop2; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -85,7 +85,7 @@ try { $r =& $test->prop2; $x = $test->prop2++; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -93,7 +93,7 @@ try { $r =& $test->prop2; $x = ++$test->prop2; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -101,7 +101,7 @@ try { $r =& $test->prop2; $x = $test->prop2--; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -109,7 +109,7 @@ try { $r =& $test->prop2; $x = --$test->prop2; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -122,11 +122,11 @@ bool(true) bool(true) bool(true) bool(true) -Cannot increment property Test::$prop2 of type int|bool past its maximal value -Cannot increment property Test::$prop2 of type int|bool past its maximal value -Cannot decrement property Test::$prop2 of type int|bool past its minimal value -Cannot decrement property Test::$prop2 of type int|bool past its minimal value -Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value -Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value -Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value -Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value +TypeError: Cannot increment property Test::$prop2 of type int|bool past its maximal value +TypeError: Cannot increment property Test::$prop2 of type int|bool past its maximal value +TypeError: Cannot decrement property Test::$prop2 of type int|bool past its minimal value +TypeError: Cannot decrement property Test::$prop2 of type int|bool past its minimal value +TypeError: Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value +TypeError: Cannot increment a reference held by property Test::$prop2 of type int|bool past its maximal value +TypeError: Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value +TypeError: Cannot decrement a reference held by property Test::$prop2 of type int|bool past its minimal value diff --git a/Zend/tests/type_declarations/union_types/inheritance_internal.phpt b/Zend/tests/type_declarations/union_types/inheritance_internal.phpt index 9841e34ff90d..76a9089f56c7 100644 --- a/Zend/tests/type_declarations/union_types/inheritance_internal.phpt +++ b/Zend/tests/type_declarations/union_types/inheritance_internal.phpt @@ -13,7 +13,7 @@ $obj->classUnionProp = new ArrayIterator; try { $obj->classUnionProp = new DateTime; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = new C; @@ -22,10 +22,10 @@ $obj->classUnionProp = new ArrayIterator; try { $obj->classUnionProp = new DateTime; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null -Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null +TypeError: Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null +TypeError: Cannot assign DateTime to property _ZendTestClass::$classUnionProp of type stdClass|Iterator|null diff --git a/Zend/tests/type_declarations/union_types/multiple_classes.phpt b/Zend/tests/type_declarations/union_types/multiple_classes.phpt index b45fc02d83fa..4e31dd0dcb11 100644 --- a/Zend/tests/type_declarations/union_types/multiple_classes.phpt +++ b/Zend/tests/type_declarations/union_types/multiple_classes.phpt @@ -28,13 +28,13 @@ var_dump($test->method("42")); try { $test->prop = new stdClass; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->method(new stdClass); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (true) { @@ -67,8 +67,8 @@ int(42) int(42) int(42) int(42) -Cannot assign stdClass to property Test::$prop of type X|Y|Z|int -Test::method(): Argument #1 ($arg) must be of type X|Y|Z|int, stdClass given, called in %s on line %d +TypeError: Cannot assign stdClass to property Test::$prop of type X|Y|Z|int +TypeError: Test::method(): Argument #1 ($arg) must be of type X|Y|Z|int, stdClass given, called in %s on line %d object(X)#4 (0) { } object(X)#6 (0) { diff --git a/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt b/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt index a8db8fca9cd5..fd262352551d 100644 --- a/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt +++ b/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt @@ -17,7 +17,7 @@ $v = 42; try { $r = $v; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($r, $v); @@ -25,7 +25,7 @@ $v = 42.0; try { $r = $v; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($r, $v); @@ -35,7 +35,7 @@ $test->x = 42; try { $test->y =& $test->x; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($test->x, $test->y); @@ -44,16 +44,16 @@ $test->y = 42.0; try { $test->x =& $test->y; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign int to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion +TypeError: Cannot assign int to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion string(6) "foobar" int(42) -Cannot assign float to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion +TypeError: Cannot assign float to reference held by property Test::$x of type string|int and property Test::$y of type string|float, as this would result in an inconsistent type conversion string(6) "foobar" float(42) -Reference with value of type int held by property Test::$x of type string|int is not compatible with property Test::$y of type string|float -Reference with value of type float held by property Test::$y of type string|float is not compatible with property Test::$x of type string|int +TypeError: Reference with value of type int held by property Test::$x of type string|int is not compatible with property Test::$y of type string|float +TypeError: Reference with value of type float held by property Test::$y of type string|float is not compatible with property Test::$x of type string|int diff --git a/Zend/tests/type_declarations/variance/loading_exception1.phpt b/Zend/tests/type_declarations/variance/loading_exception1.phpt index ea5be4e56f05..7c0938725617 100644 --- a/Zend/tests/type_declarations/variance/loading_exception1.phpt +++ b/Zend/tests/type_declarations/variance/loading_exception1.phpt @@ -13,7 +13,7 @@ for ($i = 0; $i < 2; $i++) { class B extends A { } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -34,13 +34,13 @@ try { class B extends A implements I { } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Class A does not exist -Class A does not exist +Exception: Class A does not exist +Exception: Class A does not exist Fatal error: During inheritance of B with variance dependencies: Uncaught Exception: Class A does not exist in %s:%d Stack trace: diff --git a/Zend/tests/type_declarations/variance/loading_exception2.phpt b/Zend/tests/type_declarations/variance/loading_exception2.phpt index db9c6b276581..63c8ca894878 100644 --- a/Zend/tests/type_declarations/variance/loading_exception2.phpt +++ b/Zend/tests/type_declarations/variance/loading_exception2.phpt @@ -15,7 +15,7 @@ for ($i = 0; $i < 2; $i++) { class B extends A implements I { } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -36,13 +36,13 @@ try { class B extends A implements I, J { } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Class I does not exist -Class I does not exist +Exception: Class I does not exist +Exception: Class I does not exist Fatal error: During inheritance of B with variance dependencies: Uncaught Exception: Class I does not exist in %s:%d Stack trace: diff --git a/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt b/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt index 2b5a9c8423eb..ab0fe86106c0 100644 --- a/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt +++ b/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt @@ -11,9 +11,9 @@ try { class B extends A { } } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "B" not found +Error: Class "B" not found diff --git a/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt b/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt index 247e1cf2b10b..67c32d0c6aee 100644 --- a/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt +++ b/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt @@ -11,9 +11,9 @@ try { interface B extends A { } } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Interface "B" not found +Error: Interface "B" not found diff --git a/Zend/tests/undef_index_to_exception.phpt b/Zend/tests/undef_index_to_exception.phpt index bbe13c0e71d0..c9e756b3a61e 100644 --- a/Zend/tests/undef_index_to_exception.phpt +++ b/Zend/tests/undef_index_to_exception.phpt @@ -11,14 +11,14 @@ $test = []; try { $test[0] .= "xyz"; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); try { $test["key"] .= "xyz"; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); @@ -26,21 +26,21 @@ unset($test); try { $GLOBALS["test"] .= "xyz"; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined array key 0 +Exception: Undefined array key 0 array(0) { } -Undefined array key "key" +Exception: Undefined array key "key" array(0) { } -Undefined global variable $test -Undefined variable $test +Exception: Undefined global variable $test +Exception: Undefined variable $test diff --git a/Zend/tests/undefined_multidimensional_array.phpt b/Zend/tests/undefined_multidimensional_array.phpt index 6593d6ba4ad4..fdbd0bf5f397 100644 --- a/Zend/tests/undefined_multidimensional_array.phpt +++ b/Zend/tests/undefined_multidimensional_array.phpt @@ -12,7 +12,7 @@ $arr[1][2][3][4][5]->foo; try { $arr[1][2][3][4][5]->foo = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $arr[][] = 2; @@ -20,7 +20,7 @@ $arr[][] = 2; try { $arr[][]->bar = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -62,5 +62,5 @@ Warning: Trying to access array offset on null in %s on line %d Warning: Trying to access array offset on null in %s on line %d Warning: Attempt to read property "foo" on null in %s on line %d -Attempt to assign property "foo" on null -Attempt to assign property "bar" on null +Error: Attempt to assign property "foo" on null +Error: Attempt to assign property "bar" on null diff --git a/Zend/tests/unpack_iterator_by_ref_type_check.phpt b/Zend/tests/unpack_iterator_by_ref_type_check.phpt index 2fef31056bdc..31f31e69af27 100644 --- a/Zend/tests/unpack_iterator_by_ref_type_check.phpt +++ b/Zend/tests/unpack_iterator_by_ref_type_check.phpt @@ -10,9 +10,9 @@ function gen() { try { test(...gen()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Cannot pass by-reference argument 1 of test() by unpacking a Traversable, passing by-value instead in %s on line %d -test(): Argument #1 ($a) must be of type T, null given, called in %s on line %d +TypeError: test(): Argument #1 ($a) must be of type T, null given, called in %s on line %d diff --git a/Zend/tests/unset/unset_non_array.phpt b/Zend/tests/unset/unset_non_array.phpt index 5d7ad4d44b87..2bd8ccaa760e 100644 --- a/Zend/tests/unset/unset_non_array.phpt +++ b/Zend/tests/unset/unset_non_array.phpt @@ -15,35 +15,35 @@ $x = true; try { unset($x[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = 1; try { unset($x[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = 3.14; try { unset($x[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = "str"; try { unset($x[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = new stdClass; try { unset($x[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // And now repeat the same with a nested offset. @@ -61,35 +61,35 @@ $x = true; try { unset($x[0][0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = 1; try { unset($x[0][0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = 3.14; try { unset($x[0][0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = "str"; try { unset($x[0][0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = new stdClass; try { unset($x[0][0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -97,17 +97,17 @@ try { Warning: Undefined variable $x in %s on line %d Deprecated: Automatic conversion of false to array is deprecated in %s -Cannot unset offset in a non-array variable -Cannot unset offset in a non-array variable -Cannot unset offset in a non-array variable -Cannot unset string offsets -Cannot use object of type stdClass as array +Error: Cannot unset offset in a non-array variable +Error: Cannot unset offset in a non-array variable +Error: Cannot unset offset in a non-array variable +Error: Cannot unset string offsets +Error: Cannot use object of type stdClass as array Warning: Undefined variable $x in %s on line %d Deprecated: Automatic conversion of false to array is deprecated in %s -Cannot unset offset in a non-array variable -Cannot unset offset in a non-array variable -Cannot unset offset in a non-array variable -Cannot use string offset as an array -Cannot use object of type stdClass as array +Error: Cannot unset offset in a non-array variable +Error: Cannot unset offset in a non-array variable +Error: Cannot unset offset in a non-array variable +Error: Cannot use string offset as an array +Error: Cannot use object of type stdClass as array diff --git a/Zend/tests/varSyntax/constant_object_deref.phpt b/Zend/tests/varSyntax/constant_object_deref.phpt index b25d6557440d..885eb9c52bd0 100644 --- a/Zend/tests/varSyntax/constant_object_deref.phpt +++ b/Zend/tests/varSyntax/constant_object_deref.phpt @@ -9,16 +9,16 @@ class Bar { const FOO = "foo"; } try { FOO->length(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Bar::FOO->length(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to a member function length() on string -Call to a member function length() on string +Error: Call to a member function length() on string +Error: Call to a member function length() on string diff --git a/Zend/tests/varSyntax/encapsed_string_deref.phpt b/Zend/tests/varSyntax/encapsed_string_deref.phpt index 386e15932e6b..8bbc34d18b43 100644 --- a/Zend/tests/varSyntax/encapsed_string_deref.phpt +++ b/Zend/tests/varSyntax/encapsed_string_deref.phpt @@ -9,7 +9,7 @@ var_dump("foo$bar"->prop); try { var_dump("foo$bar"->method()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class FooBar { public static $prop = 42; } @@ -24,6 +24,6 @@ string(1) "f" Warning: Attempt to read property "prop" on string in %s on line %d NULL -Call to a member function method() on string +Error: Call to a member function method() on string int(42) int(42) diff --git a/Zend/tests/varSyntax/magic_const_deref.phpt b/Zend/tests/varSyntax/magic_const_deref.phpt index 54a5c95069ce..f2bd9db4c3c9 100644 --- a/Zend/tests/varSyntax/magic_const_deref.phpt +++ b/Zend/tests/varSyntax/magic_const_deref.phpt @@ -9,7 +9,7 @@ function test() { try { __FUNCTION__->method(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -21,4 +21,4 @@ string(1) "t" Warning: Attempt to read property "prop" on string in %s on line %d NULL -Call to a member function method() on string +Error: Call to a member function method() on string diff --git a/Zend/tests/variadic/typehint_suppressed_error.phpt b/Zend/tests/variadic/typehint_suppressed_error.phpt index 7cbc02bf581c..1ca5863faa6e 100644 --- a/Zend/tests/variadic/typehint_suppressed_error.phpt +++ b/Zend/tests/variadic/typehint_suppressed_error.phpt @@ -10,9 +10,9 @@ function test(array... $args) { try { test([0], [1], 2); } catch(Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -string(%d) "test(): Argument #3 must be of type array, int given, called in %s on line %d" +TypeError: test(): Argument #3 must be of type array, int given, called in %s on line %d diff --git a/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt b/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt index dd3c84518eac..f6132b2f9521 100644 --- a/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt +++ b/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt @@ -43,7 +43,7 @@ var_dump(!empty($map[$obj])); try { var_dump($map[$obj]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // It's okay to unset an object that's not in the map. @@ -138,7 +138,7 @@ object(WeakMap)#1 (0) { } bool(false) bool(false) -Object stdClass#2 not contained in WeakMap +Error: Object stdClass#2 not contained in WeakMap Indirect modification: object(WeakMap)#1 (2) { diff --git a/Zend/tests/weakrefs/weakmap_error_conditions.phpt b/Zend/tests/weakrefs/weakmap_error_conditions.phpt index 2516c0443fd1..5813caf036c2 100644 --- a/Zend/tests/weakrefs/weakmap_error_conditions.phpt +++ b/Zend/tests/weakrefs/weakmap_error_conditions.phpt @@ -7,38 +7,38 @@ $map = new WeakMap; try { $map[1] = 2; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($map[1]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { isset($map[1]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($map[1]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $map[] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $map[][1] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($map[new stdClass]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($map->prop); @@ -48,45 +48,45 @@ unset($map->prop); try { $map->prop = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $map->prop[] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r =& $map->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { serialize($map); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('C:7:"WeakMap":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -WeakMap key must be an object -WeakMap key must be an object -WeakMap key must be an object -WeakMap key must be an object -Cannot append to WeakMap -Cannot append to WeakMap -Object stdClass#2 not contained in WeakMap +TypeError: WeakMap key must be an object +TypeError: WeakMap key must be an object +TypeError: WeakMap key must be an object +TypeError: WeakMap key must be an object +Error: Cannot append to WeakMap +Error: Cannot append to WeakMap +Error: Object stdClass#2 not contained in WeakMap Warning: Undefined property: WeakMap::$prop in %s on line %d NULL bool(false) -Cannot create dynamic property WeakMap::$prop -Cannot create dynamic property WeakMap::$prop -Cannot create dynamic property WeakMap::$prop -Serialization of 'WeakMap' is not allowed -Unserialization of 'WeakMap' is not allowed +Error: Cannot create dynamic property WeakMap::$prop +Error: Cannot create dynamic property WeakMap::$prop +Error: Cannot create dynamic property WeakMap::$prop +Exception: Serialization of 'WeakMap' is not allowed +Exception: Unserialization of 'WeakMap' is not allowed diff --git a/Zend/tests/weakrefs/weakrefs_002.phpt b/Zend/tests/weakrefs/weakrefs_002.phpt index eda6b25ec786..be633a82836e 100644 --- a/Zend/tests/weakrefs/weakrefs_002.phpt +++ b/Zend/tests/weakrefs/weakrefs_002.phpt @@ -7,7 +7,7 @@ $wr = WeakReference::create(new stdClass); try { serialize($wr); } catch (Exception $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $wrs = 'O:13:"WeakReference":0:{}'; @@ -15,9 +15,9 @@ $wrs = 'O:13:"WeakReference":0:{}'; try { var_dump(unserialize($wrs)); } catch (Exception $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -string(47) "Serialization of 'WeakReference' is not allowed" -string(49) "Unserialization of 'WeakReference' is not allowed" +Exception: Serialization of 'WeakReference' is not allowed +Exception: Unserialization of 'WeakReference' is not allowed diff --git a/Zend/tests/weakrefs/weakrefs_003.phpt b/Zend/tests/weakrefs/weakrefs_003.phpt index 42fe0560a71f..7cca6949874a 100644 --- a/Zend/tests/weakrefs/weakrefs_003.phpt +++ b/Zend/tests/weakrefs/weakrefs_003.phpt @@ -11,18 +11,18 @@ unset($wr->disallow); try { $wr->disallow = "writes"; } catch (Error $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { $disallow = &$wr->disallowed; } catch (Error $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined property: WeakReference::$disallow in %s on line %d NULL bool(false) -string(55) "Cannot create dynamic property WeakReference::$disallow" -string(57) "Cannot create dynamic property WeakReference::$disallowed" +Error: Cannot create dynamic property WeakReference::$disallow +Error: Cannot create dynamic property WeakReference::$disallowed diff --git a/Zend/tests/weakrefs/weakrefs_006.phpt b/Zend/tests/weakrefs/weakrefs_006.phpt index a15ab6b542d5..dc432665d5c1 100644 --- a/Zend/tests/weakrefs/weakrefs_006.phpt +++ b/Zend/tests/weakrefs/weakrefs_006.phpt @@ -113,4 +113,4 @@ object(WeakMap)#1 (11) { ["value"]=> int(9) } -} \ No newline at end of file +} diff --git a/Zend/tests/xor_001.phpt b/Zend/tests/xor_001.phpt index 9678af16b5f7..2f554c0f1e2f 100644 --- a/Zend/tests/xor_001.phpt +++ b/Zend/tests/xor_001.phpt @@ -9,11 +9,11 @@ $b = array(); try { $c = $a ^ $b; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -Unsupported operand types: array ^ array +TypeError: Unsupported operand types: array ^ array Done diff --git a/Zend/tests/zpp/iterable_or_null.phpt b/Zend/tests/zpp/iterable_or_null.phpt index a44e858bce92..6b59a117de2b 100644 --- a/Zend/tests/zpp/iterable_or_null.phpt +++ b/Zend/tests/zpp/iterable_or_null.phpt @@ -8,19 +8,19 @@ zend_test try { var_dump(zend_iterable("string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(zend_iterable(1)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(zend_iterable(null)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } @@ -35,13 +35,12 @@ zend_iterable($iterator, null); try { var_dump(zend_iterable([], "string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, string given -zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, int given -zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, null given -zend_iterable(): Argument #2 ($arg2) must be of type Traversable|array|null, string given - +TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, string given +TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, int given +TypeError: zend_iterable(): Argument #1 ($arg1) must be of type Traversable|array, null given +TypeError: zend_iterable(): Argument #2 ($arg2) must be of type Traversable|array|null, string given