diff --git a/Zend/tests/access_modifiers/access_modifiers_008.phpt b/Zend/tests/access_modifiers/access_modifiers_008.phpt index 1cce8767d850..57c555bb6345 100644 --- a/Zend/tests/access_modifiers/access_modifiers_008.phpt +++ b/Zend/tests/access_modifiers/access_modifiers_008.phpt @@ -33,18 +33,18 @@ class B2 extends A { try { echo A::mp() . "\n"; } catch (\Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo B1::ma() . "\n"; // protected method defined also in A try { echo B1::mp() . "\n"; // protected method defined also in A but as private } catch (\Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo B1::mb() . "\n"; } catch (\Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -54,7 +54,7 @@ B2::test(); ?> --EXPECT-- A::ma() -Call to private method A::mp() from scope B2 +Error: Call to private method A::mp() from scope B2 B1::ma() -Call to protected method B1::mp() from scope B2 -Call to protected method B1::mb() from scope B2 +Error: Call to protected method B1::mp() from scope B2 +Error: Call to protected method B1::mb() from scope B2 diff --git a/Zend/tests/add_002.phpt b/Zend/tests/add_002.phpt index 9077ece08587..7611602d1a34 100644 --- a/Zend/tests/add_002.phpt +++ b/Zend/tests/add_002.phpt @@ -11,7 +11,7 @@ $o->prop = "value"; try { var_dump($a + $o); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a + $o; @@ -20,7 +20,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array + stdClass +TypeError: Unsupported operand types: array + stdClass Fatal error: Uncaught TypeError: Unsupported operand types: array + stdClass in %s:%d Stack trace: diff --git a/Zend/tests/add_003.phpt b/Zend/tests/add_003.phpt index 6d27863e893f..cf4684279fb3 100644 --- a/Zend/tests/add_003.phpt +++ b/Zend/tests/add_003.phpt @@ -11,7 +11,7 @@ $o->prop = "value"; try { var_dump($o + $a); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $o + $a; @@ -20,7 +20,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: stdClass + array +TypeError: Unsupported operand types: stdClass + array Fatal error: Uncaught TypeError: Unsupported operand types: stdClass + array in %s:%d Stack trace: diff --git a/Zend/tests/add_004.phpt b/Zend/tests/add_004.phpt index 2f16f10eaf50..08e8a70c900f 100644 --- a/Zend/tests/add_004.phpt +++ b/Zend/tests/add_004.phpt @@ -8,7 +8,7 @@ $a = array(1,2,3); try { var_dump($a + 5); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a + 5; @@ -17,7 +17,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array + int +TypeError: Unsupported operand types: array + int Fatal error: Uncaught TypeError: Unsupported operand types: array + int in %s:%d Stack trace: diff --git a/Zend/tests/add_006.phpt b/Zend/tests/add_006.phpt index 09945f3fce6c..00b0ad68a6e7 100644 --- a/Zend/tests/add_006.phpt +++ b/Zend/tests/add_006.phpt @@ -15,7 +15,7 @@ try { $c = $i + $s1; var_dump($c); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $c = $i + $s2; var_dump($c); @@ -30,7 +30,7 @@ try { $c = $s1 + $i; var_dump($c); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $c = $s2 + $i; @@ -45,13 +45,13 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Unsupported operand types: int + string +TypeError: Unsupported operand types: int + string Warning: A non-numeric value encountered in %s on line %d int(951858) int(48550510) float(75661.68) -Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int Warning: A non-numeric value encountered in %s on line %d int(951858) diff --git a/Zend/tests/add_007.phpt b/Zend/tests/add_007.phpt index a2beddfaed41..7119d253b98c 100644 --- a/Zend/tests/add_007.phpt +++ b/Zend/tests/add_007.phpt @@ -10,7 +10,7 @@ $s1 = "some string"; try { var_dump($a + $s1); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a + $s1; @@ -19,7 +19,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array + string +TypeError: Unsupported operand types: array + string Fatal error: Uncaught TypeError: Unsupported operand types: array + string in %s:%d Stack trace: diff --git a/Zend/tests/arg_unpack/invalid_type.phpt b/Zend/tests/arg_unpack/invalid_type.phpt index a0e649371528..99b54f7fe842 100644 --- a/Zend/tests/arg_unpack/invalid_type.phpt +++ b/Zend/tests/arg_unpack/invalid_type.phpt @@ -10,28 +10,28 @@ function test(...$args) { try { test(...null); } catch (Error $e) { - echo $e::class . ": " . $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(...42); } catch (Error $e) { - echo $e::class . ": " . $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(...new stdClass); } catch (Error $e) { - echo $e::class . ": " . $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(1, 2, 3, ..."foo", ...[4, 5]); } catch (Error $e) { - echo $e::class . ": " . $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(1, 2, 3, ...new StdClass, ...3.14, ...[4, 5]); } catch (Error $e) { - echo $e::class . ": " . $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/arg_unpack/non_integer_keys.phpt b/Zend/tests/arg_unpack/non_integer_keys.phpt index 88e1747df9c3..3ab978440add 100644 --- a/Zend/tests/arg_unpack/non_integer_keys.phpt +++ b/Zend/tests/arg_unpack/non_integer_keys.phpt @@ -13,9 +13,9 @@ function gen() { try { foo(...gen()); } catch (Error $ex) { - echo "Exception: " . $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Keys must be of type int|string during argument unpacking +Error: Keys must be of type int|string during argument unpacking diff --git a/Zend/tests/arg_unpack/string_keys.phpt b/Zend/tests/arg_unpack/string_keys.phpt index b0bf366fb38d..7a55c6e8ab7e 100644 --- a/Zend/tests/arg_unpack/string_keys.phpt +++ b/Zend/tests/arg_unpack/string_keys.phpt @@ -10,9 +10,9 @@ set_error_handler(function($errno, $errstr) { try { var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4])); } catch (Error $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -string(68) "Cannot use positional argument after named argument during unpacking" +Error: Cannot use positional argument after named argument during unpacking diff --git a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt index c78e491e2015..2712b9694094 100644 --- a/Zend/tests/arg_unpack/traversable_throwing_exception.phpt +++ b/Zend/tests/arg_unpack/traversable_throwing_exception.phpt @@ -21,13 +21,13 @@ function gen() { try { test(1, 2, ...new Foo, ...[3, 4]); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(1, 2, ...gen(), ...[3, 4]); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(11) "getIterator" -string(3) "gen" +Exception: getIterator +Exception: gen diff --git a/Zend/tests/array_literal_next_element_error.phpt b/Zend/tests/array_literal_next_element_error.phpt index 23dec5e22cae..2bf63d162dab 100644 --- a/Zend/tests/array_literal_next_element_error.phpt +++ b/Zend/tests/array_literal_next_element_error.phpt @@ -8,17 +8,17 @@ try { $array = [$i => 42, new stdClass]; var_dump($array); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function test($x = [PHP_INT_MAX => 42, "foo"]) {} try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/Zend/tests/array_merge_recursive_next_key_overflow.phpt b/Zend/tests/array_merge_recursive_next_key_overflow.phpt index f7d287295783..492d06973b49 100644 --- a/Zend/tests/array_merge_recursive_next_key_overflow.phpt +++ b/Zend/tests/array_merge_recursive_next_key_overflow.phpt @@ -8,7 +8,7 @@ try { ['' => [null]], ); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -17,9 +17,9 @@ try { ['foo' => str_repeat('a', 2)], ); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/Zend/tests/array_unpack/already_occupied.phpt b/Zend/tests/array_unpack/already_occupied.phpt index b2febe002156..e529324289f2 100644 --- a/Zend/tests/array_unpack/already_occupied.phpt +++ b/Zend/tests/array_unpack/already_occupied.phpt @@ -9,13 +9,13 @@ $arr = [1, 2, 3]; try { var_dump([PHP_INT_MAX-1 => 0, ...$arr]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump([PHP_INT_MAX-1 => 0, ...[1, 2, 3]]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } const ARR = [1, 2, 3]; @@ -23,11 +23,11 @@ function test($x = [PHP_INT_MAX-1 => 0, ...ARR]) {} try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/Zend/tests/array_unpack/classes.phpt b/Zend/tests/array_unpack/classes.phpt index fa4b0f8e536f..d7029cfb2dc9 100644 --- a/Zend/tests/array_unpack/classes.phpt +++ b/Zend/tests/array_unpack/classes.phpt @@ -20,7 +20,7 @@ var_dump(C::$bar); try { var_dump(D::A); } catch (Error $ex) { - echo "Exception: " . $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- @@ -44,4 +44,4 @@ array(3) { [2]=> int(3) } -Exception: Cannot declare self-referencing constant self::B +Error: Cannot declare self-referencing constant self::B diff --git a/Zend/tests/array_unpack/non_integer_keys.phpt b/Zend/tests/array_unpack/non_integer_keys.phpt index ab7a20ac86b9..31002eb61096 100644 --- a/Zend/tests/array_unpack/non_integer_keys.phpt +++ b/Zend/tests/array_unpack/non_integer_keys.phpt @@ -10,9 +10,9 @@ function gen() { try { [...gen()]; } catch (Error $ex) { - echo "Exception: " . $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Keys must be of type int|string during array unpacking +Error: Keys must be of type int|string during array unpacking diff --git a/Zend/tests/arrow_functions/006.phpt b/Zend/tests/arrow_functions/006.phpt index 6f61b3c817d9..a43d6c73536f 100644 --- a/Zend/tests/arrow_functions/006.phpt +++ b/Zend/tests/arrow_functions/006.phpt @@ -17,7 +17,7 @@ var_dump($int_fn($var)); try { $int_fn("foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $varargs = fn(?int... $args): array => $args; @@ -25,14 +25,14 @@ var_dump($varargs(20, null, 30)); try { $varargs(40, "foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- int(2) int(10) -{closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($x) must be of type int, string given, called in %s on line %d array(3) { [0]=> int(20) @@ -41,4 +41,4 @@ array(3) { [2]=> int(30) } -{closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #2 must be of type ?int, string given, called in %s on line %d diff --git a/Zend/tests/arrow_functions/007.phpt b/Zend/tests/arrow_functions/007.phpt index 66b03b84c2e9..d915195e464f 100644 --- a/Zend/tests/arrow_functions/007.phpt +++ b/Zend/tests/arrow_functions/007.phpt @@ -8,16 +8,16 @@ zend.assertions=1 try { assert((fn() => false)()); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert((fn&(int... $args): ?bool => $args[0])(false)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(): assert((fn() => false)()) failed -assert(): assert((fn&(int ...$args): ?bool => $args[0])(false)) failed +AssertionError: assert((fn() => false)()) +AssertionError: assert((fn&(int ...$args): ?bool => $args[0])(false)) diff --git a/Zend/tests/arrow_functions/gh7900.phpt b/Zend/tests/arrow_functions/gh7900.phpt index d6465c312399..c33b86701831 100644 --- a/Zend/tests/arrow_functions/gh7900.phpt +++ b/Zend/tests/arrow_functions/gh7900.phpt @@ -11,16 +11,16 @@ $x = fn(): never => throw new \Exception('Here'); try { var_dump($x()); } catch (\Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert((fn(): never => 42) && false); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Here -assert((fn(): never => 42) && false) +Exception: Here +AssertionError: assert((fn(): never => 42) && false) diff --git a/Zend/tests/assert/bug70528.phpt b/Zend/tests/assert/bug70528.phpt index 717c096fdaa3..1b90541b2463 100644 --- a/Zend/tests/assert/bug70528.phpt +++ b/Zend/tests/assert/bug70528.phpt @@ -12,20 +12,20 @@ $bar = "Bar"; try { assert(new \stdClass instanceof $bar); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(new \stdClass instanceof Bar); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(new \stdClass instanceof \Foo\Bar); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(): assert(new \stdClass() instanceof $bar) failed -assert(): assert(new \stdClass() instanceof Bar) failed -assert(): assert(new \stdClass() instanceof \Foo\Bar) failed +AssertionError: assert(new \stdClass() instanceof $bar) +AssertionError: assert(new \stdClass() instanceof Bar) +AssertionError: assert(new \stdClass() instanceof \Foo\Bar) diff --git a/Zend/tests/assert/bug71922.phpt b/Zend/tests/assert/bug71922.phpt index 986254cab732..479ef6de7d70 100644 --- a/Zend/tests/assert/bug71922.phpt +++ b/Zend/tests/assert/bug71922.phpt @@ -11,11 +11,11 @@ try { } && new class(42) extends stdclass { }); } catch (AssertionError $e) { - echo "Assertion failure: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Assertion failure: assert(0 && new class { +AssertionError: assert(0 && new class { } && new class(42) extends stdclass { }) diff --git a/Zend/tests/assert/expect_003.phpt b/Zend/tests/assert/expect_003.phpt index 350fca6e57b0..57f20620ab58 100644 --- a/Zend/tests/assert/expect_003.phpt +++ b/Zend/tests/assert/expect_003.phpt @@ -8,8 +8,8 @@ assert.exception=1 try { assert(false); } catch (AssertionError $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -string(13) "assert(false)" +AssertionError: assert(false) diff --git a/Zend/tests/assert/expect_004.phpt b/Zend/tests/assert/expect_004.phpt index 111e37295fe9..20b15e8e10e5 100644 --- a/Zend/tests/assert/expect_004.phpt +++ b/Zend/tests/assert/expect_004.phpt @@ -8,8 +8,8 @@ assert.exception=1 try { assert(false, "I require this to succeed"); } catch (AssertionError $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -string(25) "I require this to succeed" +AssertionError: I require this to succeed diff --git a/Zend/tests/assert/expect_005.phpt b/Zend/tests/assert/expect_005.phpt index f2c91f25666e..60ff388e0521 100644 --- a/Zend/tests/assert/expect_005.phpt +++ b/Zend/tests/assert/expect_005.phpt @@ -9,7 +9,7 @@ try { /* by passing we test there are no leaks upon success */ assert(true, "I require this to succeed"); } catch (AssertionError $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } var_dump(true); ?> diff --git a/Zend/tests/assert/expect_015.phpt b/Zend/tests/assert/expect_015.phpt index 3bb08504f581..515f4d7238a1 100644 --- a/Zend/tests/assert/expect_015.phpt +++ b/Zend/tests/assert/expect_015.phpt @@ -20,7 +20,7 @@ assert(0 && ($a = function () { yield from $x; })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -69,7 +69,7 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X { } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -105,7 +105,7 @@ L0: } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -121,7 +121,7 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X { } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -138,7 +138,7 @@ assert(0 && ($a = function &(array &...$a) { } })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -166,12 +166,12 @@ assert(0 && ($a = function (): ?static { if ($a); else; })); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(0 && ($a = function () { +AssertionError: assert(0 && ($a = function () { global $a; global $$b; static $c; @@ -187,7 +187,7 @@ assert(0 && ($a = function () { yield 1 => 2; yield from $x; })) -assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X { +AssertionError: assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X { abstract class A extends B implements C, D { public const X = 12; public const Y = self::X, Z = 'aaa'; @@ -231,7 +231,7 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use($c, &$d): ?X { } })) -assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X { +AssertionError: assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): X { final class A { protected final function f2() { if (!$x) { @@ -270,7 +270,7 @@ assert(0 && ($a = function &(array &$a, X $b = null, int|float $c) use($c, &$d): } })) -assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X { +AssertionError: assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X { class A { use T1, T2 { T1::foo insteadof foo; @@ -282,7 +282,7 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use($c, &$d): X { } })) -assert(0 && ($a = function &(array &...$a) { +AssertionError: assert(0 && ($a = function &(array &...$a) { declare(A = 1, B = 2); try { $i++; @@ -294,7 +294,7 @@ assert(0 && ($a = function &(array &...$a) { echo 3; } })) -assert(0 && ($a = function (): ?static { +AssertionError: assert(0 && ($a = function (): ?static { declare(C = 1) { echo 1; } diff --git a/Zend/tests/assert/expect_016.phpt b/Zend/tests/assert/expect_016.phpt index 32e8fea91715..80f477b5e20d 100644 --- a/Zend/tests/assert/expect_016.phpt +++ b/Zend/tests/assert/expect_016.phpt @@ -11,7 +11,7 @@ ini_set("zend.assertions", 1); try { var_dump(assert(false)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(assert(true)); ini_set("zend.assertions", -1); @@ -19,7 +19,7 @@ ini_set("zend.assertions", -1); --EXPECTF-- bool(true) bool(true) -assert(): assert(false) failed +AssertionError: assert(false) bool(true) Warning: zend.assertions may be completely enabled or disabled only in php.ini in %s on line %d diff --git a/Zend/tests/assert/expect_018.phpt b/Zend/tests/assert/expect_018.phpt index abe74ce25225..9fd6610abc42 100644 --- a/Zend/tests/assert/expect_018.phpt +++ b/Zend/tests/assert/expect_018.phpt @@ -15,13 +15,13 @@ ini_set("zend.assertions", 1); try { var_dump(\assert(false)); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(\assert(true)); try { var_dump(assert(false)); } catch (\AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(assert(true)); ?> @@ -30,7 +30,7 @@ bool(true) bool(true) bool(true) bool(true) -assert(): assert(false) failed +AssertionError: assert(false) bool(true) -assert(): assert(false) failed +AssertionError: assert(false) bool(true) diff --git a/Zend/tests/assign_dim_obj_null_return.phpt b/Zend/tests/assign_dim_obj_null_return.phpt index e2b7f20a0c07..eefe2b206ecf 100644 --- a/Zend/tests/assign_dim_obj_null_return.phpt +++ b/Zend/tests/assign_dim_obj_null_return.phpt @@ -10,60 +10,60 @@ function test() { try { var_dump($array[] = 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($array[[]] = 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($array[new stdClass] = 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($true[123] = 456); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($array[] += 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($array[[]] += 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($array[new stdClass] += 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($true[123] += 456); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($true->foo = 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($true->foo += 123); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -71,13 +71,13 @@ test(); ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied -Cannot access offset of type array on array -Cannot access offset of type stdClass on array -Cannot use a scalar value as an array -Cannot add element to the array as the next element is already occupied -Cannot access offset of type array on array -Cannot access offset of type stdClass on array -Cannot use a scalar value as an array -Attempt to assign property "foo" on true -Attempt to assign property "foo" on true +Error: Cannot add element to the array as the next element is already occupied +TypeError: Cannot access offset of type array on array +TypeError: Cannot access offset of type stdClass on array +Error: Cannot use a scalar value as an array +Error: Cannot add element to the array as the next element is already occupied +TypeError: Cannot access offset of type array on array +TypeError: Cannot access offset of type stdClass on array +Error: Cannot use a scalar value as an array +Error: Attempt to assign property "foo" on true +Error: Attempt to assign property "foo" on true diff --git a/Zend/tests/assign_op_type_error.phpt b/Zend/tests/assign_op_type_error.phpt index 5f175613e20b..c132f74de2f9 100644 --- a/Zend/tests/assign_op_type_error.phpt +++ b/Zend/tests/assign_op_type_error.phpt @@ -7,51 +7,51 @@ $x = []; try { $x += "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x -= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x *= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x /= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x **= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x %= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x <<= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x >>= "1"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: array + string -Unsupported operand types: array - string -Unsupported operand types: array * string -Unsupported operand types: array / string -Unsupported operand types: array ** string -Unsupported operand types: array % string -Unsupported operand types: array << string -Unsupported operand types: array >> string +TypeError: Unsupported operand types: array + string +TypeError: Unsupported operand types: array - string +TypeError: Unsupported operand types: array * string +TypeError: Unsupported operand types: array / string +TypeError: Unsupported operand types: array ** string +TypeError: Unsupported operand types: array % string +TypeError: Unsupported operand types: array << string +TypeError: Unsupported operand types: array >> string diff --git a/Zend/tests/assign_property_null_object.phpt b/Zend/tests/assign_property_null_object.phpt index fff2c99f6201..9119e96cca34 100644 --- a/Zend/tests/assign_property_null_object.phpt +++ b/Zend/tests/assign_property_null_object.phpt @@ -16,7 +16,7 @@ print "ok\n"; try { $test->a()->a = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } print "ok\n"; @@ -24,5 +24,5 @@ print "ok\n"; --EXPECTF-- Warning: Attempt to read property "a" on null in %s on line %d ok -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null ok diff --git a/Zend/tests/assign_ref_error_var_handling.phpt b/Zend/tests/assign_ref_error_var_handling.phpt index 2a66b68cc549..312b7e345158 100644 --- a/Zend/tests/assign_ref_error_var_handling.phpt +++ b/Zend/tests/assign_ref_error_var_handling.phpt @@ -12,19 +12,19 @@ $arr = [PHP_INT_MAX => "foo"]; try { var_dump($arr[] =& $var); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($arr)); try { var_dump($arr[] =& val()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($arr)); ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied int(1) -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied int(1) diff --git a/Zend/tests/assign_to_obj_002.phpt b/Zend/tests/assign_to_obj_002.phpt index a911c06f36d5..bb4810d37f62 100644 --- a/Zend/tests/assign_to_obj_002.phpt +++ b/Zend/tests/assign_to_obj_002.phpt @@ -5,8 +5,8 @@ Assign to $this leaks when $this not defined try { $this->a = new stdClass; -} catch (Error $e) { echo $e->getMessage(), "\n"; } +} catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Using $this when not in object context +Error: Using $this when not in object context diff --git a/Zend/tests/ast/ast_serialize_backtick_literal.phpt b/Zend/tests/ast/ast_serialize_backtick_literal.phpt index 46aa0ebe8ae2..62727fcc2c26 100644 --- a/Zend/tests/ast/ast_serialize_backtick_literal.phpt +++ b/Zend/tests/ast/ast_serialize_backtick_literal.phpt @@ -8,9 +8,9 @@ zend.assertions=1 try { assert(false && `echo -n ""`); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(): assert(false && `echo -n ""`) failed +AssertionError: assert(false && `echo -n ""`) diff --git a/Zend/tests/ast/ast_serialize_floats.phpt b/Zend/tests/ast/ast_serialize_floats.phpt index 164b8b03338c..ec73c38205d5 100644 --- a/Zend/tests/ast/ast_serialize_floats.phpt +++ b/Zend/tests/ast/ast_serialize_floats.phpt @@ -7,20 +7,20 @@ zend.assertions=1 try { assert(!is_float(0.0)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!is_float(1.1)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!is_float(1234.5678)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(): assert(!is_float(0.0)) failed -assert(): assert(!is_float(1.1)) failed -assert(): assert(!is_float(1234.5678)) failed +AssertionError: assert(!is_float(0.0)) +AssertionError: assert(!is_float(1.1)) +AssertionError: assert(!is_float(1234.5678)) diff --git a/Zend/tests/ast/gh21072.phpt b/Zend/tests/ast/gh21072.phpt index 1ffd0518eaea..8b144acf0456 100644 --- a/Zend/tests/ast/gh21072.phpt +++ b/Zend/tests/ast/gh21072.phpt @@ -10,7 +10,7 @@ try { } new C; } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt index fd8bf8346cec..1b45f5a386f6 100644 --- a/Zend/tests/ast/zend-pow-assign.phpt +++ b/Zend/tests/ast/zend-pow-assign.phpt @@ -8,8 +8,8 @@ zend.assertions=1 try { assert(false && ($a **= 2)); } catch (AssertionError $e) { - echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(): assert(false && ($a **= 2)) failed +AssertionError: assert(false && ($a **= 2)) diff --git a/Zend/tests/asymmetric_visibility/__set.phpt b/Zend/tests/asymmetric_visibility/__set.phpt index 7476f5304e25..e9378baabaf4 100644 --- a/Zend/tests/asymmetric_visibility/__set.phpt +++ b/Zend/tests/asymmetric_visibility/__set.phpt @@ -23,14 +23,14 @@ $foo = new Foo(); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBar('baz'); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->unsetBar(); @@ -38,6 +38,6 @@ $foo->bar = 'baz'; ?> --EXPECT-- -Cannot modify private(set) property Foo::$bar from global scope -Cannot modify private(set) property Foo::$bar from global scope +Error: Cannot modify private(set) property Foo::$bar from global scope +Error: Cannot modify private(set) property Foo::$bar from global scope Foo::Foo::__set diff --git a/Zend/tests/asymmetric_visibility/__unset.phpt b/Zend/tests/asymmetric_visibility/__unset.phpt index 3d5977d79782..06ded24915d4 100644 --- a/Zend/tests/asymmetric_visibility/__unset.phpt +++ b/Zend/tests/asymmetric_visibility/__unset.phpt @@ -23,7 +23,7 @@ function test($foo) { try { unset($foo->bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -41,7 +41,7 @@ test($foo); ?> --EXPECT-- -Cannot unset private(set) property Foo::$bar from global scope +Error: Cannot unset private(set) property Foo::$bar from global scope Foo::__unset -Cannot unset private(set) property Foo::$bar from global scope +Error: Cannot unset private(set) property Foo::$bar from global scope Foo::__unset diff --git a/Zend/tests/asymmetric_visibility/ast_printing.phpt b/Zend/tests/asymmetric_visibility/ast_printing.phpt index 25803e67c09d..ab91e6dcf8d8 100644 --- a/Zend/tests/asymmetric_visibility/ast_printing.phpt +++ b/Zend/tests/asymmetric_visibility/ast_printing.phpt @@ -14,12 +14,12 @@ try { } } && false); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(function () { +AssertionError: assert(function () { class Foo { public private(set) string $bar; public protected(set) string $baz; diff --git a/Zend/tests/asymmetric_visibility/bug001.phpt b/Zend/tests/asymmetric_visibility/bug001.phpt index c306434d610b..88d9839541ec 100644 --- a/Zend/tests/asymmetric_visibility/bug001.phpt +++ b/Zend/tests/asymmetric_visibility/bug001.phpt @@ -20,13 +20,13 @@ $c = new D(); try { unset($c->a); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($c); ?> --EXPECTF-- -Cannot unset private(set) property C::$a from scope D +Error: Cannot unset private(set) property C::$a from scope D object(D)#%d (0) { ["a"]=> uninitialized(int) diff --git a/Zend/tests/asymmetric_visibility/bug002.phpt b/Zend/tests/asymmetric_visibility/bug002.phpt index 1f6dc2b85278..915796b7c1ab 100644 --- a/Zend/tests/asymmetric_visibility/bug002.phpt +++ b/Zend/tests/asymmetric_visibility/bug002.phpt @@ -20,13 +20,13 @@ $c = new D(); try { $c->a = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($c); ?> --EXPECTF-- -Cannot modify private(set) property C::$a from scope D +Error: Cannot modify private(set) property C::$a from scope D object(D)#%d (0) { ["a"]=> uninitialized(int) diff --git a/Zend/tests/asymmetric_visibility/bug003.phpt b/Zend/tests/asymmetric_visibility/bug003.phpt index 9f541f87f7cd..979c4c167e4b 100644 --- a/Zend/tests/asymmetric_visibility/bug003.phpt +++ b/Zend/tests/asymmetric_visibility/bug003.phpt @@ -14,15 +14,15 @@ $c = new C(); try { $c->a = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($c->a); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify private(set) property C::$a from global scope -Cannot unset private(set) property C::$a from global scope +Error: Cannot modify private(set) property C::$a from global scope +Error: Cannot unset private(set) property C::$a from global scope diff --git a/Zend/tests/asymmetric_visibility/cpp_private.phpt b/Zend/tests/asymmetric_visibility/cpp_private.phpt index c308330d3ab0..b6ebfa294422 100644 --- a/Zend/tests/asymmetric_visibility/cpp_private.phpt +++ b/Zend/tests/asymmetric_visibility/cpp_private.phpt @@ -19,7 +19,7 @@ var_dump($foo->bar); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBar('baz'); @@ -28,5 +28,5 @@ var_dump($foo->bar); ?> --EXPECT-- string(3) "bar" -Cannot modify private(set) property Foo::$bar from global scope +Error: Cannot modify private(set) property Foo::$bar from global scope string(3) "baz" diff --git a/Zend/tests/asymmetric_visibility/cpp_protected.phpt b/Zend/tests/asymmetric_visibility/cpp_protected.phpt index f13351e32003..d94b359eabd3 100644 --- a/Zend/tests/asymmetric_visibility/cpp_protected.phpt +++ b/Zend/tests/asymmetric_visibility/cpp_protected.phpt @@ -25,7 +25,7 @@ var_dump($foo->bar); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBarPrivate('baz'); @@ -37,6 +37,6 @@ var_dump($foo->bar); ?> --EXPECT-- string(3) "bar" -Cannot modify protected(set) property Foo::$bar from global scope +Error: Cannot modify protected(set) property Foo::$bar from global scope string(3) "baz" string(3) "qux" diff --git a/Zend/tests/asymmetric_visibility/dim_add.phpt b/Zend/tests/asymmetric_visibility/dim_add.phpt index f7bf0ceaf939..4eecd6a3eba8 100644 --- a/Zend/tests/asymmetric_visibility/dim_add.phpt +++ b/Zend/tests/asymmetric_visibility/dim_add.phpt @@ -16,7 +16,7 @@ $foo = new Foo(); try { $foo->bars[] = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->bars); @@ -25,7 +25,7 @@ var_dump($foo->bars); ?> --EXPECT-- -Cannot indirectly modify private(set) property Foo::$bars from global scope +Error: Cannot indirectly modify private(set) property Foo::$bars from global scope array(0) { } array(1) { diff --git a/Zend/tests/asymmetric_visibility/private.phpt b/Zend/tests/asymmetric_visibility/private.phpt index 48e557c6e87d..61687d2d1b32 100644 --- a/Zend/tests/asymmetric_visibility/private.phpt +++ b/Zend/tests/asymmetric_visibility/private.phpt @@ -29,7 +29,7 @@ var_dump($foo->bar); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBar('baz'); @@ -38,7 +38,7 @@ var_dump($foo->bar); try { $foo->baz = 'baz2'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBaz('baz2'); @@ -48,14 +48,14 @@ $child = new FooChild(); try { $child->modifyBar('baz'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(3) "bar" -Cannot modify private(set) property Foo::$bar from global scope +Error: Cannot modify private(set) property Foo::$bar from global scope string(3) "baz" -Cannot modify private(set) property Foo::$baz from global scope +Error: Cannot modify private(set) property Foo::$baz from global scope string(4) "baz2" -Cannot modify private(set) property Foo::$bar from scope FooChild +Error: Cannot modify private(set) property Foo::$bar from scope FooChild diff --git a/Zend/tests/asymmetric_visibility/protected.phpt b/Zend/tests/asymmetric_visibility/protected.phpt index 49a39b399362..4ada4a06cac4 100644 --- a/Zend/tests/asymmetric_visibility/protected.phpt +++ b/Zend/tests/asymmetric_visibility/protected.phpt @@ -33,7 +33,7 @@ var_dump($foo->bar); try { $foo->bar = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setBarPrivate('baz'); @@ -45,7 +45,7 @@ var_dump($foo->bar); try { $foo->baz = 'baz'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->setbazPrivate('baz2'); @@ -58,9 +58,9 @@ var_dump($foo->baz); ?> --EXPECT-- string(3) "bar" -Cannot modify protected(set) property Foo::$bar from global scope +Error: Cannot modify protected(set) property Foo::$bar from global scope string(3) "baz" string(3) "qux" -Cannot modify protected(set) property Foo::$baz from global scope +Error: Cannot modify protected(set) property Foo::$baz from global scope string(4) "baz2" string(4) "baz3" diff --git a/Zend/tests/asymmetric_visibility/readonly.phpt b/Zend/tests/asymmetric_visibility/readonly.phpt index e02d36907998..457d4d178fe3 100644 --- a/Zend/tests/asymmetric_visibility/readonly.phpt +++ b/Zend/tests/asymmetric_visibility/readonly.phpt @@ -23,7 +23,7 @@ class C extends P { try { $this->pPrivate = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $this->pProtected = 1; $this->pPublic = 1; @@ -35,17 +35,17 @@ function test() { try { $p->pDefault = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p->pPrivate = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p->pProtected = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $p->pPublic = 1; } @@ -56,7 +56,7 @@ test(); ?> --EXPECT-- -Cannot modify private(set) property P::$pPrivate from scope C -Cannot modify protected(set) readonly property P::$pDefault from global scope -Cannot modify private(set) property P::$pPrivate from global scope -Cannot modify protected(set) readonly property P::$pProtected from global scope +Error: Cannot modify private(set) property P::$pPrivate from scope C +Error: Cannot modify protected(set) readonly property P::$pDefault from global scope +Error: Cannot modify private(set) property P::$pPrivate from global scope +Error: Cannot modify protected(set) readonly property P::$pProtected from global scope diff --git a/Zend/tests/asymmetric_visibility/reference.phpt b/Zend/tests/asymmetric_visibility/reference.phpt index ae5271418282..40c2ddbdf68d 100644 --- a/Zend/tests/asymmetric_visibility/reference.phpt +++ b/Zend/tests/asymmetric_visibility/reference.phpt @@ -18,7 +18,7 @@ try { $bar = &$foo->bar; $bar++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->bar); @@ -27,6 +27,6 @@ var_dump($foo->bar); ?> --EXPECT-- -Cannot indirectly modify private(set) property Foo::$bar from global scope +Error: Cannot indirectly modify private(set) property Foo::$bar from global scope int(0) int(1) diff --git a/Zend/tests/asymmetric_visibility/reference_2.phpt b/Zend/tests/asymmetric_visibility/reference_2.phpt index d4ef6c03a788..d119d5adccbd 100644 --- a/Zend/tests/asymmetric_visibility/reference_2.phpt +++ b/Zend/tests/asymmetric_visibility/reference_2.phpt @@ -15,16 +15,16 @@ function test($c) { try { test(new C()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(new C()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot indirectly modify private(set) property C::$prop from global scope -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope diff --git a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt index 8c10d10f77a4..0819dc1d6299 100644 --- a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt +++ b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt @@ -19,18 +19,18 @@ var_dump($foo->bar); try { $c(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ($c->bindTo(null, Bar::class))(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->bar); ?> --EXPECT-- int(2) -Cannot modify private(set) property Foo::$bar from global scope -Cannot modify private(set) property Foo::$bar from scope Bar +Error: Cannot modify private(set) property Foo::$bar from global scope +Error: Cannot modify private(set) property Foo::$bar from scope Bar int(2) diff --git a/Zend/tests/asymmetric_visibility/static_props.phpt b/Zend/tests/asymmetric_visibility/static_props.phpt index f47dcf70b6f7..31fc3c5010a4 100644 --- a/Zend/tests/asymmetric_visibility/static_props.phpt +++ b/Zend/tests/asymmetric_visibility/static_props.phpt @@ -30,7 +30,7 @@ function test() { try { C::$prop = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); @@ -40,21 +40,21 @@ function test() { try { ++C::$prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); try { C::$prop++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); try { C::$prop += str_repeat('a', 10); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); @@ -62,7 +62,7 @@ function test() { $ref = &C::$prop; $ref++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); @@ -71,14 +71,14 @@ function test() { C::$prop = &$ref; $ref++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop); try { C::$prop2[] = 'foo'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(C::$prop2); @@ -97,20 +97,20 @@ test(); ?> --EXPECTF-- -Cannot modify private(set) property C::$prop from global scope +Error: Cannot modify private(set) property C::$prop from global scope int(1) int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop2 from global scope +Error: Cannot indirectly modify private(set) property C::$prop2 from global scope array(0) { } array(1) { @@ -123,20 +123,20 @@ object(stdClass)#%d (1) { } Repeat: -Cannot modify private(set) property C::$prop from global scope +Error: Cannot modify private(set) property C::$prop from global scope int(1) int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop from global scope +Error: Cannot indirectly modify private(set) property C::$prop from global scope int(3) -Cannot indirectly modify private(set) property C::$prop2 from global scope +Error: Cannot indirectly modify private(set) property C::$prop2 from global scope array(0) { } array(1) { diff --git a/Zend/tests/asymmetric_visibility/unset.phpt b/Zend/tests/asymmetric_visibility/unset.phpt index 3fd3d7673081..cbb950d9ed50 100644 --- a/Zend/tests/asymmetric_visibility/unset.phpt +++ b/Zend/tests/asymmetric_visibility/unset.phpt @@ -37,7 +37,7 @@ $foo->setBar('bar'); try { unset($foo->bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->bar ?? 'unset'); @@ -53,15 +53,15 @@ $foo->setSecret('beep'); try { $foo->unsetSecret(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->secret ?? 'unset'); ?> --EXPECT-- -Cannot unset protected(set) property Foo::$bar from global scope +Error: Cannot unset protected(set) property Foo::$bar from global scope string(3) "bar" string(5) "unset" string(5) "unset" -Cannot unset private(set) property Foo::$secret from scope FooChild +Error: Cannot unset private(set) property Foo::$secret from scope FooChild string(4) "beep" diff --git a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt index d81f4d3891bf..45d2839af78a 100644 --- a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt +++ b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt @@ -18,19 +18,19 @@ $c = new C(); try { $c->setBar(1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $c->setBar(1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($c); ?> --EXPECTF-- -Typed property P::$bar must not be accessed before initialization -Typed property P::$bar must not be accessed before initialization +Error: Typed property P::$bar must not be accessed before initialization +Error: Typed property P::$bar must not be accessed before initialization object(C)#%d (0) { ["bar"]=> uninitialized(string) diff --git a/Zend/tests/attributes/003_ast_nodes.phpt b/Zend/tests/attributes/003_ast_nodes.phpt index 854edf3d63c1..b9e970275d89 100644 --- a/Zend/tests/attributes/003_ast_nodes.phpt +++ b/Zend/tests/attributes/003_ast_nodes.phpt @@ -72,13 +72,13 @@ var_dump(count($attr)); try { $attr[0]->getArguments(); } catch (\Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $attr[0]->newInstance(); } catch (\Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -104,5 +104,5 @@ array(1) { } int(1) -string(30) "Class "MissingClass" not found" -string(30) "Class "MissingClass" not found" +Error: Class "MissingClass" not found +Error: Class "MissingClass" not found diff --git a/Zend/tests/attributes/005_objects.phpt b/Zend/tests/attributes/005_objects.phpt index 2b08db838b27..22f16af06b89 100644 --- a/Zend/tests/attributes/005_objects.phpt +++ b/Zend/tests/attributes/005_objects.phpt @@ -31,7 +31,7 @@ $ref = new \ReflectionFunction(#[A1] function () { }); try { $ref->getAttributes()[0]->newInstance(); } catch (\ArgumentCountError $e) { - var_dump('ERROR 1', $e->getMessage()); + echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -41,7 +41,7 @@ $ref = new \ReflectionFunction(#[A1([])] function () { }); try { $ref->getAttributes()[0]->newInstance(); } catch (\TypeError $e) { - var_dump('ERROR 2', $e->getMessage()); + echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -51,7 +51,7 @@ $ref = new \ReflectionFunction(#[A2] function () { }); try { $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 3', $e->getMessage()); + echo 'ERROR 3: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -67,7 +67,7 @@ $ref = new \ReflectionFunction(#[A3] function () { }); try { $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 4', $e->getMessage()); + echo 'ERROR 4: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -79,7 +79,7 @@ $ref = new \ReflectionFunction(#[A5] function () { }); try { $ref->getAttributes()[0]->newInstance(); } catch (\Error $e) { - var_dump('ERROR 6', $e->getMessage()); + echo 'ERROR 6: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -88,17 +88,12 @@ string(2) "A1" string(4) "test" int(50) -string(7) "ERROR 1" -string(%d) "Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected" +ERROR 1: ArgumentCountError: Too few arguments to function A1::__construct(), 0 passed in %s005_objects.php on line 26 and at least 1 expected -string(7) "ERROR 2" -string(%d) "A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36" +ERROR 2: TypeError: A1::__construct(): Argument #1 ($name) must be of type string, array given, called in %s005_objects.php on line 36 -string(7) "ERROR 3" -string(30) "Attribute class "A2" not found" +ERROR 3: Error: Attribute class "A2" not found -string(7) "ERROR 4" -string(51) "Call to private A3::__construct() from global scope" +ERROR 4: Error: Call to private A3::__construct() from global scope -string(7) "ERROR 6" -string(55) "Attempting to use non-attribute class "A5" as attribute" +ERROR 6: Error: Attempting to use non-attribute class "A5" as attribute diff --git a/Zend/tests/attributes/006_filter.phpt b/Zend/tests/attributes/006_filter.phpt index 2924e6ed7982..938f7d8890df 100644 --- a/Zend/tests/attributes/006_filter.phpt +++ b/Zend/tests/attributes/006_filter.phpt @@ -57,7 +57,7 @@ $ref = new \ReflectionFunction(function () { }); try { $ref->getAttributes(A1::class, 3); } catch (\Error $e) { - var_dump('ERROR 1', $e->getMessage()); + echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n"; } $ref = new \ReflectionFunction(function () { }); @@ -65,7 +65,7 @@ $ref = new \ReflectionFunction(function () { }); try { $ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF); } catch (\Error $e) { - var_dump('ERROR 2', $e->getMessage()); + echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -106,7 +106,5 @@ Array [2] => A3 ) -string(7) "ERROR 1" -string(103) "ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag" -string(7) "ERROR 2" -string(34) "Class "SomeMissingClass" not found" +ERROR 1: ValueError: ReflectionFunctionAbstract::getAttributes(): Argument #2 ($flags) must be a valid attribute filter flag +ERROR 2: Error: Class "SomeMissingClass" not found diff --git a/Zend/tests/attributes/013_class_scope.phpt b/Zend/tests/attributes/013_class_scope.phpt index ff16bb7b8225..f3938a274995 100644 --- a/Zend/tests/attributes/013_class_scope.phpt +++ b/Zend/tests/attributes/013_class_scope.phpt @@ -47,7 +47,7 @@ $attr = $ref->getMethod('foo')->getAttributes()[0]; try { $attr->getArguments(); } catch (\Error $e) { - var_dump('ERROR 1', $e->getMessage()); + echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -108,8 +108,7 @@ Array [0] => C2 [1] => bar ) -string(7) "ERROR 1" -string(28) "Undefined constant self::FOO" +ERROR 1: Error: Undefined constant self::FOO bool(true) string(3) "bar" diff --git a/Zend/tests/attributes/020_userland_attribute_validation.phpt b/Zend/tests/attributes/020_userland_attribute_validation.phpt index ce2acb26db16..008a892c707c 100644 --- a/Zend/tests/attributes/020_userland_attribute_validation.phpt +++ b/Zend/tests/attributes/020_userland_attribute_validation.phpt @@ -20,7 +20,7 @@ var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_CLASS, $attr- try { $attr->newInstance(); } catch (\Throwable $e) { - var_dump('ERROR 1', $e->getMessage()); + echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -32,7 +32,7 @@ var_dump($attr->getName(), $attr->getTarget() == Attribute::TARGET_FUNCTION, $at try { $attr->newInstance(); } catch (\Throwable $e) { - var_dump('ERROR 2', $e->getMessage()); + echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -55,14 +55,12 @@ string(2) "A1" string(2) "A1" bool(true) bool(false) -string(7) "ERROR 1" -string(70) "Attribute "A1" cannot target class (allowed targets: function, method)" +ERROR 1: Error: Attribute "A1" cannot target class (allowed targets: function, method) string(2) "A1" bool(true) bool(true) -string(7) "ERROR 2" -string(35) "Attribute "A1" must not be repeated" +ERROR 2: Error: Attribute "A1" must not be repeated string(2) "A2" bool(true) diff --git a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt index 70e4fdb7f338..e2dfab866d37 100644 --- a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt +++ b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt @@ -12,9 +12,9 @@ class Foo {} try { (new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attribute::__construct(): Argument #1 ($flags) must be of type int, string given +Error: Attribute::__construct(): Argument #1 ($flags) must be of type int, string given diff --git a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt index efaa969af827..2268e716ff79 100644 --- a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt +++ b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt @@ -12,9 +12,9 @@ class Foo { } try { var_dump((new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid attribute flags specified +Error: Invalid attribute flags specified diff --git a/Zend/tests/attributes/023_ast_node_in_validation.phpt b/Zend/tests/attributes/023_ast_node_in_validation.phpt index 063a6b7e815d..12c03ea7adaa 100644 --- a/Zend/tests/attributes/023_ast_node_in_validation.phpt +++ b/Zend/tests/attributes/023_ast_node_in_validation.phpt @@ -12,9 +12,9 @@ class Bar { } try { var_dump((new ReflectionClass(Bar::class))->getAttributes()[0]->newInstance()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "Foo" not found +Error: Class "Foo" not found diff --git a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt index b1efb538b328..06a1e47b399c 100644 --- a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt +++ b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt @@ -66,7 +66,7 @@ foreach ($cases as $r) { try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt index 68d1ae43bd46..743a59eeaa42 100644 --- a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt +++ b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt @@ -20,7 +20,7 @@ var_dump($attributes); try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt index 63add9e445a9..1935befaa6fe 100644 --- a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt +++ b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt @@ -33,7 +33,7 @@ foreach ($cases as $r) { try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt index 0571024f19ce..8bf19fc478a7 100644 --- a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt +++ b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt @@ -33,7 +33,7 @@ foreach ($cases as $r) { try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt index f5fedb4ee68e..73680499f1a9 100644 --- a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt +++ b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt @@ -28,7 +28,7 @@ foreach ($cases as $r) { try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt index e3cfe9d1c109..82e499e49428 100644 --- a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt +++ b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt @@ -26,7 +26,7 @@ foreach ($cases as $r) { try { $attributes[1]->newInstance(); } catch (Error $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt index ab84d4724226..9b9fc61a919f 100644 --- a/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt +++ b/Zend/tests/attributes/deprecated/class_constants/deprecated_constant_as_message_002.phpt @@ -21,16 +21,16 @@ class Clazz { try { Clazz::TEST; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { Clazz::TEST3; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: Constant Clazz::TEST is deprecated, from itself -Caught: Constant Clazz::TEST2 is deprecated +ErrorException: Constant Clazz::TEST is deprecated, from itself +ErrorException: Constant Clazz::TEST2 is deprecated diff --git a/Zend/tests/attributes/deprecated/constants/const_messages.phpt b/Zend/tests/attributes/deprecated/constants/const_messages.phpt index 1cf8b11af156..2ced4e06fd29 100644 --- a/Zend/tests/attributes/deprecated/constants/const_messages.phpt +++ b/Zend/tests/attributes/deprecated/constants/const_messages.phpt @@ -46,4 +46,3 @@ Deprecated: Constant DeprecatedConst5 is deprecated since 1.0, use DEPRECATED_CO Deprecated: Constant DeprecatedConst6 is deprecated since 1.0 in %s on line %d 6 - diff --git a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt index f749293d8fac..1775d35b8886 100644 --- a/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt +++ b/Zend/tests/attributes/deprecated/constants/deprecated_constant_as_message_002.phpt @@ -19,16 +19,16 @@ const TEST3 = 1; try { TEST; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { TEST3; } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: Constant TEST is deprecated, from itself -Caught: Constant TEST2 is deprecated +ErrorException: Constant TEST is deprecated, from itself +ErrorException: Constant TEST2 is deprecated diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt index af816aea6c4b..99d4cc741651 100644 --- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt +++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt @@ -15,7 +15,7 @@ function test() { try { test(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } eval(<<<'CODE' @@ -28,7 +28,7 @@ CODE); try { test2(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } class Clazz { @@ -42,7 +42,7 @@ try { $cls = new Clazz(); $cls->test(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $closure = #[\Deprecated("convert to exception")] function () { @@ -52,7 +52,7 @@ $closure = #[\Deprecated("convert to exception")] function () { try { $closure(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } class Constructor { @@ -65,7 +65,7 @@ class Constructor { try { new Constructor(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } class Destructor { @@ -78,14 +78,14 @@ class Destructor { try { new Destructor(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -Caught: Function test() is deprecated, convert to exception -Caught: Function test2() is deprecated, convert to exception -Caught: Method Clazz::test() is deprecated, convert to exception -Caught: Function {closure:%s:%d}() is deprecated, convert to exception -Caught: Method Constructor::__construct() is deprecated, convert to exception -Caught: Method Destructor::__destruct() is deprecated, convert to exception +ErrorException: Function test() is deprecated, convert to exception +ErrorException: Function test2() is deprecated, convert to exception +ErrorException: Method Clazz::test() is deprecated, convert to exception +ErrorException: Function {closure:%s:%d}() is deprecated, convert to exception +ErrorException: Method Constructor::__construct() is deprecated, convert to exception +ErrorException: Method Destructor::__destruct() is deprecated, convert to exception diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt index 3c9c9ec952fc..8d31ba611f72 100644 --- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt +++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt @@ -13,9 +13,9 @@ function test() {} try { $x = test(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: Function test() is deprecated +ErrorException: Function test() is deprecated diff --git a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt index 734a30795e5b..d9bbf64070e4 100644 --- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt +++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt @@ -13,9 +13,9 @@ function test($dummy) {} try { $x = test(new stdClass()); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: Function test() is deprecated +ErrorException: Function test() is deprecated diff --git a/Zend/tests/attributes/nodiscard/002.phpt b/Zend/tests/attributes/nodiscard/002.phpt index 618aa2f6286d..c690212a52ad 100644 --- a/Zend/tests/attributes/nodiscard/002.phpt +++ b/Zend/tests/attributes/nodiscard/002.phpt @@ -41,4 +41,3 @@ __callStatic(test) Warning: The return value of method Clazz::__invoke() should either be used or intentionally ignored by casting it as (void) in %s on line %d __invoke(foo) - diff --git a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt index 51179b26ab19..2d834e02ed75 100644 --- a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt +++ b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt @@ -15,7 +15,7 @@ function test(): int { try { test(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } #[\NoDiscard] @@ -26,10 +26,10 @@ function test2(): stdClass { try { test2(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: The return value of function test() should either be used or intentionally ignored by casting it as (void) -Caught: The return value of function test2() should either be used or intentionally ignored by casting it as (void) +ErrorException: The return value of function test() should either be used or intentionally ignored by casting it as (void) +ErrorException: The return value of function test2() should either be used or intentionally ignored by casting it as (void) diff --git a/Zend/tests/attributes/ossfuzz371445205.phpt b/Zend/tests/attributes/ossfuzz371445205.phpt index 17e4f529a2a0..95f6c4ac80f4 100644 --- a/Zend/tests/attributes/ossfuzz371445205.phpt +++ b/Zend/tests/attributes/ossfuzz371445205.phpt @@ -10,8 +10,8 @@ $attr=(new ReflectionClass(Test1::class))->getAttributes()[0]; try { $attr->newInstance(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unknown named parameter $notinterned +Error: Unknown named parameter $notinterned diff --git a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt index f6ea383c397e..82f75742c774 100644 --- a/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt +++ b/Zend/tests/backtrace/debug_print_backtrace_from_main.phpt @@ -5,4 +5,3 @@ Calling debug_print_backtrace() from main script debug_print_backtrace(); ?> --EXPECT-- - diff --git a/Zend/tests/bind_static_exception.phpt b/Zend/tests/bind_static_exception.phpt index c374130aaecf..9d76b5b6bbd5 100644 --- a/Zend/tests/bind_static_exception.phpt +++ b/Zend/tests/bind_static_exception.phpt @@ -11,8 +11,8 @@ try { $new = new Test; static $new; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foo +Exception: Foo diff --git a/Zend/tests/bitwise_not_precision_exception.phpt b/Zend/tests/bitwise_not_precision_exception.phpt index e28bf8f4e17b..ad98aa40ca63 100644 --- a/Zend/tests/bitwise_not_precision_exception.phpt +++ b/Zend/tests/bitwise_not_precision_exception.phpt @@ -8,8 +8,8 @@ set_error_handler(function($_, $msg) { try { var_dump(~INF); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -The float INF is not representable as an int, cast occurred +Exception: The float INF is not representable as an int, cast occurred diff --git a/Zend/tests/bug26229.phpt b/Zend/tests/bug26229.phpt index 5914b977ef51..fad131dae9f2 100644 --- a/Zend/tests/bug26229.phpt +++ b/Zend/tests/bug26229.phpt @@ -21,8 +21,8 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator +Exception: Objects returned by array_iterator::getIterator() must be traversable or implement interface Iterator diff --git a/Zend/tests/bug31098.phpt b/Zend/tests/bug31098.phpt index 862fc6fc46dc..319d97dbcb34 100644 --- a/Zend/tests/bug31098.phpt +++ b/Zend/tests/bug31098.phpt @@ -20,7 +20,7 @@ echo isset($simpleString->wrong)?"bug\n":"ok\n"; try { echo isset($simpleString["wrong"])?"bug\n":"ok\n"; } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo isset($simpleString[-20])?"bug\n":"ok\n"; echo isset($simpleString[0])?"ok\n":"bug\n"; @@ -31,14 +31,14 @@ echo $simpleString->wrong === null?"ok\n":"bug\n"; try { echo $simpleString["wrong"] === "B"?"ok\n":"bug\n"; } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo $simpleString["0"] === "B"?"ok\n":"bug\n"; try { /* This must not affect the string value */ $simpleString["wrong"] = "f"; } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo $simpleString["0"] === "B"?"ok\n":"bug\n"; ?> @@ -59,7 +59,7 @@ ok Warning: Attempt to read property "wrong" on string in %s on line %d ok -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string ok -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string ok diff --git a/Zend/tests/bug31720.phpt b/Zend/tests/bug31720.phpt index 083ea78a0116..e0246f62a363 100644 --- a/Zend/tests/bug31720.phpt +++ b/Zend/tests/bug31720.phpt @@ -7,9 +7,9 @@ $array = array('at least one element'); try { array_walk($array, array($nonesuchvar,'show')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $nonesuchvar in %s on line %d -array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/bug33996.phpt b/Zend/tests/bug33996.phpt index d5ec3386d6e9..849667e9eed8 100644 --- a/Zend/tests/bug33996.phpt +++ b/Zend/tests/bug33996.phpt @@ -22,16 +22,16 @@ function NormalTest($a) try { NormalTest(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FooTest(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } FooTest(new Foo()); ?> --EXPECTF-- -Exception: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected -Exception: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected +ArgumentCountError: Too few arguments to function NormalTest(), 0 passed in %sbug33996.php on line 18 and exactly 1 expected +ArgumentCountError: Too few arguments to function FooTest(), 0 passed in %sbug33996.php on line 23 and exactly 1 expected Hello! diff --git a/Zend/tests/bug37811.phpt b/Zend/tests/bug37811.phpt index b066ecd7abb9..7a58fe7da222 100644 --- a/Zend/tests/bug37811.phpt +++ b/Zend/tests/bug37811.phpt @@ -20,7 +20,7 @@ var_dump(Baz); try { var_dump((string) Baz); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -30,4 +30,4 @@ object(TestClass)#1 (0) { string(3) "Foo" object(stdClass)#2 (0) { } -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/Zend/tests/bug44660.phpt b/Zend/tests/bug44660.phpt index 02588c44b9d1..a956e8ce0509 100644 --- a/Zend/tests/bug44660.phpt +++ b/Zend/tests/bug44660.phpt @@ -12,35 +12,35 @@ echo "\n--> direct assignment:\n"; try { $a->p = $s; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n--> increment:\n"; try { $a->p++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n--> reference assignment:\n"; try { $a->p =& $s; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n--> reference assignment:\n"; try { $s =& $a->p; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n--> indexed assignment:\n"; try { $a->p[0] = $s; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n--> Confirm assignments have had no impact:\n"; @@ -51,19 +51,19 @@ var_dump($a); Warning: Attempt to read property "p" on true in %s on line %d --> direct assignment: -Attempt to assign property "p" on true +Error: Attempt to assign property "p" on true --> increment: -Attempt to increment/decrement property "p" on true +Error: Attempt to increment/decrement property "p" on true --> reference assignment: -Attempt to modify property "p" on true +Error: Attempt to modify property "p" on true --> reference assignment: -Attempt to modify property "p" on true +Error: Attempt to modify property "p" on true --> indexed assignment: -Attempt to modify property "p" on true +Error: Attempt to modify property "p" on true --> Confirm assignments have had no impact: bool(true) diff --git a/Zend/tests/bug46106.phpt b/Zend/tests/bug46106.phpt index 7f0ae66debfe..f4ed3e098d17 100644 --- a/Zend/tests/bug46106.phpt +++ b/Zend/tests/bug46106.phpt @@ -18,10 +18,10 @@ $x = new ReflectionFunction('str_pad'); try { test($x); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECT-- -str_pad() expects at least 2 arguments, 1 given +ArgumentCountError: str_pad() expects at least 2 arguments, 1 given DONE diff --git a/Zend/tests/bug47836.phpt b/Zend/tests/bug47836.phpt index 15afc68c48de..1776ad625ffb 100644 --- a/Zend/tests/bug47836.phpt +++ b/Zend/tests/bug47836.phpt @@ -7,13 +7,13 @@ $arr[PHP_INT_MAX] = 1; try { $arr[] = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($arr); ?> --EXPECTF-- -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied array(1) { [%d]=> int(1) diff --git a/Zend/tests/bug49893.phpt b/Zend/tests/bug49893.phpt index 0832b0b0ef4c..8dced2673d70 100644 --- a/Zend/tests/bug49893.phpt +++ b/Zend/tests/bug49893.phpt @@ -7,7 +7,7 @@ class A { try { throw new Exception("2"); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -21,9 +21,9 @@ class B { try { $b = new B(); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -2 -1 +Exception: 2 +Exception: 1 diff --git a/Zend/tests/bug52041.phpt b/Zend/tests/bug52041.phpt index 7debab3f8beb..1ae4642f9496 100644 --- a/Zend/tests/bug52041.phpt +++ b/Zend/tests/bug52041.phpt @@ -9,32 +9,32 @@ function foo() { try { foo()->a = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foo()->a->b = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foo()->a++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foo()->a->b++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foo()->a += 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foo()->a->b += 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foo()[0] = 1; @@ -48,22 +48,22 @@ var_dump(foo()); ?> --EXPECTF-- Warning: Undefined variable $x in %s on line %d -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null Warning: Undefined variable $x in %s on line %d -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $x in %s on line %d -Attempt to increment/decrement property "a" on null +Error: Attempt to increment/decrement property "a" on null Warning: Undefined variable $x in %s on line %d -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $x in %s on line %d -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null Warning: Undefined variable $x in %s on line %d -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $x in %s on line %d diff --git a/Zend/tests/bug52355.phpt b/Zend/tests/bug52355.phpt index 0c207be2beeb..fa7fd110bd6c 100644 --- a/Zend/tests/bug52355.phpt +++ b/Zend/tests/bug52355.phpt @@ -13,7 +13,7 @@ var_dump($foo); try { var_dump(1.0 / -0.0); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -21,4 +21,4 @@ try { float(-0) float(-0) float(-0) -Division by zero +DivisionByZeroError: Division by zero diff --git a/Zend/tests/bug52614.phpt b/Zend/tests/bug52614.phpt index 8c2bc0dc9e0e..c0c7a3d4d189 100644 --- a/Zend/tests/bug52614.phpt +++ b/Zend/tests/bug52614.phpt @@ -55,7 +55,7 @@ var_dump($foo->a3); try { $foo->f4()->a = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo->o1); @@ -76,7 +76,7 @@ array(0) { } array(0) { } -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null NULL object(stdClass)#3 (1) { ["a"]=> diff --git a/Zend/tests/bug53432.phpt b/Zend/tests/bug53432.phpt index aa2a6015f51f..92949c4afc7a 100644 --- a/Zend/tests/bug53432.phpt +++ b/Zend/tests/bug53432.phpt @@ -19,7 +19,7 @@ $str = ''; try { var_dump($str['foo'] = 'a'); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($str); @@ -27,7 +27,7 @@ $str = ''; try { var_dump($str[] = 'a'); } catch (Error $e) { - echo "Error: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); @@ -35,7 +35,7 @@ $str = ''; try { var_dump($str[0] += 1); } catch (Error $e) { - echo "Error: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); @@ -43,7 +43,7 @@ $str = ''; try { var_dump($str[0][0] = 'a'); } catch (Error $e) { - echo "Error: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); @@ -57,7 +57,7 @@ string(6) " a" Warning: Illegal string offset -1 in %s on line %d NULL string(0) "" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(0) "" Error: [] operator not supported for strings string(0) "" diff --git a/Zend/tests/bug63882.phpt b/Zend/tests/bug63882.phpt index 801f1b1e07ea..53b62e9937b4 100644 --- a/Zend/tests/bug63882.phpt +++ b/Zend/tests/bug63882.phpt @@ -12,9 +12,9 @@ $testobj2->x = $testobj2; try { var_dump($testobj1 == $testobj2); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Nesting level too deep - recursive dependency? +Error: Nesting level too deep - recursive dependency? diff --git a/Zend/tests/bug65784.phpt b/Zend/tests/bug65784.phpt index 78a7cd12d90c..1ef513b109e1 100644 --- a/Zend/tests/bug65784.phpt +++ b/Zend/tests/bug65784.phpt @@ -18,7 +18,7 @@ try { var_dump($foo); } catch (Exception $e) { do { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } while ($e = $e->getPrevious()); } @@ -55,7 +55,7 @@ function foo3() { $bar = foo3(); ?> --EXPECTF-- -string(9) "not catch" +Exception: not catch NULL Fatal error: Uncaught Exception: not caught in %sbug65784.php:42 diff --git a/Zend/tests/bug69017.phpt b/Zend/tests/bug69017.phpt index d1608ebbf9db..a527b1748a5c 100644 --- a/Zend/tests/bug69017.phpt +++ b/Zend/tests/bug69017.phpt @@ -19,7 +19,7 @@ c1::$a2[] = 1; try { c1::$a3[] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(c1::$a1); @@ -27,7 +27,7 @@ var_dump(c1::$a2); var_dump(c1::$a3); ?> --EXPECTF-- -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied array(2) { [1]=> string(3) "one" diff --git a/Zend/tests/bug69315.phpt b/Zend/tests/bug69315.phpt index 82017c055241..c5aa58d8c1bf 100644 --- a/Zend/tests/bug69315.phpt +++ b/Zend/tests/bug69315.phpt @@ -10,41 +10,41 @@ var_dump(is_callable("strlen")); try { var_dump(strlen("xxx")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(defined("PHP_VERSION")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(constant("PHP_VERSION")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(call_user_func("strlen")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(is_string("xxx")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(is_string()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) bool(false) -Call to undefined function strlen() -Call to undefined function defined() -Call to undefined function constant() -Call to undefined function call_user_func() -Call to undefined function is_string() -Call to undefined function is_string() +Error: Call to undefined function strlen() +Error: Call to undefined function defined() +Error: Call to undefined function constant() +Error: Call to undefined function call_user_func() +Error: Call to undefined function is_string() +Error: Call to undefined function is_string() diff --git a/Zend/tests/bug70083.phpt b/Zend/tests/bug70083.phpt index 691e6a412510..ed3a4b9e0f5b 100644 --- a/Zend/tests/bug70083.phpt +++ b/Zend/tests/bug70083.phpt @@ -16,13 +16,13 @@ $foo = new foo; try { $foo->i = &noref(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); ?> --EXPECT-- -Cannot assign by reference to overloaded object +Error: Cannot assign by reference to overloaded object object(foo)#1 (1) { ["var":"foo":private]=> NULL diff --git a/Zend/tests/bug70089.phpt b/Zend/tests/bug70089.phpt index 3a8e7d8e783e..72b0563b202b 100644 --- a/Zend/tests/bug70089.phpt +++ b/Zend/tests/bug70089.phpt @@ -8,28 +8,28 @@ function dummy($a) { try { chr(0)[0][] = 1; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset(chr(0)[0][0]); } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } eval("function runtimetest(&\$a) {} "); try { runtimetest(chr(0)[0]); } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ++chr(0)[0]; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(36) "Cannot use string offset as an array" -string(36) "Cannot use string offset as an array" -string(47) "Cannot create references to/from string offsets" -string(41) "Cannot increment/decrement string offsets" +Error: Cannot use string offset as an array +Error: Cannot use string offset as an array +Error: Cannot create references to/from string offsets +Error: Cannot increment/decrement string offsets diff --git a/Zend/tests/bug70689.phpt b/Zend/tests/bug70689.phpt index d1895cf39e54..3ea7844b13ba 100644 --- a/Zend/tests/bug70689.phpt +++ b/Zend/tests/bug70689.phpt @@ -14,7 +14,7 @@ set_error_handler(function($errno, $errstr) { try { foo(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/bug70895.phpt b/Zend/tests/bug70895.phpt index afbea1c91d76..d661c1c259fc 100644 --- a/Zend/tests/bug70895.phpt +++ b/Zend/tests/bug70895.phpt @@ -6,20 +6,20 @@ Bug #70895 null ptr deref and segfault with crafted callable try { array_map("%n", 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map("%n %i", 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map("%n %i aoeu %f aoeu %p", 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "%n %i aoeu %f aoeu %p" not found or invalid function name diff --git a/Zend/tests/bug70898.phpt b/Zend/tests/bug70898.phpt index d3d2cf79a9d1..f2426f6c1ac4 100644 --- a/Zend/tests/bug70898.phpt +++ b/Zend/tests/bug70898.phpt @@ -9,8 +9,8 @@ function m($f,$a){ try { echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",(""))))))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "0000000000000000000000000000000000" not found or invalid function name diff --git a/Zend/tests/bug70914.phpt b/Zend/tests/bug70914.phpt index 73a43a5600dc..db4609f31bec 100644 --- a/Zend/tests/bug70914.phpt +++ b/Zend/tests/bug70914.phpt @@ -10,8 +10,8 @@ $st = $db->query('SELECT 1'); try { $re = $st->fetchObject('%Z'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given +TypeError: PDOStatement::fetchObject(): Argument #1 ($class) must be a valid class name, %Z given diff --git a/Zend/tests/bug70918.phpt b/Zend/tests/bug70918.phpt index 54f3a3c72a80..7d521b631ead 100644 --- a/Zend/tests/bug70918.phpt +++ b/Zend/tests/bug70918.phpt @@ -5,43 +5,43 @@ Bug #70918 (Segfault using static outside of class scope) try { static::x; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { parent::x; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { self::x; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new static; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { static::x(); } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { static::$i; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(52) "Cannot access "static" when no class scope is active" -string(52) "Cannot access "parent" when no class scope is active" -string(50) "Cannot access "self" when no class scope is active" -string(52) "Cannot access "static" when no class scope is active" -string(52) "Cannot access "static" when no class scope is active" -string(52) "Cannot access "static" when no class scope is active" +Error: Cannot access "static" when no class scope is active +Error: Cannot access "parent" when no class scope is active +Error: Cannot access "self" when no class scope is active +Error: Cannot access "static" when no class scope is active +Error: Cannot access "static" when no class scope is active +Error: Cannot access "static" when no class scope is active diff --git a/Zend/tests/bug71196.phpt b/Zend/tests/bug71196.phpt index ca25f9f4fcba..511f8ac2d8ca 100644 --- a/Zend/tests/bug71196.phpt +++ b/Zend/tests/bug71196.phpt @@ -6,8 +6,8 @@ try { $a = "1"; [1, (y().$a.$a) . ($a.$a)]; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(30) "Call to undefined function y()" +Error: Call to undefined function y() diff --git a/Zend/tests/bug71572.phpt b/Zend/tests/bug71572.phpt index f4079e55f89a..cb20d8fe8e93 100644 --- a/Zend/tests/bug71572.phpt +++ b/Zend/tests/bug71572.phpt @@ -7,28 +7,28 @@ $str = "abc"; try { var_dump($str[0] = ""); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($str[1] = ""); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($str[3] = ""); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($str[10] = ""); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($str); ?> --EXPECT-- -Cannot assign an empty string to a string offset -Cannot assign an empty string to a string offset -Cannot assign an empty string to a string offset -Cannot assign an empty string to a string offset +Error: Cannot assign an empty string to a string offset +Error: Cannot assign an empty string to a string offset +Error: Cannot assign an empty string to a string offset +Error: Cannot assign an empty string to a string offset string(3) "abc" diff --git a/Zend/tests/bug72038.phpt b/Zend/tests/bug72038.phpt index f5491f1b9d6f..25e00463eeb3 100644 --- a/Zend/tests/bug72038.phpt +++ b/Zend/tests/bug72038.phpt @@ -7,13 +7,13 @@ try { test($foo = new stdClass); var_dump($foo); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test($bar = 2); var_dump($bar); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test($baz = &$bar); @@ -25,6 +25,6 @@ function test(&$param) { ?> --EXPECT-- -test(): Argument #1 ($param) could not be passed by reference -test(): Argument #1 ($param) could not be passed by reference +Error: test(): Argument #1 ($param) could not be passed by reference +Error: test(): Argument #1 ($param) could not be passed by reference int(1) diff --git a/Zend/tests/bug72107.phpt b/Zend/tests/bug72107.phpt index f65b1422691f..e2e067c2a083 100644 --- a/Zend/tests/bug72107.phpt +++ b/Zend/tests/bug72107.phpt @@ -9,8 +9,8 @@ function test($a) { try { test(1); } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -func_get_args() expects exactly 0 arguments, 4 given +ArgumentCountError: func_get_args() expects exactly 0 arguments, 4 given diff --git a/Zend/tests/bug74084.phpt b/Zend/tests/bug74084.phpt index 36239438c689..b73add39ef5d 100644 --- a/Zend/tests/bug74084.phpt +++ b/Zend/tests/bug74084.phpt @@ -9,29 +9,29 @@ unset($$A); try { $$A -= $$B['a'] = &$$C; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($$A); try { $$A *= $$B['a'] = &$$C; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($$A); try { $$A /= $$B['a'] = &$$C; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($$A); try { $$A **= $$B['a'] = &$$C; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: array - array -Unsupported operand types: array * array -Unsupported operand types: array / array -Unsupported operand types: array ** array +TypeError: Unsupported operand types: array - array +TypeError: Unsupported operand types: array * array +TypeError: Unsupported operand types: array / array +TypeError: Unsupported operand types: array ** array diff --git a/Zend/tests/bug75218.phpt b/Zend/tests/bug75218.phpt index ddbde62a5269..f9d7e7ebf1f0 100644 --- a/Zend/tests/bug75218.phpt +++ b/Zend/tests/bug75218.phpt @@ -7,7 +7,7 @@ function try_eval($code) { try { eval($code); } catch (CompileError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -18,7 +18,7 @@ try_eval('declare(encoding=[]);'); ?> --EXPECT-- -Multiple final modifiers are not allowed -Multiple access type modifiers are not allowed -__HALT_COMPILER() can only be used from the outermost scope -Encoding must be a literal +CompileError: Multiple final modifiers are not allowed +CompileError: Multiple access type modifiers are not allowed +CompileError: __HALT_COMPILER() can only be used from the outermost scope +CompileError: Encoding must be a literal diff --git a/Zend/tests/bug75252.phpt b/Zend/tests/bug75252.phpt index b4e0a1b5bdc3..36c04a6bc976 100644 --- a/Zend/tests/bug75252.phpt +++ b/Zend/tests/bug75252.phpt @@ -13,16 +13,16 @@ CODE; try { eval($code); } catch (ParseError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { eval($code); } catch (ParseError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(41) "syntax error, unexpected identifier "FOO"" -string(41) "syntax error, unexpected identifier "FOO"" +ParseError: syntax error, unexpected identifier "FOO" +ParseError: syntax error, unexpected identifier "FOO" diff --git a/Zend/tests/bug75921.phpt b/Zend/tests/bug75921.phpt index ab82c85840c4..925236104e87 100644 --- a/Zend/tests/bug75921.phpt +++ b/Zend/tests/bug75921.phpt @@ -6,7 +6,7 @@ Bug #75921: Inconsistent error when creating stdObject from empty variable try { $null->a = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($null); unset($null); @@ -14,7 +14,7 @@ unset($null); try { $null->a['hello'] = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($null); unset($null); @@ -22,7 +22,7 @@ unset($null); try { $null->a->b = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($null); unset($null); @@ -30,7 +30,7 @@ unset($null); try { $null->a['hello']->b = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($null); unset($null); @@ -38,30 +38,30 @@ unset($null); try { $null->a->b['hello'] = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($null); unset($null); ?> --EXPECTF-- -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null Warning: Undefined variable $null in %s on line %d NULL -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $null in %s on line %d NULL -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $null in %s on line %d NULL -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $null in %s on line %d NULL -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null Warning: Undefined variable $null in %s on line %d NULL diff --git a/Zend/tests/bug76869.phpt b/Zend/tests/bug76869.phpt index a19d2dfedbfe..afd60595970b 100644 --- a/Zend/tests/bug76869.phpt +++ b/Zend/tests/bug76869.phpt @@ -16,8 +16,8 @@ $b = new B(); try { var_dump($b->f()); } catch (Throwable $e) { - echo "Exception: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Call to protected method B::f() from global scope +Error: Call to protected method B::f() from global scope diff --git a/Zend/tests/bug78154.phpt b/Zend/tests/bug78154.phpt index 94f49b224e6d..3ce187a865f5 100644 --- a/Zend/tests/bug78154.phpt +++ b/Zend/tests/bug78154.phpt @@ -8,7 +8,7 @@ namespace { var_dump(similar_text('a', 'a', $c=0x44444444)); var_dump($c); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } namespace Foo { @@ -16,11 +16,11 @@ namespace Foo { var_dump(similar_text('a', 'a', $d=0x44444444)); var_dump($d); } catch (\Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Exception: similar_text(): Argument #3 ($percent) could not be passed by reference -Exception: similar_text(): Argument #3 ($percent) could not be passed by reference +Error: similar_text(): Argument #3 ($percent) could not be passed by reference +Error: similar_text(): Argument #3 ($percent) could not be passed by reference diff --git a/Zend/tests/bug78182.phpt b/Zend/tests/bug78182.phpt index a751e953bbff..b7f9fe9b7195 100644 --- a/Zend/tests/bug78182.phpt +++ b/Zend/tests/bug78182.phpt @@ -7,10 +7,10 @@ $propName = 'prop'; try { $$varName->$propName =& $$varName; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($var); ?> --EXPECT-- -Attempt to modify property "prop" on null +Error: Attempt to modify property "prop" on null NULL diff --git a/Zend/tests/bug78531.phpt b/Zend/tests/bug78531.phpt index b818afb79a86..23a5388d6b5d 100644 --- a/Zend/tests/bug78531.phpt +++ b/Zend/tests/bug78531.phpt @@ -5,33 +5,33 @@ Bug #78531 (Crash when using undefined variable as object) try { $u1->a += 5; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = ++$u2->a; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $u3->a++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $u4->a->a += 5; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $u1 in %s on line %d -Attempt to assign property "a" on null +Error: Attempt to assign property "a" on null Warning: Undefined variable $u2 in %s on line %d -Attempt to increment/decrement property "a" on null +Error: Attempt to increment/decrement property "a" on null Warning: Undefined variable $u3 in %s on line %d -Attempt to increment/decrement property "a" on null +Error: Attempt to increment/decrement property "a" on null Warning: Undefined variable $u4 in %s on line %d -Attempt to modify property "a" on null +Error: Attempt to modify property "a" on null diff --git a/Zend/tests/bug78810.phpt b/Zend/tests/bug78810.phpt index 0fd56f0ceda5..4952c562c936 100644 --- a/Zend/tests/bug78810.phpt +++ b/Zend/tests/bug78810.phpt @@ -11,15 +11,15 @@ $test = new Test; try { $test->i++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->i += 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property Test::$i must not be accessed before initialization -Typed property Test::$i must not be accessed before initialization +Error: Typed property Test::$i must not be accessed before initialization +Error: Typed property Test::$i must not be accessed before initialization diff --git a/Zend/tests/bug78926.phpt b/Zend/tests/bug78926.phpt index a59692748b2d..6b44ff58e7ed 100644 --- a/Zend/tests/bug78926.phpt +++ b/Zend/tests/bug78926.phpt @@ -12,11 +12,11 @@ spl_autoload_register(function($class) { try { class B extends A {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(class_exists('B', false)); ?> --EXPECT-- -Class "A" not found +Error: Class "A" not found bool(false) diff --git a/Zend/tests/bug79599.phpt b/Zend/tests/bug79599.phpt index 57e5332431f5..32e65087c2c3 100644 --- a/Zend/tests/bug79599.phpt +++ b/Zend/tests/bug79599.phpt @@ -14,14 +14,14 @@ function test2(){ try{ test1(); }catch(\Exception $e){ - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try{ test2(); }catch(\Exception $e){ - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(21) "Undefined variable $b" -string(21) "Undefined variable $c" +Exception: Undefined variable $b +Exception: Undefined variable $c diff --git a/Zend/tests/bug79947.phpt b/Zend/tests/bug79947.phpt index 0593eacfd6c4..457c0603671b 100644 --- a/Zend/tests/bug79947.phpt +++ b/Zend/tests/bug79947.phpt @@ -7,11 +7,11 @@ $key = []; try { $array[$key] += [$key]; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($array); ?> --EXPECT-- -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array array(0) { } diff --git a/Zend/tests/bug80972.phpt b/Zend/tests/bug80972.phpt index 01d1a98952da..4abce01f934e 100644 --- a/Zend/tests/bug80972.phpt +++ b/Zend/tests/bug80972.phpt @@ -20,7 +20,7 @@ try { $string[(string) 10e120] = 'E'; var_dump($string); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* This same bug also permits to modify the first byte of a string even if @@ -29,13 +29,13 @@ try { /* This must not affect the string value */ $string["wrong"] = "f"; } catch (\Throwable $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($string); ?> --EXPECT-- Float casted to string compile -Cannot access offset of type string on string -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(34) "Here is some text for good measure" diff --git a/Zend/tests/bug81159.phpt b/Zend/tests/bug81159.phpt index d16deafbf5b9..54a85a160122 100644 --- a/Zend/tests/bug81159.phpt +++ b/Zend/tests/bug81159.phpt @@ -8,14 +8,14 @@ $o = new stdClass(); try { $s[$o] = 'A'; } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($s[$o]); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type stdClass on string -Cannot access offset of type stdClass on string +TypeError: Cannot access offset of type stdClass on string +TypeError: Cannot access offset of type stdClass on string diff --git a/Zend/tests/call_to_abstract_method_args.phpt b/Zend/tests/call_to_abstract_method_args.phpt index cbbc276d2ce2..c5c6dc67d88d 100644 --- a/Zend/tests/call_to_abstract_method_args.phpt +++ b/Zend/tests/call_to_abstract_method_args.phpt @@ -10,17 +10,17 @@ abstract class Test { try { Test::method(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ret = new stdClass; try { $ret = Test::method(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot call abstract method Test::method() -Cannot call abstract method Test::method() +Error: Cannot call abstract method Test::method() +Error: Cannot call abstract method Test::method() diff --git a/Zend/tests/call_to_deprecated_function_args.phpt b/Zend/tests/call_to_deprecated_function_args.phpt index bbae74746080..7574bbffbee4 100644 --- a/Zend/tests/call_to_deprecated_function_args.phpt +++ b/Zend/tests/call_to_deprecated_function_args.phpt @@ -12,21 +12,21 @@ set_error_handler(function($code, $msg) { try { zend_test_deprecated(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ret = new stdClass; try { $ret = zend_test_deprecated(new stdClass()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $fn = 'zend_test_deprecated'; $fn(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ret = new stdClass; @@ -34,12 +34,12 @@ try { $fn = 'zend_test_deprecated'; $ret = $fn(new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Function zend_test_deprecated() is deprecated -Function zend_test_deprecated() is deprecated -Function zend_test_deprecated() is deprecated -Function zend_test_deprecated() is deprecated +Error: Function zend_test_deprecated() is deprecated +Error: Function zend_test_deprecated() is deprecated +Error: Function zend_test_deprecated() is deprecated +Error: Function zend_test_deprecated() is deprecated diff --git a/Zend/tests/call_user_functions/call_user_func_001.phpt b/Zend/tests/call_user_functions/call_user_func_001.phpt index 9497d305e2cd..46203b279dde 100644 --- a/Zend/tests/call_user_functions/call_user_func_001.phpt +++ b/Zend/tests/call_user_functions/call_user_func_001.phpt @@ -25,17 +25,17 @@ namespace testing { try { call_user_func(array(new $class, 'priv'), 'foobar'); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array(new $class, 'prot'), 'foobar'); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- string(6) "foobar" -call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv() -call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot() +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access private method testing\foo::priv() +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access protected method testing\foo::prot() diff --git a/Zend/tests/call_user_functions/call_user_func_002.phpt b/Zend/tests/call_user_functions/call_user_func_002.phpt index 443334cd2375..9e739610eb60 100644 --- a/Zend/tests/call_user_functions/call_user_func_002.phpt +++ b/Zend/tests/call_user_functions/call_user_func_002.phpt @@ -10,32 +10,32 @@ spl_autoload_register(function ($class) { try { call_user_func(array('foo', 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array('', 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array($foo, 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array($foo, '')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- string(3) "foo" -call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found -call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "foo" not found +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "" not found Warning: Undefined variable $foo in %s on line %d -call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object Warning: Undefined variable $foo in %s on line %d -call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt index 1849d8fc19bc..31cb8626b5d4 100644 --- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt +++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type.phpt @@ -9,7 +9,7 @@ try { $len = []; call_user_func_array('var_dump', array_slice($array, 0, $len)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $len = 2.0; @@ -20,7 +20,7 @@ call_user_func_array('var_dump', array_slice($array, 1, $len)); ?> --EXPECT-- -array_slice(): Argument #3 ($length) must be of type ?int, array given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given int(1) int(2) int(2) diff --git a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt index f73c8bbb2467..c45f966e564f 100644 --- a/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt +++ b/Zend/tests/call_user_functions/call_user_func_array_array_slice_type_strict.phpt @@ -10,14 +10,14 @@ try { $len = []; call_user_func_array('var_dump', array_slice($array, 0, $len)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $len = 2.0; call_user_func_array('var_dump', array_slice($array, 0, $len)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $len = null; @@ -25,7 +25,7 @@ call_user_func_array('var_dump', array_slice($array, 1, $len)); ?> --EXPECT-- -array_slice(): Argument #3 ($length) must be of type ?int, array given -array_slice(): Argument #3 ($length) must be of type ?int, float given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, array given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, float given int(2) int(3) diff --git a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt index 785a6e35e907..7a748acff546 100644 --- a/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt +++ b/Zend/tests/call_user_functions/call_user_func_array_invalid_type.phpt @@ -11,8 +11,8 @@ $drv = new drv; try { call_user_func_array(array($drv, 'func'), null); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -call_user_func_array(): Argument #2 ($args) must be of type array, null given +TypeError: call_user_func_array(): Argument #2 ($args) must be of type array, null given diff --git a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt index 4596269549a1..c94ddda854ea 100644 --- a/Zend/tests/call_user_functions/call_user_func_by_ref.phpt +++ b/Zend/tests/call_user_functions/call_user_func_by_ref.phpt @@ -8,10 +8,10 @@ function test(Type &$ref) { try { call_user_func('test', 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: test(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d -test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d +TypeError: test(): Argument #1 ($ref) must be of type Type, int given, called in %s on line %d diff --git a/Zend/tests/callable_param_exception_leak.phpt b/Zend/tests/callable_param_exception_leak.phpt index 090279971080..010cc8bb38a2 100644 --- a/Zend/tests/callable_param_exception_leak.phpt +++ b/Zend/tests/callable_param_exception_leak.phpt @@ -8,8 +8,8 @@ spl_autoload_register(function ($class) { try { array_map('A::b', []); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Failed +Exception: Failed diff --git a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt index a550cdd2b06d..4b2dca548399 100644 --- a/Zend/tests/class_name/class_name_as_scalar_error_007.phpt +++ b/Zend/tests/class_name/class_name_as_scalar_error_007.phpt @@ -6,15 +6,15 @@ Cannot access self::class when no class scope is active try { var_dump(self::class); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump([self::class]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use "self" in the global scope -Cannot use "self" in the global scope +Error: Cannot use "self" in the global scope +Error: Cannot use "self" in the global scope diff --git a/Zend/tests/class_name/class_on_object.phpt b/Zend/tests/class_name/class_on_object.phpt index dab09872901b..d5a48fb62246 100644 --- a/Zend/tests/class_name/class_on_object.phpt +++ b/Zend/tests/class_name/class_on_object.phpt @@ -17,7 +17,7 @@ function test() { try { test(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,4 +25,4 @@ try { string(8) "stdClass" string(8) "stdClass" string(8) "stdClass" -Cannot use "::class" on null +TypeError: Cannot use "::class" on null diff --git a/Zend/tests/clone/ast.phpt b/Zend/tests/clone/ast.phpt index e482854a9448..1bbf24e0b130 100644 --- a/Zend/tests/clone/ast.phpt +++ b/Zend/tests/clone/ast.phpt @@ -9,86 +9,86 @@ $x = new stdClass(); try { assert(false && $y = clone $x); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x)); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x, )); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x, [ "foo" => $foo, "bar" => $bar ])); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x, $array)); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x, $array, $extraParameter, $trailingComma, )); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone(object: $x, withProperties: [ "foo" => $foo, "bar" => $bar ])); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone($x, withProperties: [ "foo" => $foo, "bar" => $bar ])); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone(object: $x)); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone(object: $x, [ "foo" => $foo, "bar" => $bar ])); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone(...["object" => $x, "withProperties" => [ "foo" => $foo, "bar" => $bar ]])); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && $y = clone(...)); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(false && ($y = \clone($x))) -assert(false && ($y = \clone($x))) -assert(false && ($y = \clone($x))) -assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar]))) -assert(false && ($y = \clone($x, $array))) -assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma))) -assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar]))) -assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar]))) -assert(false && ($y = \clone(object: $x))) -assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar]))) -assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]]))) -assert(false && ($y = \clone(...))) +AssertionError: assert(false && ($y = \clone($x))) +AssertionError: assert(false && ($y = \clone($x))) +AssertionError: assert(false && ($y = \clone($x))) +AssertionError: assert(false && ($y = \clone($x, ['foo' => $foo, 'bar' => $bar]))) +AssertionError: assert(false && ($y = \clone($x, $array))) +AssertionError: assert(false && ($y = \clone($x, $array, $extraParameter, $trailingComma))) +AssertionError: assert(false && ($y = \clone(object: $x, withProperties: ['foo' => $foo, 'bar' => $bar]))) +AssertionError: assert(false && ($y = \clone($x, withProperties: ['foo' => $foo, 'bar' => $bar]))) +AssertionError: assert(false && ($y = \clone(object: $x))) +AssertionError: assert(false && ($y = \clone(object: $x, ['foo' => $foo, 'bar' => $bar]))) +AssertionError: assert(false && ($y = \clone(...['object' => $x, 'withProperties' => ['foo' => $foo, 'bar' => $bar]]))) +AssertionError: assert(false && ($y = \clone(...))) diff --git a/Zend/tests/clone/bug36071.phpt b/Zend/tests/clone/bug36071.phpt index e1a4baa7226e..0d5f58d6ebf6 100644 --- a/Zend/tests/clone/bug36071.phpt +++ b/Zend/tests/clone/bug36071.phpt @@ -7,7 +7,7 @@ error_reporting=4095 try { $a = clone 0; } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/Zend/tests/clone/bug42817.phpt b/Zend/tests/clone/bug42817.phpt index b5f53222d7ee..96e548a09ca4 100644 --- a/Zend/tests/clone/bug42817.phpt +++ b/Zend/tests/clone/bug42817.phpt @@ -5,7 +5,7 @@ Bug #42817 (clone() on a non-object does not result in a fatal error) try { $a = clone(null); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/Zend/tests/clone/bug42818.phpt b/Zend/tests/clone/bug42818.phpt index 08ba05fcfaa2..1f2780a7ccf1 100644 --- a/Zend/tests/clone/bug42818.phpt +++ b/Zend/tests/clone/bug42818.phpt @@ -5,7 +5,7 @@ Bug #42818 ($foo = clone(array()); leaks memory) try { $foo = clone(array()); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/Zend/tests/clone/clone_001.phpt b/Zend/tests/clone/clone_001.phpt index 91fa6f551176..b40c65820b3e 100644 --- a/Zend/tests/clone/clone_001.phpt +++ b/Zend/tests/clone/clone_001.phpt @@ -6,7 +6,7 @@ Using clone statement on non-object try { $a = clone array(); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_003.phpt b/Zend/tests/clone/clone_003.phpt index b8bb2833dc25..78208f9a50b9 100644 --- a/Zend/tests/clone/clone_003.phpt +++ b/Zend/tests/clone/clone_003.phpt @@ -6,7 +6,7 @@ Using clone statement on undefined variable try { $a = clone $b; } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_002.phpt b/Zend/tests/clone/clone_with_002.phpt index 8b86e64c76aa..8f9686d37180 100644 --- a/Zend/tests/clone/clone_with_002.phpt +++ b/Zend/tests/clone/clone_with_002.phpt @@ -41,25 +41,25 @@ var_dump($c->m2()); try { var_dump($c->m3()); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(clone($p, [ 'b' => 'inaccessible' ])); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(clone($p, [ 'd' => 'inaccessible' ])); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump((new Unrelated())->m3($p)); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_005.phpt b/Zend/tests/clone/clone_with_005.phpt index 55ffb2423d7e..acc130ee9b87 100644 --- a/Zend/tests/clone/clone_with_005.phpt +++ b/Zend/tests/clone/clone_with_005.phpt @@ -42,7 +42,7 @@ $c = new Clazz(); try { var_dump(clone($c, [ 'hooked' => 'updated', 'maxLength' => 'abcdef', 'minLength' => 'abc' ])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL; @@ -50,7 +50,7 @@ echo PHP_EOL; try { var_dump(clone($c, [ 'hooked' => 'updated', 'minLength' => 'abc', 'maxLength' => 'abcdef' ])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_006.phpt b/Zend/tests/clone/clone_with_006.phpt index 7b0b8520b8a8..ca8755c5fe11 100644 --- a/Zend/tests/clone/clone_with_006.phpt +++ b/Zend/tests/clone/clone_with_006.phpt @@ -8,7 +8,7 @@ $x = new stdClass(); try { var_dump(clone($x, 1)); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_008.phpt b/Zend/tests/clone/clone_with_008.phpt index aa2c639fb7f1..1a8557edf619 100644 --- a/Zend/tests/clone/clone_with_008.phpt +++ b/Zend/tests/clone/clone_with_008.phpt @@ -21,7 +21,7 @@ var_dump(clone($c, [ 'a' => "with" ])); try { var_dump(clone($c, [ 'b' => "with" ])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_010.phpt b/Zend/tests/clone/clone_with_010.phpt index 29ecf714fc49..424c017a3c85 100644 --- a/Zend/tests/clone/clone_with_010.phpt +++ b/Zend/tests/clone/clone_with_010.phpt @@ -6,13 +6,13 @@ Clone with native classes try { var_dump(clone(new \Random\Engine\Secure(), [ 'with' => "something" ])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(clone(new \Random\Engine\Xoshiro256StarStar(), [ 'with' => "something" ])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_011.phpt b/Zend/tests/clone/clone_with_011.phpt index 5f8e99bb65f2..bd3e0200aac1 100644 --- a/Zend/tests/clone/clone_with_011.phpt +++ b/Zend/tests/clone/clone_with_011.phpt @@ -10,7 +10,7 @@ class Foo { try { var_dump(clone(new Foo(), ["\0Foo\0bar" => 'updated'])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_012.phpt b/Zend/tests/clone/clone_with_012.phpt index e24f0adad7c4..fb906afbba9f 100644 --- a/Zend/tests/clone/clone_with_012.phpt +++ b/Zend/tests/clone/clone_with_012.phpt @@ -21,7 +21,7 @@ var_dump(clone($f, ['foo' => 'foo updated in clone-with'])); try { var_dump(clone($f, ['foo' => 'foo updated in clone-with', 'bar' => 'bar updated in clone-with'])); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_013.phpt b/Zend/tests/clone/clone_with_013.phpt index 13f246325585..515c46f44741 100644 --- a/Zend/tests/clone/clone_with_013.phpt +++ b/Zend/tests/clone/clone_with_013.phpt @@ -11,7 +11,7 @@ $with = ['x' => &$ref]; try { var_dump(clone($x, $with)); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } unset($ref); @@ -19,7 +19,7 @@ unset($ref); try { var_dump(clone($x, $with)); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/clone/clone_with_014.phpt b/Zend/tests/clone/clone_with_014.phpt index bfbee40e163c..4e90b22dc66e 100644 --- a/Zend/tests/clone/clone_with_014.phpt +++ b/Zend/tests/clone/clone_with_014.phpt @@ -19,7 +19,7 @@ var_dump($test); try { $test->b = 4; } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($test); diff --git a/Zend/tests/closures/bug79778.phpt b/Zend/tests/closures/bug79778.phpt index fa2e2771dcec..8ed00d1cac33 100644 --- a/Zend/tests/closures/bug79778.phpt +++ b/Zend/tests/closures/bug79778.phpt @@ -12,7 +12,7 @@ print_r($closure1); try { $closure1(); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($closure1); @@ -49,7 +49,7 @@ Closure Object ) ) -Undefined constant "CONST_REF" +Error: Undefined constant "CONST_REF" object(Closure)#%d (4) { ["name"]=> string(%d) "{closure:%s:%d}" diff --git a/Zend/tests/closures/closure_015.phpt b/Zend/tests/closures/closure_015.phpt index f6903ebdb183..4e89471fbff2 100644 --- a/Zend/tests/closures/closure_015.phpt +++ b/Zend/tests/closures/closure_015.phpt @@ -7,15 +7,15 @@ $x = function() { return 1; }; try { print (string) $x; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { print $x; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object of class Closure could not be converted to string -Object of class Closure could not be converted to string +Error: Object of class Closure could not be converted to string +Error: Object of class Closure could not be converted to string diff --git a/Zend/tests/closures/closure_021.phpt b/Zend/tests/closures/closure_021.phpt index 95ff7d889f9e..d9a23bbf2e4a 100644 --- a/Zend/tests/closures/closure_021.phpt +++ b/Zend/tests/closures/closure_021.phpt @@ -14,9 +14,9 @@ $foo = function() { try { $foo(); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(5) "test!" +Exception: test! diff --git a/Zend/tests/closures/closure_027.phpt b/Zend/tests/closures/closure_027.phpt index 6e467856100a..8e5a53a67921 100644 --- a/Zend/tests/closures/closure_027.phpt +++ b/Zend/tests/closures/closure_027.phpt @@ -16,7 +16,7 @@ $a = function($x) use ($y) {}; try { test($a); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test(new stdclass); @@ -28,7 +28,7 @@ object(stdClass)#%d (0) { NULL Warning: Undefined variable $y in %s on line %d -Exception: 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 Fatal error: Uncaught TypeError: test(): Argument #1 ($a) must be of type Closure, stdClass given, called in %s:%d Stack trace: diff --git a/Zend/tests/closures/closure_031.phpt b/Zend/tests/closures/closure_031.phpt index 19f3dc6e3212..611cf9a62352 100644 --- a/Zend/tests/closures/closure_031.phpt +++ b/Zend/tests/closures/closure_031.phpt @@ -11,7 +11,7 @@ $foo = function() { try { var_dump($foo->a); } catch (Error $ex) { - echo "Error: {$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/Zend/tests/closures/closure_040.phpt b/Zend/tests/closures/closure_040.phpt index b733bdbef053..f265ceb7ef6a 100644 --- a/Zend/tests/closures/closure_040.phpt +++ b/Zend/tests/closures/closure_040.phpt @@ -27,13 +27,13 @@ $cas = $a->getStaticIncrementor(); try { $ca->bindTo($a, array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $cas->bindTo($a, 'A'); ?> --EXPECTF-- -Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given +TypeError: Closure::bindTo(): Argument #2 ($newScope) must be of type object|string|null, array given Warning: Cannot bind an instance to a static closure, this will be an error in PHP 9 in %s on line %d diff --git a/Zend/tests/closures/closure_059.phpt b/Zend/tests/closures/closure_059.phpt index d8f7590db902..d101d4ab2720 100644 --- a/Zend/tests/closures/closure_059.phpt +++ b/Zend/tests/closures/closure_059.phpt @@ -20,20 +20,20 @@ call_user_func(array($f,"__invoke"), $a); try { $f($b); } catch (Error $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f->__invoke($b); } catch (Error $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array($f,"__invoke"), $b); } catch (Error $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d -Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given -Exception: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given +TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given, called in %s on line %d +TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given +TypeError: {closure:%s:%d}(): Argument #1 ($a) must be of type A, B given diff --git a/Zend/tests/closures/closure_063.phpt b/Zend/tests/closures/closure_063.phpt index b53f370eb4bf..f46cdd976c88 100644 --- a/Zend/tests/closures/closure_063.phpt +++ b/Zend/tests/closures/closure_063.phpt @@ -9,4 +9,4 @@ Closure::fromCallable('foo')->bindTo(new stdClass); ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/Zend/tests/closures/closure_array_key_error.phpt b/Zend/tests/closures/closure_array_key_error.phpt index 8b6441e3c25a..6a21331fa99c 100644 --- a/Zend/tests/closures/closure_array_key_error.phpt +++ b/Zend/tests/closures/closure_array_key_error.phpt @@ -6,9 +6,9 @@ Trying to use lambda as array key try { var_dump(array(function() { } => 1)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type Closure on array +TypeError: Cannot access offset of type Closure on array diff --git a/Zend/tests/closures/closure_array_offset_error.phpt b/Zend/tests/closures/closure_array_offset_error.phpt index 8958237b0eb8..d6cfe3a71bb2 100644 --- a/Zend/tests/closures/closure_array_offset_error.phpt +++ b/Zend/tests/closures/closure_array_offset_error.phpt @@ -6,9 +6,9 @@ Trying to use lambda in array offset try { $test[function(){}] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type Closure on array +TypeError: Cannot access offset of type Closure on array diff --git a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt index e87abf8c9061..d5226ee597b0 100644 --- a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt +++ b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt @@ -14,7 +14,7 @@ try { function () { } ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -26,16 +26,16 @@ try { class {} ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(!#[Attr(static function ($foo) { +AssertionError: assert(!#[Attr(static function ($foo) { echo $foo; })] function () { }) -assert(!new #[Attr(static function ($foo) { +AssertionError: assert(!new #[Attr(static function ($foo) { echo $foo; })] class { }) diff --git a/Zend/tests/closures/closure_from_callable_error.phpt b/Zend/tests/closures/closure_from_callable_error.phpt index c6fd1ff831f5..5d14ee396220 100644 --- a/Zend/tests/closures/closure_from_callable_error.phpt +++ b/Zend/tests/closures/closure_from_callable_error.phpt @@ -14,7 +14,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } @@ -27,7 +27,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Cannot access privateInstance method'."\n"; @@ -39,7 +39,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'SubClass cannot access private instance method'."\n"; @@ -51,7 +51,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Cannot access private static function of instance'."\n"; @@ -63,7 +63,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Cannot access private static method statically'."\n"; @@ -75,7 +75,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Cannot access private static method statically with colon scheme'."\n"; @@ -87,7 +87,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Non-existent method should fail'."\n"; @@ -99,7 +99,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Non-existent class should fail'."\n"; @@ -111,7 +111,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Non-existent function should fail'."\n"; @@ -123,7 +123,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } @@ -137,7 +137,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Subclass cannot closure over parent private static method'."\n"; @@ -150,7 +150,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Function scope cannot closure over protected instance method'."\n"; @@ -162,7 +162,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Function scope cannot closure over private instance method'."\n"; @@ -174,7 +174,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo 'Access private instance method of parent object through "self::" to parent method'."\n"; @@ -187,7 +187,7 @@ catch (\TypeError $te) { //This is the expected outcome. } catch (\Throwable $t) { - echo "Wrong exception type thrown: ".get_class($t)." : ".$t->getMessage()."\n"; + echo 'Wrong exception type thrown: ', $t::class, ': ', $t->getMessage(), "\n"; } echo "OK\n"; diff --git a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt index 24df1d186a43..b93372074dee 100644 --- a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt +++ b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt @@ -12,9 +12,9 @@ try { $fn = Closure::fromCallable(['A', 'method']); $fn(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Failed to create closure from callable: non-static method A::method() cannot be called statically +TypeError: Failed to create closure from callable: non-static method A::method() cannot be called statically diff --git a/Zend/tests/closures/closure_get_current.phpt b/Zend/tests/closures/closure_get_current.phpt index 3024ff355b55..df58f69cd723 100644 --- a/Zend/tests/closures/closure_get_current.phpt +++ b/Zend/tests/closures/closure_get_current.phpt @@ -24,7 +24,7 @@ function fail() { try { fail(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function foo() { @@ -34,7 +34,7 @@ function foo() { try { foo(...)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -60,5 +60,5 @@ int(9) int(10) int(10) int(11) -Current function is not a closure -Current function is not a closure +Error: Current function is not a closure +Error: Current function is not a closure diff --git a/Zend/tests/closures/closure_instantiate.phpt b/Zend/tests/closures/closure_instantiate.phpt index de3b866cb82e..2143c3674cbc 100644 --- a/Zend/tests/closures/closure_instantiate.phpt +++ b/Zend/tests/closures/closure_instantiate.phpt @@ -10,12 +10,12 @@ try { $x = new Closure(); } catch (Exception $e) { // Instantiating a closure is an error, not an exception, so we shouldn't see this - echo 'EXCEPTION: ', $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } catch (Throwable $e) { // This is the message that we should see for a caught error - echo 'ERROR: ', $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ERROR: Instantiation of class Closure is not allowed +Error: Instantiation of class Closure is not allowed diff --git a/Zend/tests/closures/closure_write_prop.phpt b/Zend/tests/closures/closure_write_prop.phpt index 8dbf18e67041..909202fd7268 100644 --- a/Zend/tests/closures/closure_write_prop.phpt +++ b/Zend/tests/closures/closure_write_prop.phpt @@ -14,9 +14,9 @@ $a = new A; try { $c = $a->getFn()->b = new stdClass; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property Closure::$b +Error: Cannot create dynamic property Closure::$b diff --git a/Zend/tests/coalesce/assign_coalesce_002.phpt b/Zend/tests/coalesce/assign_coalesce_002.phpt index 0b2c5374bc7a..e26337a7b9d1 100644 --- a/Zend/tests/coalesce/assign_coalesce_002.phpt +++ b/Zend/tests/coalesce/assign_coalesce_002.phpt @@ -21,7 +21,7 @@ $ary = []; try { $ary[id($foo)] ??= do_throw("ex1"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ary); @@ -47,7 +47,7 @@ $ary = new AA; try { $ary[new Dtor][id($foo)] ??= $bar; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); @@ -66,19 +66,19 @@ $ary = ["foo" => new AA2]; try { $ary[id($foo)][new Dtor] ??= $bar; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); ?> --EXPECT-- id(foo) -ex1 +Exception: ex1 array(0) { } id(foo) -dtor +Exception: dtor string(3) "foo" id(foo) -dtor +Exception: dtor string(3) "foo" diff --git a/Zend/tests/compound_assign_with_numeric_strings.phpt b/Zend/tests/compound_assign_with_numeric_strings.phpt index c6cee53d95c9..6102a1bffe70 100644 --- a/Zend/tests/compound_assign_with_numeric_strings.phpt +++ b/Zend/tests/compound_assign_with_numeric_strings.phpt @@ -12,7 +12,7 @@ try { $n <<= $n; var_dump($n); } catch (ArithmeticError $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $n = "65"; @@ -24,7 +24,7 @@ try { $n >>= $n; var_dump($n); } catch (ArithmeticError $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $n = "0"; @@ -32,7 +32,7 @@ try{ $n %= $n; var_dump($n); } catch (DivisionByZeroError $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $n = "-1"; @@ -41,11 +41,8 @@ var_dump($n); ?> --EXPECT-- int(0) - -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number int(0) - -Exception: Bit shift by negative number - -Exception: Modulo by zero +ArithmeticError: Bit shift by negative number +DivisionByZeroError: Modulo by zero int(0) diff --git a/Zend/tests/concat/bug81705.phpt b/Zend/tests/concat/bug81705.phpt index 1c00b1c77d4b..86d897b1db3b 100644 --- a/Zend/tests/concat/bug81705.phpt +++ b/Zend/tests/concat/bug81705.phpt @@ -16,4 +16,4 @@ var_dump($my_var); ?> --EXPECT-- error -string(6) "aArray" \ No newline at end of file +string(6) "aArray" diff --git a/Zend/tests/constant_arrays.phpt b/Zend/tests/constant_arrays.phpt index eecc76847545..0c0db6a55f69 100644 --- a/Zend/tests/constant_arrays.phpt +++ b/Zend/tests/constant_arrays.phpt @@ -34,7 +34,7 @@ $recursive[0] = &$recursive; try { define('RECURSION', $recursive); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- @@ -104,4 +104,4 @@ array(1) { object(stdClass)#1 (0) { } } -define(): Argument #2 ($value) cannot be a recursive array +ValueError: define(): Argument #2 ($value) cannot be a recursive array diff --git a/Zend/tests/constants/008.phpt b/Zend/tests/constants/008.phpt index 14e074e5d30a..c863c26d85c9 100644 --- a/Zend/tests/constants/008.phpt +++ b/Zend/tests/constants/008.phpt @@ -6,7 +6,7 @@ define() tests try { var_dump(define(array(1,2,3,4,5), 1)); } catch (TypeError $e) { - echo "TypeError: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(define("TRUE", 1)); diff --git a/Zend/tests/constants/018.phpt b/Zend/tests/constants/018.phpt index f348c2b556cb..622711452f3f 100644 --- a/Zend/tests/constants/018.phpt +++ b/Zend/tests/constants/018.phpt @@ -6,7 +6,7 @@ constant() tests try { var_dump(constant("")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } define("TEST_CONST", 1); @@ -18,7 +18,7 @@ var_dump(constant("TEST_CONST2")); echo "Done\n"; ?> --EXPECT-- -Undefined constant "" +Error: Undefined constant "" int(1) string(4) "test" Done diff --git a/Zend/tests/constants/bug44827.phpt b/Zend/tests/constants/bug44827.phpt index 8e51087480bd..22ed2821ceb5 100644 --- a/Zend/tests/constants/bug44827.phpt +++ b/Zend/tests/constants/bug44827.phpt @@ -6,16 +6,16 @@ Bug #44827 (define() allows :: in constant names) try { define('foo::bar', 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { define('::', 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -define(): Argument #1 ($constant_name) cannot be a class constant -define(): Argument #1 ($constant_name) cannot be a class constant +ValueError: define(): Argument #1 ($constant_name) cannot be a class constant +ValueError: define(): Argument #1 ($constant_name) cannot be a class constant diff --git a/Zend/tests/constants/bug51791.phpt b/Zend/tests/constants/bug51791.phpt index 7675cb564d26..7a7cf49ecea0 100644 --- a/Zend/tests/constants/bug51791.phpt +++ b/Zend/tests/constants/bug51791.phpt @@ -9,9 +9,9 @@ class A { try { constant('A::B1'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant A::B1 +Error: Undefined constant A::B1 diff --git a/Zend/tests/constants/dynamic_class_const_fetch.phpt b/Zend/tests/constants/dynamic_class_const_fetch.phpt index 1924536b964e..ae97fdfeaf93 100644 --- a/Zend/tests/constants/dynamic_class_const_fetch.phpt +++ b/Zend/tests/constants/dynamic_class_const_fetch.phpt @@ -11,7 +11,7 @@ function test($code) { try { var_dump(eval($code)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -46,19 +46,19 @@ string(3) "bar" string(3) "bar" Warning: Undefined variable $barr in %s : eval()'d code on line %d -Cannot use value of type null as class constant name +TypeError: Cannot use value of type null as class constant name Warning: Undefined variable $barr in %s : eval()'d code on line %d -Cannot use value of type null as class constant name +TypeError: Cannot use value of type null as class constant name string(3) "bar" string(3) "bar" string(3) "Foo" string(3) "Foo" -Cannot use value of type int as class constant name -Cannot use value of type int as class constant name -Cannot use value of type int as class constant name -Cannot use value of type int as class constant name -Cannot use value of type array as class constant name -Cannot use value of type array as class constant name -Cannot use value of type array as class constant name -Cannot use value of type array as class constant name +TypeError: Cannot use value of type int as class constant name +TypeError: Cannot use value of type int as class constant name +TypeError: Cannot use value of type int as class constant name +TypeError: Cannot use value of type int as class constant name +TypeError: Cannot use value of type array as class constant name +TypeError: Cannot use value of type array as class constant name +TypeError: Cannot use value of type array as class constant name +TypeError: Cannot use value of type array as class constant name diff --git a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt index 4003c7db928c..5f2ce5340390 100644 --- a/Zend/tests/constants/dynamic_class_const_fetch_order.phpt +++ b/Zend/tests/constants/dynamic_class_const_fetch_order.phpt @@ -21,7 +21,7 @@ function test($c) { try { echo $c(), "\n"; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -32,6 +32,6 @@ test(fn() => Foo::{bar()}::{foo()}); --EXPECT-- foo() bar() -Undefined constant Foo::BAR +Error: Undefined constant Foo::BAR bar() -Undefined constant Foo::BAR +Error: Undefined constant Foo::BAR diff --git a/Zend/tests/constants/gh10709.phpt b/Zend/tests/constants/gh10709.phpt index f394e1a7882d..02268032a837 100644 --- a/Zend/tests/constants/gh10709.phpt +++ b/Zend/tests/constants/gh10709.phpt @@ -13,7 +13,7 @@ spl_autoload_register(function ($class) { try { new B(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/constants/gh10709_2.phpt b/Zend/tests/constants/gh10709_2.phpt index 723fa29cc94b..3caa800035ab 100644 --- a/Zend/tests/constants/gh10709_2.phpt +++ b/Zend/tests/constants/gh10709_2.phpt @@ -15,7 +15,7 @@ spl_autoload_register(function ($class) { try { var_dump(new B()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt index 88c20f10cf62..8aa7ccfad0cd 100644 --- a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt +++ b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt @@ -5,10 +5,10 @@ Constant Expressions with unsupported operands 002 try { require("constant_expressions_exceptions.inc"); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } ?> DONE --EXPECTF-- -Exception: Unsupported operand types: array - array in %s on line %d +TypeError: Unsupported operand types: array - array in %s on line %d DONE diff --git a/Zend/tests/constexpr/gh7771_3.phpt b/Zend/tests/constexpr/gh7771_3.phpt index e44a01a8aec7..582058310255 100644 --- a/Zend/tests/constexpr/gh7771_3.phpt +++ b/Zend/tests/constexpr/gh7771_3.phpt @@ -13,4 +13,3 @@ var_dump(D::HW); ?> --EXPECTF-- Fatal error: Constant expression contains invalid operations in %sgh7771_3.php(7) : eval()'d code on line 1 - diff --git a/Zend/tests/constexpr/new.phpt b/Zend/tests/constexpr/new.phpt index 79bbc41f69b5..468d762c8d97 100644 --- a/Zend/tests/constexpr/new.phpt +++ b/Zend/tests/constexpr/new.phpt @@ -6,7 +6,7 @@ new in constant expressions try { eval('static $a = new DoesNotExist;'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } static $b = new stdClass; @@ -15,7 +15,7 @@ var_dump($b); try { eval('static $c = new stdClass([] + 0);'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Test { @@ -25,7 +25,7 @@ class Test { try { eval('static $d = new Test(new stdClass, [] + 0);'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } static $e = new Test(new stdClass, 42); @@ -41,16 +41,16 @@ class Test2 { try { eval('static $f = new Test2();'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "DoesNotExist" not found +Error: Class "DoesNotExist" not found object(stdClass)#2 (0) { } -Unsupported operand types: array + int -Unsupported operand types: array + int +TypeError: Unsupported operand types: array + int +TypeError: Unsupported operand types: array + int object(Test)#4 (2) { ["a"]=> object(stdClass)#1 (0) { @@ -59,4 +59,4 @@ object(Test)#4 (2) { int(42) } Side-effect -Failed to construct +Exception: Failed to construct diff --git a/Zend/tests/constexpr/new_named_params.phpt b/Zend/tests/constexpr/new_named_params.phpt index 6b57088f60fe..79ee83983c6b 100644 --- a/Zend/tests/constexpr/new_named_params.phpt +++ b/Zend/tests/constexpr/new_named_params.phpt @@ -19,7 +19,7 @@ var_dump($c); try { eval('static $d = new Vec(x: 0.0, x: 1.0);'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -48,4 +48,4 @@ object(Vec)#3 (3) { ["z"]=> float(1) } -Named parameter $x overwrites previous argument +Error: Named parameter $x overwrites previous argument diff --git a/Zend/tests/constexpr/new_self_parent.phpt b/Zend/tests/constexpr/new_self_parent.phpt index b134f77a498e..65eb1a5c1bbb 100644 --- a/Zend/tests/constexpr/new_self_parent.phpt +++ b/Zend/tests/constexpr/new_self_parent.phpt @@ -20,13 +20,13 @@ B::method(); try { invalid(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { B::invalid(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -35,5 +35,5 @@ object(B)#1 (0) { } object(A)#2 (0) { } -Cannot access "self" when no class scope is active -Cannot access "parent" when current class scope has no parent +Error: Cannot access "self" when no class scope is active +Error: Cannot access "parent" when current class scope has no parent diff --git a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt index 206f99fd4094..890dd38632c1 100644 --- a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt +++ b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt @@ -13,9 +13,9 @@ $point = new Point(1, 2, 3); try { $point->x = "foo"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign string to property Point::$x of type int +TypeError: Cannot assign string to property Point::$x of type int diff --git a/Zend/tests/div_002.phpt b/Zend/tests/div_002.phpt index 22ed3f139338..3dcfda24301b 100644 --- a/Zend/tests/div_002.phpt +++ b/Zend/tests/div_002.phpt @@ -9,7 +9,7 @@ $b = array(1); try { var_dump($a / $b); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a / $b; @@ -18,7 +18,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array / array +TypeError: Unsupported operand types: array / array Fatal error: Uncaught TypeError: Unsupported operand types: array / array in %s:%d Stack trace: diff --git a/Zend/tests/div_by_zero_compound_refcounted.phpt b/Zend/tests/div_by_zero_compound_refcounted.phpt index 7f0f59622b44..bdac57623ef3 100644 --- a/Zend/tests/div_by_zero_compound_refcounted.phpt +++ b/Zend/tests/div_by_zero_compound_refcounted.phpt @@ -7,10 +7,10 @@ $h .= "2"; try { $h /= 0; } catch (DivisionByZeroError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($h); ?> --EXPECT-- -Division by zero +DivisionByZeroError: Division by zero string(2) "12" diff --git a/Zend/tests/div_by_zero_compound_with_conversion.phpt b/Zend/tests/div_by_zero_compound_with_conversion.phpt index ba391328169f..bbb6b15c18c8 100644 --- a/Zend/tests/div_by_zero_compound_with_conversion.phpt +++ b/Zend/tests/div_by_zero_compound_with_conversion.phpt @@ -6,9 +6,9 @@ $x = 42; try { $$x /= 0; } catch (DivisionByZeroError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $42 in %s on line %d -Division by zero +DivisionByZeroError: Division by zero diff --git a/Zend/tests/dynamic_call/bug48770_2.phpt b/Zend/tests/dynamic_call/bug48770_2.phpt index 14fe28cca23e..59c78afde767 100644 --- a/Zend/tests/dynamic_call/bug48770_2.phpt +++ b/Zend/tests/dynamic_call/bug48770_2.phpt @@ -26,13 +26,13 @@ class B extends A { try { call_user_func_array(array($this, 'parent::func22'), array($str)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { call_user_func_array(array($this, 'parent::inexistent'), array($str)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } private function func2($str) { @@ -61,7 +61,7 @@ Deprecated: Callables of the form ["C", "parent::func3"] are deprecated in %s on string(27) "B::func3: This should work!" Deprecated: Callables of the form ["C", "parent::func22"] are deprecated in %s on line %d -call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22() +TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method B::func22() Deprecated: Callables of the form ["C", "parent::inexistent"] are deprecated in %s on line %d -call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent" +TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class B does not have a method "inexistent" diff --git a/Zend/tests/dynamic_call/bug48770_3.phpt b/Zend/tests/dynamic_call/bug48770_3.phpt index 98311eb8ece6..ac7fb0a2566a 100644 --- a/Zend/tests/dynamic_call/bug48770_3.phpt +++ b/Zend/tests/dynamic_call/bug48770_3.phpt @@ -23,7 +23,7 @@ class B extends A { try { call_user_func_array(array($this, 'self::inexistent'), array($str)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } private function func2($str) { @@ -52,4 +52,4 @@ Deprecated: Callables of the form ["C", "self::func3"] are deprecated in %s on l string(27) "B::func3: This should work!" Deprecated: Callables of the form ["C", "self::inexistent"] are deprecated in %s on line %d -call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent" +TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, class C does not have a method "inexistent" diff --git a/Zend/tests/dynamic_call/bug68475.phpt b/Zend/tests/dynamic_call/bug68475.phpt index fef8173fc643..42e194e6ef55 100644 --- a/Zend/tests/dynamic_call/bug68475.phpt +++ b/Zend/tests/dynamic_call/bug68475.phpt @@ -37,7 +37,7 @@ $callback = 'TestClass::undefinedMethod'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Reference undefined class. @@ -45,7 +45,7 @@ $callback = 'UndefinedClass::testMethod'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -53,5 +53,5 @@ Static method called! Static method called! Static method called with args: arg1, arg2, arg3 Static method called with args: arg1, arg2, arg3 -Call to undefined method TestClass::undefinedMethod() -Class "UndefinedClass" not found +Error: Call to undefined method TestClass::undefinedMethod() +Error: Class "UndefinedClass" not found diff --git a/Zend/tests/dynamic_call/bug77877.phpt b/Zend/tests/dynamic_call/bug77877.phpt index 6ed35213efb2..9c32424de1c2 100644 --- a/Zend/tests/dynamic_call/bug77877.phpt +++ b/Zend/tests/dynamic_call/bug77877.phpt @@ -10,14 +10,14 @@ class Foo { try { array_map([new Foo, 'bar'],[1]); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func([new Foo, 'bar']); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Using $this when not in object context -Using $this when not in object context +Error: Using $this when not in object context +Error: Using $this when not in object context diff --git a/Zend/tests/dynamic_call/dynamic_call_005.phpt b/Zend/tests/dynamic_call/dynamic_call_005.phpt index 91d1cb914c12..e0411683ee04 100644 --- a/Zend/tests/dynamic_call/dynamic_call_005.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_005.phpt @@ -10,27 +10,27 @@ function test_calls($func) { array_map($func, [['i' => new stdClass]]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func(['i' => new stdClass]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func($func, ['i' => new stdClass]); var_dump($i); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test_calls('extract'); ?> --EXPECT-- -Cannot call extract() dynamically -Cannot call extract() dynamically -Cannot call extract() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call extract() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_006.phpt b/Zend/tests/dynamic_call/dynamic_call_006.phpt index e6ea71915854..cfb17729b75f 100644 --- a/Zend/tests/dynamic_call/dynamic_call_006.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_006.phpt @@ -8,51 +8,51 @@ function test() { $func = 'extract'; $func(['a' => 'b']); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'compact'; $func(['a']); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'get_defined_vars'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_get_args'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_get_arg'; $func(1); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $func = 'func_num_args'; $func(); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(); ?> --EXPECT-- -Cannot call extract() dynamically -Cannot call compact() dynamically -Cannot call get_defined_vars() dynamically -Cannot call func_get_args() dynamically -Cannot call func_get_arg() dynamically -Cannot call func_num_args() dynamically +Error: Cannot call extract() dynamically +Error: Cannot call compact() dynamically +Error: Cannot call get_defined_vars() dynamically +Error: Cannot call func_get_args() dynamically +Error: Cannot call func_get_arg() dynamically +Error: Cannot call func_num_args() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_007.phpt b/Zend/tests/dynamic_call/dynamic_call_007.phpt index f1312b95b47a..484a3322bf90 100644 --- a/Zend/tests/dynamic_call/dynamic_call_007.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_007.phpt @@ -8,7 +8,7 @@ function test() { try { array_map('extract', [['i' => new stdClass]]); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $i += 1; var_dump($i); @@ -17,5 +17,5 @@ test(); ?> --EXPECT-- -Cannot call extract() dynamically +Error: Cannot call extract() dynamically int(2) diff --git a/Zend/tests/dynamic_call/dynamic_call_008.phpt b/Zend/tests/dynamic_call/dynamic_call_008.phpt index 1916bcf91345..f2a0e6c4d578 100644 --- a/Zend/tests/dynamic_call/dynamic_call_008.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_008.phpt @@ -7,11 +7,11 @@ function test() { try { ((string) 'extract')(['a' => 42]); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(); ?> --EXPECT-- -Cannot call extract() dynamically +Error: Cannot call extract() dynamically diff --git a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt index 1bba3ebf6be1..185ab33629b3 100644 --- a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt @@ -7,22 +7,22 @@ try { $bar = "bar"; ("foo" . $bar)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $bar = ["bar"]; (["foo"] + $bar)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (new stdClass)(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function foobar() -Array callback must have exactly two elements -Object of type stdClass is not callable +Error: Call to undefined function foobar() +Error: Array callback must have exactly two elements +Error: Object of type stdClass is not callable diff --git a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt index f73d29a131d6..0f521d3273ac 100644 --- a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt +++ b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt @@ -17,14 +17,14 @@ $x = new Foo; try { $x->test1(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x->test2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Non-static method Foo::bar() cannot be called statically -Non-static method Foo::bar() cannot be called statically +Error: Non-static method Foo::bar() cannot be called statically +Error: Non-static method Foo::bar() cannot be called statically diff --git a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt index cca6fa38b6c3..e709485a578c 100644 --- a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt +++ b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt @@ -7,9 +7,9 @@ namespace Foo; try { ('\bar')(); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function bar() +Error: Call to undefined function bar() diff --git a/Zend/tests/dynamic_prop_deprecation_002.phpt b/Zend/tests/dynamic_prop_deprecation_002.phpt index bd0d3aa5a7df..980bbef7d8dd 100644 --- a/Zend/tests/dynamic_prop_deprecation_002.phpt +++ b/Zend/tests/dynamic_prop_deprecation_002.phpt @@ -10,9 +10,9 @@ $a = new class{}; try { [&$a->y]; } catch (Throwable $ex) { - echo "Exception: " .$ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- Err: Creation of dynamic property class@anonymous::$y is deprecated -Exception: Cannot create dynamic property class@anonymous::$y +Error: Cannot create dynamic property class@anonymous::$y diff --git a/Zend/tests/enum/ast-dumper.phpt b/Zend/tests/enum/ast-dumper.phpt index 7972fe64965e..f7ff1f8d7c36 100644 --- a/Zend/tests/enum/ast-dumper.phpt +++ b/Zend/tests/enum/ast-dumper.phpt @@ -23,12 +23,12 @@ try { return false; })()); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert((function () { +AssertionError: assert((function () { enum Foo { case Bar; } diff --git a/Zend/tests/enum/backed-duplicate-int.phpt b/Zend/tests/enum/backed-duplicate-int.phpt index fb64ff29322e..4eade51093a5 100644 --- a/Zend/tests/enum/backed-duplicate-int.phpt +++ b/Zend/tests/enum/backed-duplicate-int.phpt @@ -11,30 +11,30 @@ enum Foo: int { try { var_dump(Foo::Bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::Bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::tryFrom('bar')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Duplicate value in enum Foo for cases Bar and Baz -Duplicate value in enum Foo for cases Bar and Baz -Duplicate value in enum Foo for cases Bar and Baz -Foo::tryFrom(): Argument #1 ($value) must be of type int, string given +Error: Duplicate value in enum Foo for cases Bar and Baz +Error: Duplicate value in enum Foo for cases Bar and Baz +Error: Duplicate value in enum Foo for cases Bar and Baz +TypeError: Foo::tryFrom(): Argument #1 ($value) must be of type int, string given diff --git a/Zend/tests/enum/backed-duplicate-string.phpt b/Zend/tests/enum/backed-duplicate-string.phpt index 22224ada35a3..24d76debb794 100644 --- a/Zend/tests/enum/backed-duplicate-string.phpt +++ b/Zend/tests/enum/backed-duplicate-string.phpt @@ -13,30 +13,30 @@ enum Suit: string { try { var_dump(Suit::Hearts); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::Hearts); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Suit::tryFrom('bar')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades -Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades +Error: Duplicate value in enum Suit for cases Hearts and Spades diff --git a/Zend/tests/enum/backed-from-invalid-int.phpt b/Zend/tests/enum/backed-from-invalid-int.phpt index d40cae30e6c8..d6c48b9f74f4 100644 --- a/Zend/tests/enum/backed-from-invalid-int.phpt +++ b/Zend/tests/enum/backed-from-invalid-int.phpt @@ -11,9 +11,9 @@ enum Foo: int { try { var_dump(Foo::from(2)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -2 is not a valid backing value for enum Foo +ValueError: 2 is not a valid backing value for enum Foo diff --git a/Zend/tests/enum/backed-from-invalid-string.phpt b/Zend/tests/enum/backed-from-invalid-string.phpt index c6d784872ef0..4c27d75d2ac1 100644 --- a/Zend/tests/enum/backed-from-invalid-string.phpt +++ b/Zend/tests/enum/backed-from-invalid-string.phpt @@ -13,9 +13,9 @@ enum Suit: string { try { var_dump(Suit::from('A')); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -"A" is not a valid backing value for enum Suit +ValueError: "A" is not a valid backing value for enum Suit diff --git a/Zend/tests/enum/backed-from-invalid-type.phpt b/Zend/tests/enum/backed-from-invalid-type.phpt index b4e0e6d6164f..9928f262b15b 100644 --- a/Zend/tests/enum/backed-from-invalid-type.phpt +++ b/Zend/tests/enum/backed-from-invalid-type.phpt @@ -13,7 +13,7 @@ enum Suit: string { try { var_dump(Suit::from(42)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } enum Foo: int { @@ -24,11 +24,11 @@ enum Foo: int { try { var_dump(Foo::from('H')); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -"42" is not a valid backing value for enum Suit -Foo::from(): Argument #1 ($value) must be of type int, string given +ValueError: "42" is not a valid backing value for enum Suit +TypeError: Foo::from(): Argument #1 ($value) must be of type int, string given diff --git a/Zend/tests/enum/backed-mismatch.phpt b/Zend/tests/enum/backed-mismatch.phpt index 73602f7b15b4..d02953016b1d 100644 --- a/Zend/tests/enum/backed-mismatch.phpt +++ b/Zend/tests/enum/backed-mismatch.phpt @@ -10,25 +10,25 @@ enum Foo: int { try { var_dump(Foo::Bar); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::Bar); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from(42)); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::from('bar')); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/enum/enum-as-params.phpt b/Zend/tests/enum/enum-as-params.phpt index 90a1f0b5d07f..a06804d04631 100644 --- a/Zend/tests/enum/enum-as-params.phpt +++ b/Zend/tests/enum/enum-as-params.phpt @@ -20,16 +20,16 @@ takesBaz(Baz::Qux); try { takesBaz(Foo::Bar); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { takesFoo(Baz::Qux); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d -takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d +TypeError: takesBaz(): Argument #1 ($baz) must be of type Baz, Foo given, called in %s on line %d +TypeError: takesFoo(): Argument #1 ($foo) must be of type Foo, Baz given, called in %s on line %d diff --git a/Zend/tests/enum/internal_enums.phpt b/Zend/tests/enum/internal_enums.phpt index ae26e24cd7ea..d642b9e9764f 100644 --- a/Zend/tests/enum/internal_enums.phpt +++ b/Zend/tests/enum/internal_enums.phpt @@ -34,7 +34,7 @@ function test_int_enum(int|string $case) { try { var_dump(ZendTestIntEnum::from($case)); } catch (\Error $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(ZendTestIntEnum::tryFrom($case)); } diff --git a/Zend/tests/enum/internal_enums_strict_types.phpt b/Zend/tests/enum/internal_enums_strict_types.phpt index 3d5ea231a271..183c87b26cca 100644 --- a/Zend/tests/enum/internal_enums_strict_types.phpt +++ b/Zend/tests/enum/internal_enums_strict_types.phpt @@ -12,17 +12,17 @@ var_dump(ZendTestStringEnum::from("Test2")); try { var_dump(ZendTestStringEnum::from(42)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ZendTestStringEnum::tryFrom(43)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- enum(ZendTestStringEnum::Bar) -ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given -ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given +TypeError: ZendTestStringEnum::from(): Argument #1 ($value) must be of type string, int given +TypeError: ZendTestStringEnum::tryFrom(): Argument #1 ($value) must be of type string, int given diff --git a/Zend/tests/enum/json_encode.phpt b/Zend/tests/enum/json_encode.phpt index f1174db7ae8e..ef59b63ccf65 100644 --- a/Zend/tests/enum/json_encode.phpt +++ b/Zend/tests/enum/json_encode.phpt @@ -35,7 +35,7 @@ function test($value) { var_dump(json_encode($value, JSON_THROW_ON_ERROR)); echo json_last_error_msg() . "\n"; } catch (Exception $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/enum/no-clone-internal.phpt b/Zend/tests/enum/no-clone-internal.phpt index 84b7ee2634d2..58d9aba276a8 100644 --- a/Zend/tests/enum/no-clone-internal.phpt +++ b/Zend/tests/enum/no-clone-internal.phpt @@ -8,9 +8,9 @@ zend_test try { var_dump(clone ZendTestIntEnum::Foo); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class ZendTestIntEnum +Error: Trying to clone an uncloneable object of class ZendTestIntEnum diff --git a/Zend/tests/enum/no-clone.phpt b/Zend/tests/enum/no-clone.phpt index 2fadbb26b720..806ab0ae49ee 100644 --- a/Zend/tests/enum/no-clone.phpt +++ b/Zend/tests/enum/no-clone.phpt @@ -10,9 +10,9 @@ enum Foo { try { var_dump(clone Foo::Bar); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class Foo +Error: Trying to clone an uncloneable object of class Foo diff --git a/Zend/tests/enum/no-dynamic-properties-internal.phpt b/Zend/tests/enum/no-dynamic-properties-internal.phpt index 8d821a5f6292..8a3328e3ecd3 100644 --- a/Zend/tests/enum/no-dynamic-properties-internal.phpt +++ b/Zend/tests/enum/no-dynamic-properties-internal.phpt @@ -10,9 +10,9 @@ $bar = ZendTestUnitEnum::Bar; try { $bar->baz = 'Baz'; } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot create dynamic property ZendTestUnitEnum::$baz +Error: Cannot create dynamic property ZendTestUnitEnum::$baz diff --git a/Zend/tests/enum/no-dynamic-properties.phpt b/Zend/tests/enum/no-dynamic-properties.phpt index 83d0d441b458..88938c7eac8f 100644 --- a/Zend/tests/enum/no-dynamic-properties.phpt +++ b/Zend/tests/enum/no-dynamic-properties.phpt @@ -12,9 +12,9 @@ $bar = Foo::Bar; try { $bar->baz = 'Baz'; } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot create dynamic property Foo::$baz +Error: Cannot create dynamic property Foo::$baz diff --git a/Zend/tests/enum/no-new-through-reflection.phpt b/Zend/tests/enum/no-new-through-reflection.phpt index 9a92559cd3d6..7807e2cb388f 100644 --- a/Zend/tests/enum/no-new-through-reflection.phpt +++ b/Zend/tests/enum/no-new-through-reflection.phpt @@ -8,9 +8,9 @@ enum Foo {} try { (new \ReflectionClass(Foo::class))->newInstanceWithoutConstructor(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate enum Foo +Error: Cannot instantiate enum Foo diff --git a/Zend/tests/enum/no-new.phpt b/Zend/tests/enum/no-new.phpt index 698e9548827f..2abf4c9d8f9d 100644 --- a/Zend/tests/enum/no-new.phpt +++ b/Zend/tests/enum/no-new.phpt @@ -8,9 +8,9 @@ enum Foo {} try { new Foo(); } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot instantiate enum Foo +Error: Cannot instantiate enum Foo diff --git a/Zend/tests/enum/no-pass-properties-by-ref.phpt b/Zend/tests/enum/no-pass-properties-by-ref.phpt index 21c3a41e9352..1d5d34f45c57 100644 --- a/Zend/tests/enum/no-pass-properties-by-ref.phpt +++ b/Zend/tests/enum/no-pass-properties-by-ref.phpt @@ -15,12 +15,12 @@ try { $bar = Foo::Bar; $value = setBarValueByRef($bar->value, 1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-return-properties-by-ref.phpt b/Zend/tests/enum/no-return-properties-by-ref.phpt index ea68e7a585cc..117eb1a7a119 100644 --- a/Zend/tests/enum/no-return-properties-by-ref.phpt +++ b/Zend/tests/enum/no-return-properties-by-ref.phpt @@ -16,12 +16,12 @@ try { $value = &getBarValueByRef(); $value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-unset-propertes.phpt b/Zend/tests/enum/no-unset-propertes.phpt index 867c853afa76..49a19fbffadb 100644 --- a/Zend/tests/enum/no-unset-propertes.phpt +++ b/Zend/tests/enum/no-unset-propertes.phpt @@ -15,23 +15,23 @@ $foo = Foo::Bar; try { unset($foo->name); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $intFoo = IntFoo::Bar; try { unset($intFoo->name); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($intFoo->value); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset readonly property Foo::$name -Cannot unset readonly property IntFoo::$name -Cannot unset readonly property IntFoo::$value +Error: Cannot unset readonly property Foo::$name +Error: Cannot unset readonly property IntFoo::$name +Error: Cannot unset readonly property IntFoo::$value diff --git a/Zend/tests/enum/no-write-properties-cache-slot.phpt b/Zend/tests/enum/no-write-properties-cache-slot.phpt index d59268b6912e..cb1c6bad5a9f 100644 --- a/Zend/tests/enum/no-write-properties-cache-slot.phpt +++ b/Zend/tests/enum/no-write-properties-cache-slot.phpt @@ -16,12 +16,12 @@ enum Test { try { Test::A->modify(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Test::A->name); ?> --EXPECT-- string(1) "A" -Cannot modify readonly property Test::$name +Error: Cannot modify readonly property Test::$name string(1) "A" diff --git a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt index b02f49932904..f8507117f5be 100644 --- a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt +++ b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt @@ -11,12 +11,12 @@ try { $bar = Foo::Bar; foreach ([1] as &$bar->value) {} } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-write-properties-through-references.phpt b/Zend/tests/enum/no-write-properties-through-references.phpt index 17bd57b82ea2..0ba34e6c04a3 100644 --- a/Zend/tests/enum/no-write-properties-through-references.phpt +++ b/Zend/tests/enum/no-write-properties-through-references.phpt @@ -12,12 +12,12 @@ try { $value = &$bar->value; $value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$value +Error: Cannot indirectly modify readonly property Foo::$value int(0) diff --git a/Zend/tests/enum/no-write-properties.phpt b/Zend/tests/enum/no-write-properties.phpt index e0022cfffe76..6eb80460f254 100644 --- a/Zend/tests/enum/no-write-properties.phpt +++ b/Zend/tests/enum/no-write-properties.phpt @@ -15,35 +15,35 @@ $bar = Foo::Bar; try { $bar->name = 'Baz'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $bar->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $intBar = IntFoo::Bar; try { $intBar->name = 'Baz'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $intBar->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $intBar->value2 = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$name -Cannot create dynamic property Foo::$value -Cannot modify readonly property IntFoo::$name -Cannot modify readonly property IntFoo::$value -Cannot create dynamic property IntFoo::$value2 +Error: Cannot modify readonly property Foo::$name +Error: Cannot create dynamic property Foo::$value +Error: Cannot modify readonly property IntFoo::$name +Error: Cannot modify readonly property IntFoo::$value +Error: Cannot create dynamic property IntFoo::$value2 diff --git a/Zend/tests/errmsg/bug43344_1.phpt b/Zend/tests/errmsg/bug43344_1.phpt index d517373d9f17..a8413f04afd2 100644 --- a/Zend/tests/errmsg/bug43344_1.phpt +++ b/Zend/tests/errmsg/bug43344_1.phpt @@ -19,27 +19,27 @@ function f3($a=array(bar=>0)) { try { echo bar."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f1()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f2()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo f3()."\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" -Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" +Error: Undefined constant "Foo\bar" diff --git a/Zend/tests/errmsg/errmsg_020.phpt b/Zend/tests/errmsg/errmsg_020.phpt index 4a7c326d0531..ea9429561aac 100644 --- a/Zend/tests/errmsg/errmsg_020.phpt +++ b/Zend/tests/errmsg/errmsg_020.phpt @@ -8,9 +8,9 @@ disable_functions=phpinfo try { phpinfo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function phpinfo() +Error: Call to undefined function phpinfo() diff --git a/Zend/tests/error_reporting/bug72162.phpt b/Zend/tests/error_reporting/bug72162.phpt index 721b0fc30680..570e17522f21 100644 --- a/Zend/tests/error_reporting/bug72162.phpt +++ b/Zend/tests/error_reporting/bug72162.phpt @@ -8,8 +8,8 @@ $var11 = new StdClass(); try { $var16 = error_reporting($var11); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given +TypeError: error_reporting(): Argument #1 ($error_level) must be of type ?int, stdClass given diff --git a/Zend/tests/eval_constant_resolution.phpt b/Zend/tests/eval_constant_resolution.phpt index d302d50a2c05..44bbe4b24bcd 100644 --- a/Zend/tests/eval_constant_resolution.phpt +++ b/Zend/tests/eval_constant_resolution.phpt @@ -20,4 +20,4 @@ Outside eval bool(true) bool(true) string(4) "test" -bool(true) \ No newline at end of file +bool(true) diff --git a/Zend/tests/exception_set_previous_leak.phpt b/Zend/tests/exception_set_previous_leak.phpt index 7fb680f95168..6208b45503c4 100644 --- a/Zend/tests/exception_set_previous_leak.phpt +++ b/Zend/tests/exception_set_previous_leak.phpt @@ -12,9 +12,9 @@ try { throw $e; } } catch (Exception $e2) { - echo $e2->getMessage(), "\n"; + echo $e2::class, ': ', $e2->getMessage(), "\n"; } ?> --EXPECT-- -Test +Exception: Test diff --git a/Zend/tests/exception_stream_wrapper.phpt b/Zend/tests/exception_stream_wrapper.phpt index 4de8274fe0c1..7f81fc7f9fb6 100644 --- a/Zend/tests/exception_stream_wrapper.phpt +++ b/Zend/tests/exception_stream_wrapper.phpt @@ -21,7 +21,7 @@ stream_wrapper_register('abc', 'Loader'); try { require 'abc://'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -29,4 +29,4 @@ try { stream_set_option stream_stat stream_read -Message +Exception: Message diff --git a/Zend/tests/exceptions/bug26698.phpt b/Zend/tests/exceptions/bug26698.phpt index 8155f2090595..cf5e149ab9a7 100644 --- a/Zend/tests/exceptions/bug26698.phpt +++ b/Zend/tests/exceptions/bug26698.phpt @@ -26,7 +26,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -39,7 +39,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -52,7 +52,7 @@ class Proxy } catch(Exception $e) { - echo 'Caught: '.$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -64,6 +64,6 @@ $p->callTwo(); $p->callThree(); ?> --EXPECT-- -Caught: NONE -Caught: NONE -Caught: NONE +Exception: NONE +Exception: NONE +Exception: NONE diff --git a/Zend/tests/exceptions/bug31102.phpt b/Zend/tests/exceptions/bug31102.phpt index 17beec6ba389..e82a2af8b564 100644 --- a/Zend/tests/exceptions/bug31102.phpt +++ b/Zend/tests/exceptions/bug31102.phpt @@ -31,16 +31,16 @@ while($test++ < 5) } catch (Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> ===DONE=== --EXPECTF-- {closure:%s:%d}(Test1,1) -Caught: Test1::__construct +Exception: Test1::__construct {closure:%s:%d}(Test2,2) -Caught: {closure:%s:%d} +Exception: {closure:%s:%d} {closure:%s:%d}(Test3,3) Fatal error: Uncaught Error: Class "Test3" not found in %s:%d diff --git a/Zend/tests/exceptions/bug47771.phpt b/Zend/tests/exceptions/bug47771.phpt index c4350b9d95d3..b1792b0f3c97 100644 --- a/Zend/tests/exceptions/bug47771.phpt +++ b/Zend/tests/exceptions/bug47771.phpt @@ -23,7 +23,7 @@ try { $T =new Test(throw_exc()); } catch( Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/Zend/tests/exceptions/bug48428.phpt b/Zend/tests/exceptions/bug48428.phpt index 0cda84dea4ee..b40a30ccb5e0 100644 --- a/Zend/tests/exceptions/bug48428.phpt +++ b/Zend/tests/exceptions/bug48428.phpt @@ -6,8 +6,8 @@ try { function x() { throw new Exception("ERROR"); } x(x()); } catch(Exception $e) { - echo($e -> getMessage()); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ERROR +Exception: ERROR diff --git a/Zend/tests/exceptions/bug50383.phpt b/Zend/tests/exceptions/bug50383.phpt index 2f72ea51f853..2d5b8ddeca5c 100644 --- a/Zend/tests/exceptions/bug50383.phpt +++ b/Zend/tests/exceptions/bug50383.phpt @@ -23,20 +23,20 @@ function thrower2() { try { thrower(); } catch(Exception $e) { - print $e->getMessage(); + echo $e::class, ': ', $e->getMessage(); print_r($e->getTrace()); } try { thrower2(); } catch (Exception $e) { - print $e->getMessage(); + echo $e::class, ': ', $e->getMessage(); print_r($e->getTrace()); } ?> --EXPECTF-- -Missing static method 'ThrowException' +Exception: Missing static method 'ThrowException' Array ( [0] => Array @@ -69,7 +69,7 @@ Array ) ) -Missing method 'foo' +Exception: Missing method 'foo' Array ( [0] => Array diff --git a/Zend/tests/exceptions/bug53511.phpt b/Zend/tests/exceptions/bug53511.phpt index b07504506a94..caa9f7fc7696 100644 --- a/Zend/tests/exceptions/bug53511.phpt +++ b/Zend/tests/exceptions/bug53511.phpt @@ -13,7 +13,7 @@ function test() { try { throw new Exception("ops 2"); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/Zend/tests/exceptions/bug54043.phpt b/Zend/tests/exceptions/bug54043.phpt index c6e08b75f9ee..e8e487f36840 100644 --- a/Zend/tests/exceptions/bug54043.phpt +++ b/Zend/tests/exceptions/bug54043.phpt @@ -9,12 +9,12 @@ $timeZone = new DateTimeZone('UTC'); try { $dateTime = new DateTime($time, $timeZone); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(error_get_last()); ?> --EXPECT-- -string(80) "Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character" +DateMalformedStringException: Failed to parse time string (9999-11-33) at position 9 (3): Unexpected character NULL diff --git a/Zend/tests/exceptions/bug60569.phpt b/Zend/tests/exceptions/bug60569.phpt index ef3bea8edb78..20af436a72c7 100644 --- a/Zend/tests/exceptions/bug60569.phpt +++ b/Zend/tests/exceptions/bug60569.phpt @@ -6,9 +6,10 @@ try { $msg = "Some error \x00 message"; throw new Exception($msg); } catch(Exception $e) { - var_dump($e->getMessage(), $msg); + echo $e::class, ': ', $e->getMessage(), "\n"; + var_dump($msg); } ?> --EXPECTF-- -string(20) "Some error %0 message" +Exception: Some error %0 message string(20) "Some error %0 message" diff --git a/Zend/tests/exceptions/exception_001.phpt b/Zend/tests/exceptions/exception_001.phpt index aba29d4aa3ee..0f0cd52702e9 100644 --- a/Zend/tests/exceptions/exception_001.phpt +++ b/Zend/tests/exceptions/exception_001.phpt @@ -9,28 +9,28 @@ try { try { throw new Exception(); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; throw $e; } ?> --EXPECTF-- -string(0) "" -string(0) "" -string(0) "" -string(0) "" +Exception: +Exception: +Exception: +Exception: Fatal error: Uncaught Exception in %s:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_013.phpt b/Zend/tests/exceptions/exception_013.phpt index 93d85761764b..20358f5a3e1e 100644 --- a/Zend/tests/exceptions/exception_013.phpt +++ b/Zend/tests/exceptions/exception_013.phpt @@ -9,29 +9,27 @@ class C { try { var_dump(C::$a); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } try { var_dump(C::$p); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } try { unset(C::$a); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } var_dump(C::$a); ?> --EXPECTF-- -Exception: Access to undeclared static property C::$a in %s on line %d - -Exception: Cannot access private property C::$p in %sexception_013.php on line 13 - -Exception: Attempt to unset static property C::$a in %sexception_013.php on line 19 +Error: Access to undeclared static property C::$a in %s on line %d +Error: Cannot access private property C::$p in %sexception_013.php on line 13 +Error: Attempt to unset static property C::$a in %sexception_013.php on line 19 Fatal error: Uncaught Error: Access to undeclared static property C::$a in %s:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_014.phpt b/Zend/tests/exceptions/exception_014.phpt index aaf411dae56c..fb9e26ae2135 100644 --- a/Zend/tests/exceptions/exception_014.phpt +++ b/Zend/tests/exceptions/exception_014.phpt @@ -10,13 +10,13 @@ $x = new C; try { var_dump($x->p); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } var_dump($x->p); ?> --EXPECTF-- -Exception: Cannot access private property C::$p in %sexception_014.php on line %d +Error: Cannot access private property C::$p in %sexception_014.php on line %d Fatal error: Uncaught Error: Cannot access private property C::$p in %sexception_014.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_015.phpt b/Zend/tests/exceptions/exception_015.phpt index a2b27154f657..8ca146054e04 100644 --- a/Zend/tests/exceptions/exception_015.phpt +++ b/Zend/tests/exceptions/exception_015.phpt @@ -6,13 +6,13 @@ $s = "ABC"; try { $s[] = "D"; } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } $s[] = "D"; ?> --EXPECTF-- -Exception: [] operator not supported for strings in %sexception_015.php on line %d +Error: [] operator not supported for strings in %sexception_015.php on line %d Fatal error: Uncaught Error: [] operator not supported for strings in %sexception_015.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_016.phpt b/Zend/tests/exceptions/exception_016.phpt index 5b52cf72cd7a..6b572c8eb37f 100644 --- a/Zend/tests/exceptions/exception_016.phpt +++ b/Zend/tests/exceptions/exception_016.phpt @@ -5,13 +5,13 @@ Exceptions on improper usage of $this try { $this->foo(); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } $this->foo(); ?> --EXPECTF-- -Exception: Using $this when not in object context in %sexception_016.php on line %d +Error: Using $this when not in object context in %sexception_016.php on line %d Fatal error: Uncaught Error: Using $this when not in object context in %sexception_016.php:%d Stack trace: diff --git a/Zend/tests/exceptions/exception_before_fatal.phpt b/Zend/tests/exceptions/exception_before_fatal.phpt index edc63b2394cd..cd0c2d518a8a 100644 --- a/Zend/tests/exceptions/exception_before_fatal.phpt +++ b/Zend/tests/exceptions/exception_before_fatal.phpt @@ -11,38 +11,38 @@ set_error_handler("exception_error_handler"); try { $foo->a(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new $foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw $foo; } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo::b(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = clone $foo; } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } class b { @@ -51,14 +51,14 @@ class b { try { b::$foo(); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" -string(23) "Undefined variable $foo" +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo +Exception: Undefined variable $foo diff --git a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt index 5732e8cc5af7..dac064e5b364 100644 --- a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt +++ b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt @@ -15,9 +15,9 @@ $y = 5; try { $test->x =& $y; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foobar +Exception: Foobar diff --git a/Zend/tests/exceptions/exception_during_include_stat.phpt b/Zend/tests/exceptions/exception_during_include_stat.phpt index 62747384e713..5b9fd071eea7 100644 --- a/Zend/tests/exceptions/exception_during_include_stat.phpt +++ b/Zend/tests/exceptions/exception_during_include_stat.phpt @@ -16,27 +16,27 @@ set_include_path('test://foo:test://bar'); try { require_once 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { require 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { include_once 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { include 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stat failed -stat failed -stat failed -stat failed +Exception: stat failed +Exception: stat failed +Exception: stat failed +Exception: stat failed diff --git a/Zend/tests/exceptions/exception_from_toString.phpt b/Zend/tests/exceptions/exception_from_toString.phpt index dd4de341caf2..66b6e4bc6928 100644 --- a/Zend/tests/exceptions/exception_from_toString.phpt +++ b/Zend/tests/exceptions/exception_from_toString.phpt @@ -14,78 +14,78 @@ $num = 42; $badStr = new BadStr; try { $x = $str . $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $badStr . $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $str .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); try { $x = $num . $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $badStr . $num; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = $num .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($num); try { $x = $badStr .= $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($badStr); try { $x = $badStr .= $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($badStr); try { $x = "x$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$badStr}x"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "$str$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "$badStr$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "x$badStr$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "x$str$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$str}x$badStr"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = "{$badStr}x$str"; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = (string) $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = include $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ${""} = 42; try { unset(${$badStr}); } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(${""}); unset(${""}); try { $x = ${$badStr}; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { $x = isset(${$badStr}); } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = new stdClass; try { $x = $obj->{$badStr} = $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($obj); try { $str[0] = $badStr; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); $obj = new DateInterval('P1D'); try { $x = $obj->{$badStr} = $str; } -catch (Exception $e) { echo $e->getMessage(), "\n"; } +catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(!isset($obj->{""})); try { strlen($badStr); } catch (Exception $e) { echo "Exception\n"; } @@ -94,41 +94,41 @@ try { new ArrayObject([], 0, $badStr); } catch (Exception $e) { echo "Exception\ ?> --EXPECT-- -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception string(1) "a" -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception int(42) -Exception +Exception: Exception object(BadStr)#1 (0) { } -Exception +Exception: Exception object(BadStr)#1 (0) { } -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception +Exception: Exception int(42) -Exception -Exception -Exception +Exception: Exception +Exception: Exception +Exception: Exception object(stdClass)#2 (0) { } -Exception +Exception: Exception string(1) "a" -Exception +Exception: Exception bool(true) Exception Exception diff --git a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt index a9f9e77a59d9..e6d0246a9ebd 100644 --- a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt +++ b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt @@ -6,15 +6,15 @@ exception handler tests - 4 try { set_exception_handler("fo"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { set_exception_handler(array("", "")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name -set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found +TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, function "fo" not found or invalid function name +TypeError: set_exception_handler(): Argument #1 ($callback) must be a valid callback or null, class "" not found diff --git a/Zend/tests/exit/die_string_cast_exception.phpt b/Zend/tests/exit/die_string_cast_exception.phpt index c20a873939df..9b84beacb1f4 100644 --- a/Zend/tests/exit/die_string_cast_exception.phpt +++ b/Zend/tests/exit/die_string_cast_exception.phpt @@ -6,9 +6,9 @@ Bug #79777: String cast exception during die should be handled gracefully try { die(new stdClass); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -exit(): Argument #1 ($status) must be of type string|int, stdClass given +TypeError: exit(): Argument #1 ($status) must be of type string|int, stdClass given diff --git a/Zend/tests/exit_finally_2.phpt b/Zend/tests/exit_finally_2.phpt index 0a3f5dc7a1d1..d8a977edb680 100644 --- a/Zend/tests/exit_finally_2.phpt +++ b/Zend/tests/exit_finally_2.phpt @@ -15,7 +15,7 @@ try { } echo "Not executed\n"; } catch (Exception $e) { - echo "Caught {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/fe_fetch_dtor_exception.phpt b/Zend/tests/fe_fetch_dtor_exception.phpt index 99378e739a8b..362c0e65cfbc 100644 --- a/Zend/tests/fe_fetch_dtor_exception.phpt +++ b/Zend/tests/fe_fetch_dtor_exception.phpt @@ -14,9 +14,9 @@ try { var_dump($v); } } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -foo +Exception: foo diff --git a/Zend/tests/fe_fetch_op2_live_range.phpt b/Zend/tests/fe_fetch_op2_live_range.phpt index c601e43120e0..1c1df1f279c7 100644 --- a/Zend/tests/fe_fetch_op2_live_range.phpt +++ b/Zend/tests/fe_fetch_op2_live_range.phpt @@ -5,8 +5,8 @@ FE_FETCH op2 is a def and needs special live range handling try { foreach (["test"] as $k => func()[]) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function func() +Error: Call to undefined function func() diff --git a/Zend/tests/fibers/catch.phpt b/Zend/tests/fibers/catch.phpt index 92c139ca1b4d..45ef21348c0a 100644 --- a/Zend/tests/fibers/catch.phpt +++ b/Zend/tests/fibers/catch.phpt @@ -7,7 +7,7 @@ $fiber = new Fiber(function () { try { Fiber::suspend('test'); } catch (Exception $exception) { - var_dump($exception->getMessage()); + echo $exception::class, ': ', $exception->getMessage(), "\n"; } }); @@ -19,4 +19,4 @@ $fiber->throw(new Exception('test')); ?> --EXPECT-- string(4) "test" -string(4) "test" +Exception: test diff --git a/Zend/tests/fibers/fiber-error-construct.phpt b/Zend/tests/fibers/fiber-error-construct.phpt index 8af23ff86ebd..4b3ac43b7689 100644 --- a/Zend/tests/fibers/fiber-error-construct.phpt +++ b/Zend/tests/fibers/fiber-error-construct.phpt @@ -6,9 +6,9 @@ FiberError cannot be constructed in user code try { new FiberError; } catch (Error $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -The "FiberError" class is reserved for internal use and cannot be manually instantiated +Error: The "FiberError" class is reserved for internal use and cannot be manually instantiated diff --git a/Zend/tests/fibers/get-return-after-throwing.phpt b/Zend/tests/fibers/get-return-after-throwing.phpt index 620f74e3239c..4d401a898ea6 100644 --- a/Zend/tests/fibers/get-return-after-throwing.phpt +++ b/Zend/tests/fibers/get-return-after-throwing.phpt @@ -8,14 +8,14 @@ $fiber = new Fiber(fn() => throw new Exception('test')); try { $fiber->start(); } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $fiber->getReturn(); ?> --EXPECTF-- -test +Exception: test Fatal error: Uncaught FiberError: Cannot get fiber return value: The fiber threw an exception in %sget-return-after-throwing.php:%d Stack trace: diff --git a/Zend/tests/fibers/gh10249.phpt b/Zend/tests/fibers/gh10249.phpt index efbef9c42a2e..ae8b1ddee966 100644 --- a/Zend/tests/fibers/gh10249.phpt +++ b/Zend/tests/fibers/gh10249.phpt @@ -9,9 +9,9 @@ $fiber = new Fiber($callback); try { $fiber->start(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Fiber stack size is too small, it needs to be at least %d bytes +Exception: Fiber stack size is too small, it needs to be at least %d bytes diff --git a/Zend/tests/fibers/gh20483.phpt b/Zend/tests/fibers/gh20483.phpt index e06cf87258ea..c87263c171ab 100644 --- a/Zend/tests/fibers/gh20483.phpt +++ b/Zend/tests/fibers/gh20483.phpt @@ -9,8 +9,8 @@ $fiber = new Fiber($callback); try { $fiber->start(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Fiber stack size is too small, it needs to be at least %d bytes +Exception: Fiber stack size is too small, it needs to be at least %d bytes diff --git a/Zend/tests/fibers/negative_stack_size.phpt b/Zend/tests/fibers/negative_stack_size.phpt index 591a8f28878d..c75686b89186 100644 --- a/Zend/tests/fibers/negative_stack_size.phpt +++ b/Zend/tests/fibers/negative_stack_size.phpt @@ -7,7 +7,7 @@ $fiber = new Fiber(function() {}); try { $fiber->start(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE diff --git a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt index dfde978ce06b..cdbc7e443a8a 100644 --- a/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt +++ b/Zend/tests/fibers/suspend-in-force-close-fiber-catching-exception.phpt @@ -16,12 +16,12 @@ try { $fiber->start(); })(); } catch (FiberError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- -Cannot suspend in a force-closed fiber +FiberError: Cannot suspend in a force-closed fiber done diff --git a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt index f1b17caeb5d7..90e4f0c218df 100644 --- a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt +++ b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt @@ -20,7 +20,7 @@ $fiber = new Fiber(function (): void { throw new \Exception("finally exception"); } } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } finally { echo "outer finally\n"; } @@ -28,7 +28,7 @@ $fiber = new Fiber(function (): void { try { echo Fiber::suspend(); } catch (FiberError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } }); @@ -42,7 +42,7 @@ echo "done\n"; --EXPECT-- fiber inner finally -finally exception +Exception: finally exception outer finally -Cannot suspend in a force-closed fiber +FiberError: Cannot suspend in a force-closed fiber done diff --git a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt index 2916c3dfff86..7eee426439b5 100644 --- a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt +++ b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt @@ -12,7 +12,7 @@ try { function () { } ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -22,12 +22,12 @@ try { class {} ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(!#[Attr(strrev(...))] function () { +AssertionError: assert(!#[Attr(strrev(...))] function () { }) -assert(!new #[Attr(strrev(...))] class { +AssertionError: assert(!new #[Attr(strrev(...))] class { }) diff --git a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt index 97831a8d65f0..438fe6af8956 100644 --- a/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt +++ b/Zend/tests/first_class_callable/constexpr/error_static_call_trait_method_002.phpt @@ -22,10 +22,10 @@ function foo(Closure $c = Foo::myMethod(...)) { try { foo(); } catch (ErrorException $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Caught: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait +ErrorException: Calling static trait method Foo::myMethod is deprecated, it should only be called on a class using the trait diff --git a/Zend/tests/first_class_callable/first_class_callable_015.phpt b/Zend/tests/first_class_callable/first_class_callable_015.phpt index 72e1d413dd70..f83540f3f28c 100644 --- a/Zend/tests/first_class_callable/first_class_callable_015.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_015.phpt @@ -15,10 +15,10 @@ do_weak_call($fn); try { do_strict_call($fn); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- int(42) -test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d +TypeError: test(): Argument #1 ($i) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/first_class_callable/first_class_callable_assert.phpt b/Zend/tests/first_class_callable/first_class_callable_assert.phpt index 2bf3d9fc69e2..2888da2447f3 100644 --- a/Zend/tests/first_class_callable/first_class_callable_assert.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_assert.phpt @@ -10,16 +10,16 @@ $assert(1 == 1.0, "Message 1"); try { $assert(1 == 2.0, "Message 2"); } catch (\AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(false && strlen(...)); } catch (\AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Message 2 -assert(false && strlen(...)) +AssertionError: Message 2 +AssertionError: assert(false && strlen(...)) diff --git a/Zend/tests/first_class_callable/first_class_callable_errors.phpt b/Zend/tests/first_class_callable/first_class_callable_errors.phpt index dffcd779f361..337a13b1e39b 100644 --- a/Zend/tests/first_class_callable/first_class_callable_errors.phpt +++ b/Zend/tests/first_class_callable/first_class_callable_errors.phpt @@ -13,45 +13,45 @@ try { $fn = 123; $fn(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { does_not_exist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stdClass::doesNotExist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (new stdClass)->doesNotExist(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { [new stdClass, 'doesNotExist'](...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::privateMethod(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::instanceMethod(...); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Value of type int is not callable -Call to undefined function does_not_exist() -Call to undefined method stdClass::doesNotExist() -Call to undefined method stdClass::doesNotExist() -Call to undefined method stdClass::doesNotExist() -Call to private method Test::privateMethod() from global scope -Non-static method Test::instanceMethod() cannot be called statically +Error: Value of type int is not callable +Error: Call to undefined function does_not_exist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to undefined method stdClass::doesNotExist() +Error: Call to private method Test::privateMethod() from global scope +Error: Non-static method Test::instanceMethod() cannot be called statically diff --git a/Zend/tests/foreach/foreach_003.phpt b/Zend/tests/foreach/foreach_003.phpt index 3ecb96de7951..c1678872921b 100644 --- a/Zend/tests/foreach/foreach_003.phpt +++ b/Zend/tests/foreach/foreach_003.phpt @@ -31,7 +31,7 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) { // IS_CV foreach ($obj as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($obj); @@ -39,33 +39,33 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) { // IS_VAR foreach (new IT(3, $trap) as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // IS_TMP_VAR foreach ((object)new IT(2, $trap) as $key => $val) echo "$val\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -rewind -rewind -rewind -valid -valid -valid -key -key -key -current -current -current +Exception: rewind +Exception: rewind +Exception: rewind +Exception: valid +Exception: valid +Exception: valid +Exception: key +Exception: key +Exception: key +Exception: current +Exception: current +Exception: current 0 -next +Exception: next 0 -next +Exception: next 0 -next +Exception: next diff --git a/Zend/tests/frameless_undefined_var.phpt b/Zend/tests/frameless_undefined_var.phpt index e9c5aac58236..0c40ff38f0c7 100644 --- a/Zend/tests/frameless_undefined_var.phpt +++ b/Zend/tests/frameless_undefined_var.phpt @@ -11,8 +11,8 @@ function test() { try { test(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $foo +Exception: Undefined variable $foo diff --git a/Zend/tests/func_arg_fetch_optimization.phpt b/Zend/tests/func_arg_fetch_optimization.phpt index ba01d8f7dee9..745064e20b07 100644 --- a/Zend/tests/func_arg_fetch_optimization.phpt +++ b/Zend/tests/func_arg_fetch_optimization.phpt @@ -8,8 +8,8 @@ function test($x) { try { test([]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use [] for reading +Error: Cannot use [] for reading diff --git a/Zend/tests/func_get_arg_basic.phpt b/Zend/tests/func_get_arg_basic.phpt index ec06a5c20f4d..8491f2bde81f 100644 --- a/Zend/tests/func_get_arg_basic.phpt +++ b/Zend/tests/func_get_arg_basic.phpt @@ -7,18 +7,18 @@ function test1() { try { var_dump(func_get_arg(-10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -26,12 +26,12 @@ function test2($a) { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -39,17 +39,17 @@ function test3($a, $b) { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(2)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -59,7 +59,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -67,7 +67,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -76,12 +76,12 @@ class test { try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -90,32 +90,32 @@ test::test1(1); try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 int(10) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function int(1) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected int(1) int(2) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected int(1) int(2) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function int(1) -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function -func_get_arg() cannot be called from the global scope +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +Error: func_get_arg() cannot be called from the global scope Done diff --git a/Zend/tests/func_get_arg_invalid.phpt b/Zend/tests/func_get_arg_invalid.phpt index 13e0443c07f6..4d4c996733c0 100644 --- a/Zend/tests/func_get_arg_invalid.phpt +++ b/Zend/tests/func_get_arg_invalid.phpt @@ -6,7 +6,7 @@ func_get_arg() invalid usage try { var_dump(func_get_arg(1)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } function bar() { @@ -20,10 +20,10 @@ function foo() { try { foo(1,2); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -func_get_arg() cannot be called from the global scope -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +Error: func_get_arg() cannot be called from the global scope +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function diff --git a/Zend/tests/func_get_args.phpt b/Zend/tests/func_get_args.phpt index 33cfdb02ebcd..806333c2f9a6 100644 --- a/Zend/tests/func_get_args.phpt +++ b/Zend/tests/func_get_args.phpt @@ -6,9 +6,9 @@ Testing func_get_args() throws error when called from the global scope try { func_get_args(); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -func_get_args() cannot be called from the global scope +Error: func_get_args() cannot be called from the global scope diff --git a/Zend/tests/func_get_args_basic.phpt b/Zend/tests/func_get_args_basic.phpt index 54ddf1b40c92..03c217839cbd 100644 --- a/Zend/tests/func_get_args_basic.phpt +++ b/Zend/tests/func_get_args_basic.phpt @@ -21,7 +21,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -29,7 +29,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -44,7 +44,7 @@ test::test1(1); try { var_dump(func_get_args()); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -59,7 +59,7 @@ array(1) { [0]=> int(1) } -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected array(2) { [0]=> int(1) @@ -68,7 +68,7 @@ array(2) { } array(0) { } -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected array(2) { [0]=> int(1) @@ -79,4 +79,4 @@ array(1) { [0]=> int(1) } -func_get_args() cannot be called from the global scope +Error: func_get_args() cannot be called from the global scope diff --git a/Zend/tests/func_num_args_basic.phpt b/Zend/tests/func_num_args_basic.phpt index 0e27b48d6501..afca294bc770 100644 --- a/Zend/tests/func_num_args_basic.phpt +++ b/Zend/tests/func_num_args_basic.phpt @@ -20,7 +20,7 @@ test2(1); try { test2(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } test3(1,2); @@ -29,7 +29,7 @@ call_user_func("test1"); try { call_user_func("test3", 1); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } call_user_func("test3", 1, 2); @@ -44,7 +44,7 @@ test::test1(1); try { func_num_args(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -52,11 +52,11 @@ echo "Done\n"; --EXPECTF-- int(0) int(1) -Exception: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function test2(), 0 passed in %s on line %d and exactly 1 expected int(2) int(0) -Exception: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected +ArgumentCountError: Too few arguments to function test3(), 1 passed in %s on line %d and exactly 2 expected int(2) int(1) -func_num_args() must be called from a function context +Error: func_num_args() must be called from a function context Done diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt index d23a6a0c7057..1bf9e030bfcc 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt @@ -5,8 +5,8 @@ Call internal function with incorrect number of arguments try { substr("foo"); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -substr() expects at least 2 arguments, 1 given +ArgumentCountError: substr() expects at least 2 arguments, 1 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt index 2b809cdb731a..2268ad854049 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt @@ -6,19 +6,15 @@ declare(strict_types=1); try { substr("foo"); } catch (ArgumentCountError $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { array_diff(); } catch (ArgumentCountError $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ArgumentCountError -substr() expects at least 2 arguments, 1 given -ArgumentCountError -array_diff() expects at least 1 argument, 0 given +ArgumentCountError: substr() expects at least 2 arguments, 1 given +ArgumentCountError: array_diff() expects at least 1 argument, 0 given diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt index db9be6d85140..c29424c09bc8 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt @@ -6,16 +6,14 @@ try { function foo($bar) { } foo(); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { function bar($foo, $bar) { } bar(1); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } function bat(int $foo, string $bar) { } @@ -23,23 +21,17 @@ function bat(int $foo, string $bar) { } try { bat(123); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bat("123"); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ArgumentCountError -Too few arguments to function foo(), 0 passed in %s and exactly 1 expected -ArgumentCountError -Too few arguments to function bar(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected +ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected diff --git a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt index 2a67a9ce4c6b..2953dc57de83 100644 --- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt +++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt @@ -7,16 +7,14 @@ try { function foo($bar) { } foo(); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { function bar($foo, $bar) { } bar(1); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } function bat(int $foo, string $bar) { } @@ -24,32 +22,24 @@ function bat(int $foo, string $bar) { } try { bat(123); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bat("123"); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bat(123, 456); } catch (\Error $e) { - echo get_class($e) . PHP_EOL; - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ArgumentCountError -Too few arguments to function foo(), 0 passed in %s and exactly 1 expected -ArgumentCountError -Too few arguments to function bar(), 1 passed in %s and exactly 2 expected -ArgumentCountError -Too few arguments to function bat(), 1 passed in %s and exactly 2 expected -TypeError -bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d -TypeError -bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d +ArgumentCountError: Too few arguments to function foo(), 0 passed in %s and exactly 1 expected +ArgumentCountError: Too few arguments to function bar(), 1 passed in %s and exactly 2 expected +ArgumentCountError: Too few arguments to function bat(), 1 passed in %s and exactly 2 expected +TypeError: bat(): Argument #1 ($foo) must be of type int, string given, called in %s on line %d +TypeError: bat(): Argument #2 ($bar) must be of type string, int given, called in %s on line %d diff --git a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt index 1a6dc97dd2e4..bd6bedca1dd5 100644 --- a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt +++ b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt @@ -15,7 +15,7 @@ try { test('foo', 'bar', 'baz'); echo 'Not reached'; } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; $testFrame = $e->getTrace()[0]; var_dump($testFrame['function']); var_dump(count($testFrame['args'])); @@ -37,7 +37,7 @@ try { test2('foo', 'variadic1', 'variadic2', 'variadic3'); echo 'Not reached'; } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; $testFrame = $e->getTrace()[0]; var_dump($testFrame['function']); var_dump(count($testFrame['args'])); @@ -53,14 +53,14 @@ try { ?> --EXPECTF-- -Error +Exception: Error string(4) "test" int(3) string(3) "foo" string(3) "bar" string(3) "baz" Success -Error 2 +Exception: Error 2 string(5) "test2" int(4) string(3) "foo" diff --git a/Zend/tests/function_arguments/variadic_argument_type_error.phpt b/Zend/tests/function_arguments/variadic_argument_type_error.phpt index 9041aadcadfd..a7b06d363a77 100644 --- a/Zend/tests/function_arguments/variadic_argument_type_error.phpt +++ b/Zend/tests/function_arguments/variadic_argument_type_error.phpt @@ -8,16 +8,16 @@ function foo($foo, int ...$bar) {} try { foo(1, []); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { foo(1, 1, 1, []); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- -foo(): Argument #2 must be of type int, array given, called in %s on line %d -foo(): Argument #4 must be of type int, array given, called in %s on line %d +TypeError: foo(): Argument #2 must be of type int, array given, called in %s on line %d +TypeError: foo(): Argument #4 must be of type int, array given, called in %s on line %d diff --git a/Zend/tests/gc/bug54305.phpt b/Zend/tests/gc/bug54305.phpt index 61e351306f78..1cbb5fc2ef25 100644 --- a/Zend/tests/gc/bug54305.phpt +++ b/Zend/tests/gc/bug54305.phpt @@ -12,8 +12,8 @@ $methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs'); try { echo $methodWithArgs++; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot increment ReflectionMethod +TypeError: Cannot increment ReflectionMethod diff --git a/Zend/tests/gc/bug80072.phpt b/Zend/tests/gc/bug80072.phpt index d7bf1956cf60..bbf1543ad5ed 100644 --- a/Zend/tests/gc/bug80072.phpt +++ b/Zend/tests/gc/bug80072.phpt @@ -7,11 +7,11 @@ try { $s = 'O:8:"stdClass":1:{s:1:"x";r:1;}'; unserialize($s) % gc_collect_cycles(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $a[]=&$a == $a=&$b > gc_collect_cycles(); ?> --EXPECT-- -Unsupported operand types: stdClass % int +TypeError: Unsupported operand types: stdClass % int diff --git a/Zend/tests/generators/bug79927.phpt b/Zend/tests/generators/bug79927.phpt index df8f245ddfde..dbebd77d70fc 100644 --- a/Zend/tests/generators/bug79927.phpt +++ b/Zend/tests/generators/bug79927.phpt @@ -12,7 +12,7 @@ $generator->next(); try { $generator->rewind(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $generator->current(), "\n"; @@ -26,6 +26,6 @@ echo $generator2->current(), "\n"; ?> --EXPECT-- -Cannot rewind a generator that was already run +Exception: Cannot rewind a generator that was already run 3 4 diff --git a/Zend/tests/generators/clone.phpt b/Zend/tests/generators/clone.phpt index 748b826365cc..dbe252e92274 100644 --- a/Zend/tests/generators/clone.phpt +++ b/Zend/tests/generators/clone.phpt @@ -12,7 +12,7 @@ try { $gen = gen(); clone $gen; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/generators/dynamic_properties.phpt b/Zend/tests/generators/dynamic_properties.phpt index 08ceb7f581c6..2e40239b0acc 100644 --- a/Zend/tests/generators/dynamic_properties.phpt +++ b/Zend/tests/generators/dynamic_properties.phpt @@ -11,9 +11,9 @@ $gen = gen(); try { $gen->prop = new stdClass; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property Generator::$prop +Error: Cannot create dynamic property Generator::$prop diff --git a/Zend/tests/generators/errors/count_error.phpt b/Zend/tests/generators/errors/count_error.phpt index 03ca1eed6032..060c41899761 100644 --- a/Zend/tests/generators/errors/count_error.phpt +++ b/Zend/tests/generators/errors/count_error.phpt @@ -10,9 +10,9 @@ $gen = gen(); try { count($gen); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -count(): Argument #1 ($value) must be of type Countable|array, Generator given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, Generator given diff --git a/Zend/tests/generators/errors/resume_running_generator_error.phpt b/Zend/tests/generators/errors/resume_running_generator_error.phpt index 53e8611cf36c..46db7548266e 100644 --- a/Zend/tests/generators/errors/resume_running_generator_error.phpt +++ b/Zend/tests/generators/errors/resume_running_generator_error.phpt @@ -8,7 +8,7 @@ function gen() { try { $gen->next(); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $gen->next(); } @@ -19,7 +19,7 @@ $gen->next(); ?> --EXPECTF-- -Exception: Cannot resume an already running generator +Error: Cannot resume an already running generator Fatal error: Uncaught Error: Cannot resume an already running generator in %s:%d Stack trace: diff --git a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt index e71e32a886dc..0b58864cf42e 100644 --- a/Zend/tests/generators/errors/resume_running_generator_error_002.phpt +++ b/Zend/tests/generators/errors/resume_running_generator_error_002.phpt @@ -10,8 +10,8 @@ $gen = gen(); try { $gen->send($gen); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot resume an already running generator +Error: Cannot resume an already running generator diff --git a/Zend/tests/generators/generator_throwing_during_function_call.phpt b/Zend/tests/generators/generator_throwing_during_function_call.phpt index bd0d2448b7d8..0ac335acf8f6 100644 --- a/Zend/tests/generators/generator_throwing_during_function_call.phpt +++ b/Zend/tests/generators/generator_throwing_during_function_call.phpt @@ -20,7 +20,7 @@ var_dump($gen->current()); try { $gen->next(); } catch (Exception $e) { - echo 'Caught exception with message "', $e->getMessage(), '"', "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($gen->current()); @@ -28,5 +28,5 @@ var_dump($gen->current()); ?> --EXPECT-- string(3) "foo" -Caught exception with message "test" +Exception: test NULL diff --git a/Zend/tests/generators/generator_throwing_exception.phpt b/Zend/tests/generators/generator_throwing_exception.phpt index f537c3fc7726..a984bb0e7031 100644 --- a/Zend/tests/generators/generator_throwing_exception.phpt +++ b/Zend/tests/generators/generator_throwing_exception.phpt @@ -16,7 +16,7 @@ var_dump($gen->current()); try { $gen->next(); } catch (Exception $e) { - echo 'Caught exception with message "', $e->getMessage(), '"', "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($gen->current()); @@ -24,5 +24,5 @@ var_dump($gen->current()); ?> --EXPECT-- string(3) "foo" -Caught exception with message "test" +Exception: test NULL diff --git a/Zend/tests/generators/generator_with_type_check_2.phpt b/Zend/tests/generators/generator_with_type_check_2.phpt index 21e8ab8bedc0..5e8c928f8d94 100644 --- a/Zend/tests/generators/generator_with_type_check_2.phpt +++ b/Zend/tests/generators/generator_with_type_check_2.phpt @@ -6,7 +6,7 @@ function gen(array $a) { yield; } try { gen(42); } catch (TypeError $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -14,9 +14,9 @@ try { var_dump($val); } } catch (TypeError $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d -gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d +TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d +TypeError: gen(): Argument #1 ($a) must be of type array, int given, called in %s on line %d diff --git a/Zend/tests/generators/get_return_and_finally.phpt b/Zend/tests/generators/get_return_and_finally.phpt index 150e5b83c4db..902d2e857642 100644 --- a/Zend/tests/generators/get_return_and_finally.phpt +++ b/Zend/tests/generators/get_return_and_finally.phpt @@ -31,17 +31,17 @@ try { // during auto-priming, so fails var_dump($gen->getReturn()); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // This fails, because the return value was discarded var_dump($gen->getReturn()); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(42) -gen2() throw -Cannot get return value of a generator that hasn't returned +Exception: gen2() throw +Exception: Cannot get return value of a generator that hasn't returned diff --git a/Zend/tests/generators/get_return_errors.phpt b/Zend/tests/generators/get_return_errors.phpt index f8d50aa3ded2..59c0792ca168 100644 --- a/Zend/tests/generators/get_return_errors.phpt +++ b/Zend/tests/generators/get_return_errors.phpt @@ -14,7 +14,7 @@ try { // Generator hasn't reached the "return" yet $gen->getReturn(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function gen2() { @@ -27,13 +27,13 @@ $gen = gen2(); try { $gen->next(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // Generator has been aborted as a result of an exception $gen->getReturn(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function gen3() { @@ -47,7 +47,7 @@ try { // Generator throws during auto-priming of getReturn() call $gen->getReturn(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function gen4() { @@ -59,21 +59,21 @@ $gen = gen4(); try { $gen->throw(new Exception("gen4() throw")); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // Generator has been aborted as a result of an exception // that was injected using throw() $gen->getReturn(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot get return value of a generator that hasn't returned -gen2() throw -Cannot get return value of a generator that hasn't returned -gen3() throw -gen4() throw -Cannot get return value of a generator that hasn't returned +Exception: Cannot get return value of a generator that hasn't returned +Exception: gen2() throw +Exception: Cannot get return value of a generator that hasn't returned +Exception: gen3() throw +Exception: gen4() throw +Exception: Cannot get return value of a generator that hasn't returned diff --git a/Zend/tests/generators/gh11028_1.phpt b/Zend/tests/generators/gh11028_1.phpt index e1e7aa5019e5..98227ed07e15 100644 --- a/Zend/tests/generators/gh11028_1.phpt +++ b/Zend/tests/generators/gh11028_1.phpt @@ -15,7 +15,7 @@ function test($msg, $x) { try { var_dump([...generator($x)]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -26,10 +26,10 @@ test("object", new stdClass); ?> --EXPECT-- yield null -Keys must be of type int|string during array unpacking +Error: Keys must be of type int|string during array unpacking yield false -Keys must be of type int|string during array unpacking +Error: Keys must be of type int|string during array unpacking yield true -Keys must be of type int|string during array unpacking +Error: Keys must be of type int|string during array unpacking yield object -Keys must be of type int|string during array unpacking +Error: Keys must be of type int|string during array unpacking diff --git a/Zend/tests/generators/gh11028_3.phpt b/Zend/tests/generators/gh11028_3.phpt index 7ea1aac6f6cf..de9158d75e11 100644 --- a/Zend/tests/generators/gh11028_3.phpt +++ b/Zend/tests/generators/gh11028_3.phpt @@ -14,8 +14,8 @@ function generator() { try { var_dump([...generator()]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -exception +Exception: exception diff --git a/Zend/tests/generators/throw_into_yield_from_array.phpt b/Zend/tests/generators/throw_into_yield_from_array.phpt index aa9fa822061b..509108f8a62a 100644 --- a/Zend/tests/generators/throw_into_yield_from_array.phpt +++ b/Zend/tests/generators/throw_into_yield_from_array.phpt @@ -20,7 +20,7 @@ function test($g) { try { $g->throw(new Exception("Exception!")); } catch (Exception $e) { - echo "{$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($g->current()); } @@ -35,9 +35,9 @@ test(yf(yielditer($data))); ?> --EXPECT-- int(1) -Exception! +Exception: Exception! NULL int(1) -Exception! +Exception: Exception! NULL diff --git a/Zend/tests/generators/yield_from_non_iterable.phpt b/Zend/tests/generators/yield_from_non_iterable.phpt index 705bcaec3511..41f0fe9e6357 100644 --- a/Zend/tests/generators/yield_from_non_iterable.phpt +++ b/Zend/tests/generators/yield_from_non_iterable.phpt @@ -10,9 +10,9 @@ function gen() { try { gen()->current(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Can use "yield from" only with arrays and Traversables +Error: Can use "yield from" only with arrays and Traversables diff --git a/Zend/tests/generators/yield_from_valid_exception.phpt b/Zend/tests/generators/yield_from_valid_exception.phpt index 0df541499cae..5bf524a67794 100644 --- a/Zend/tests/generators/yield_from_valid_exception.phpt +++ b/Zend/tests/generators/yield_from_valid_exception.phpt @@ -18,7 +18,7 @@ function gen() { // the fact that the yield from result is used is relevant. var_dump(yield from new FooBar); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -27,4 +27,4 @@ $x->current(); ?> --EXPECT-- -Exception from valid() +Exception: Exception from valid() diff --git a/Zend/tests/get_called_class_001.phpt b/Zend/tests/get_called_class_001.phpt index caa6d154d9c5..21a463cc6d8c 100644 --- a/Zend/tests/get_called_class_001.phpt +++ b/Zend/tests/get_called_class_001.phpt @@ -6,9 +6,9 @@ Calling get_called_class() outside a class try { var_dump(get_called_class()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -get_called_class() must be called from within a class +Error: get_called_class() must be called from within a class diff --git a/Zend/tests/get_class_basic.phpt b/Zend/tests/get_class_basic.phpt index f6dcbccb6916..d688f35a0008 100644 --- a/Zend/tests/get_class_basic.phpt +++ b/Zend/tests/get_class_basic.phpt @@ -12,7 +12,7 @@ class foo { try { var_dump(get_class(null)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -29,7 +29,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { $f1->bar(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(null); @@ -38,12 +38,12 @@ $f2->bar(); try { var_dump(get_class()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(get_class("qwerty")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(get_class($f1)); @@ -54,13 +54,13 @@ $f1->testNull(); echo "Done\n"; ?> --EXPECTF-- -Calling get_class() without arguments is deprecated +Exception: Calling get_class() without arguments is deprecated Deprecated: Calling get_class() without arguments is deprecated in %s on line %d string(3) "foo" -get_class() without arguments must be called from within a class -get_class(): Argument #1 ($object) must be of type object, string given +Error: get_class() without arguments must be called from within a class +TypeError: get_class(): Argument #1 ($object) must be of type object, string given string(3) "foo" string(4) "foo2" -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Done diff --git a/Zend/tests/get_class_vars/get_class_vars_001.phpt b/Zend/tests/get_class_vars/get_class_vars_001.phpt index 84f502610eca..7d2d5fbc3f9a 100644 --- a/Zend/tests/get_class_vars/get_class_vars_001.phpt +++ b/Zend/tests/get_class_vars/get_class_vars_001.phpt @@ -22,7 +22,7 @@ var_dump(get_class_vars('B')); try { get_class_vars("Unknown"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -37,4 +37,4 @@ array(2) { ["aa"]=> int(4) } -get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given +TypeError: get_class_vars(): Argument #1 ($class) must be a valid class name, Unknown given diff --git a/Zend/tests/get_parent_class_basic.phpt b/Zend/tests/get_parent_class_basic.phpt index b439fbf9fb3e..02e7a07d2765 100644 --- a/Zend/tests/get_parent_class_basic.phpt +++ b/Zend/tests/get_parent_class_basic.phpt @@ -28,7 +28,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { $foo->test(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(null); @@ -45,19 +45,19 @@ var_dump(get_parent_class("i")); try { get_parent_class(""); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { get_parent_class("[[[["); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { get_parent_class(" "); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(get_parent_class(new stdclass)); @@ -65,19 +65,19 @@ var_dump(get_parent_class(new stdclass)); try { get_parent_class(array()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { get_parent_class(1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- -Calling get_parent_class() without arguments is deprecated +Exception: Calling get_parent_class() without arguments is deprecated Deprecated: Calling get_parent_class() without arguments is deprecated in %s on line %d bool(false) @@ -90,10 +90,10 @@ bool(false) string(3) "foo" bool(false) bool(false) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given bool(false) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Done diff --git a/Zend/tests/gh10169.phpt b/Zend/tests/gh10169.phpt index 674122ac5935..32a8aca6a603 100644 --- a/Zend/tests/gh10169.phpt +++ b/Zend/tests/gh10169.phpt @@ -20,7 +20,7 @@ $a = new A(); try { $a->prop = new B(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $a = new A(); @@ -28,10 +28,10 @@ $a->prop = ''; try { $a->prop = new B(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object was released while assigning to property A::$prop -Object was released while assigning to property A::$prop +Error: Object was released while assigning to property A::$prop +Error: Object was released while assigning to property A::$prop diff --git a/Zend/tests/gh10634.phpt b/Zend/tests/gh10634.phpt index 41407bf307d7..cd36411b3792 100644 --- a/Zend/tests/gh10634.phpt +++ b/Zend/tests/gh10634.phpt @@ -6,7 +6,7 @@ function test_input($input) { try { eval($input); } catch(Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -17,8 +17,8 @@ test_input("y&# "); test_input("y&//"); ?> --EXPECT-- -string(36) "Unterminated comment starting line 1" -string(36) "Unterminated comment starting line 1" -string(36) "syntax error, unexpected end of file" -string(36) "syntax error, unexpected end of file" -string(36) "syntax error, unexpected end of file" +ParseError: Unterminated comment starting line 1 +ParseError: Unterminated comment starting line 1 +ParseError: syntax error, unexpected end of file +ParseError: syntax error, unexpected end of file +ParseError: syntax error, unexpected end of file diff --git a/Zend/tests/gh12102_1.phpt b/Zend/tests/gh12102_1.phpt index 1d548d6b28f3..30608f54275a 100644 --- a/Zend/tests/gh12102_1.phpt +++ b/Zend/tests/gh12102_1.phpt @@ -8,7 +8,7 @@ function test() { try { byRef(func_get_args()[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -27,4 +27,4 @@ test('y'); ?> --EXPECT-- string(1) "y" -Cannot use temporary expression in write context +Error: Cannot use temporary expression in write context diff --git a/Zend/tests/gh12102_3.phpt b/Zend/tests/gh12102_3.phpt index 741bce5ab1ba..fd1b5fca9d24 100644 --- a/Zend/tests/gh12102_3.phpt +++ b/Zend/tests/gh12102_3.phpt @@ -8,7 +8,7 @@ function test() { try { byRef(C[0]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -29,4 +29,4 @@ test('y'); ?> --EXPECT-- string(3) "foo" -Cannot use temporary expression in write context +Error: Cannot use temporary expression in write context diff --git a/Zend/tests/gh14969.phpt b/Zend/tests/gh14969.phpt index dedbaa7456e0..a69a739f0e37 100644 --- a/Zend/tests/gh14969.phpt +++ b/Zend/tests/gh14969.phpt @@ -20,7 +20,7 @@ $d = new D(); try { $d->prop = $c; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($d); @@ -29,18 +29,18 @@ $d->prop = 'foo'; try { $d->prop = $c; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($d); ?> --EXPECTF-- -C::__toString +Exception: C::__toString object(D)#%d (0) { ["prop"]=> uninitialized(string) } -C::__toString +Exception: C::__toString object(D)#2 (1) { ["prop"]=> string(3) "foo" diff --git a/Zend/tests/gh17162.phpt b/Zend/tests/gh17162.phpt index bdf6ddbb36ba..d945c51e0037 100644 --- a/Zend/tests/gh17162.phpt +++ b/Zend/tests/gh17162.phpt @@ -14,8 +14,8 @@ $box = [new Test]; try { getimagesize("dummy", $box); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attempt to assign property "value" on null +Error: Attempt to assign property "value" on null diff --git a/Zend/tests/gh18736.phpt b/Zend/tests/gh18736.phpt index f397ee39a310..9eefbc6fdf7c 100644 --- a/Zend/tests/gh18736.phpt +++ b/Zend/tests/gh18736.phpt @@ -16,9 +16,9 @@ try { $x = &test(); var_dump($x); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -test(): Return value must be of type int, string returned +TypeError: test(): Return value must be of type int, string returned diff --git a/Zend/tests/gh19304.phpt b/Zend/tests/gh19304.phpt index 47e20af64623..099138319ad8 100644 --- a/Zend/tests/gh19304.phpt +++ b/Zend/tests/gh19304.phpt @@ -10,9 +10,9 @@ $foo = new class { try { $foo->v = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign int to property class@anonymous::$v of type self +TypeError: Cannot assign int to property class@anonymous::$v of type self diff --git a/Zend/tests/gh19306.phpt b/Zend/tests/gh19306.phpt index e19735d94c84..9f98dd4cc6e2 100644 --- a/Zend/tests/gh19306.phpt +++ b/Zend/tests/gh19306.phpt @@ -26,7 +26,7 @@ echo "Fiber suspended\n"; try { $a->next(); } catch (Throwable $t) { - echo $t->getMessage(), "\n"; + echo $t::class, ': ', $t->getMessage(), "\n"; } echo "Destroying fiber\n"; $fiber = null; @@ -35,6 +35,6 @@ echo "Shutdown\n"; --EXPECT-- Fiber start Fiber suspended -Cannot resume an already running generator +Error: Cannot resume an already running generator Destroying fiber Shutdown diff --git a/Zend/tests/gh19326.phpt b/Zend/tests/gh19326.phpt index 335fdd382ea6..07e93c96bb37 100644 --- a/Zend/tests/gh19326.phpt +++ b/Zend/tests/gh19326.phpt @@ -26,11 +26,11 @@ $fiber->start(); try { $b->throw(new Exception('test')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $fiber->resume(); ?> --EXPECT-- -Cannot resume an already running generator +Error: Cannot resume an already running generator diff --git a/Zend/tests/gh19719.phpt b/Zend/tests/gh19719.phpt index 715e847846fe..4a09b5e57381 100644 --- a/Zend/tests/gh19719.phpt +++ b/Zend/tests/gh19719.phpt @@ -13,9 +13,9 @@ function takesInt(int $x) {} try { takesInt('42'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d +TypeError: takesInt(): Argument #1 ($x) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/gh20564.phpt b/Zend/tests/gh20564.phpt index 53311d952de7..6962c7f19bd9 100644 --- a/Zend/tests/gh20564.phpt +++ b/Zend/tests/gh20564.phpt @@ -16,9 +16,9 @@ class A { try { (new A)->test(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class "B" not found diff --git a/Zend/tests/gh418106144.phpt b/Zend/tests/gh418106144.phpt index 9357b0a179b1..e96bfe53cedf 100644 --- a/Zend/tests/gh418106144.phpt +++ b/Zend/tests/gh418106144.phpt @@ -12,9 +12,9 @@ function test($y=new Foo>''){ try { test(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foo::__toString(): Return value must be of type string, none returned +TypeError: Foo::__toString(): Return value must be of type string, none returned diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt index d0e9ddcba410..b3a6abe4da59 100644 --- a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt +++ b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt @@ -18,9 +18,9 @@ $foo = new Foo(); try { $foo->foo()->baz ??= 1; } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Hello +Exception: Hello diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt index 4115d9eae26f..363e032cd738 100644 --- a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt +++ b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt @@ -16,9 +16,9 @@ $foo = new Foo(); try { $foo->foo()->prop ??= 'foo'; } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot assign string to property Foo::$prop of type int +TypeError: Cannot assign string to property Foo::$prop of type int diff --git a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt index f2808afbf84d..bc8e4cebbb25 100644 --- a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt +++ b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt @@ -14,9 +14,9 @@ function newFoo() { try { newFoo()->prop ??= 'foo'; } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot assign string to property Foo::$prop of type int +TypeError: Cannot assign string to property Foo::$prop of type int diff --git a/Zend/tests/global_to_string_exception.phpt b/Zend/tests/global_to_string_exception.phpt index 0c55a8c3d624..02e0b5410121 100644 --- a/Zend/tests/global_to_string_exception.phpt +++ b/Zend/tests/global_to_string_exception.phpt @@ -6,9 +6,9 @@ To string conversion failure in global try { global ${new stdClass}; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/Zend/tests/illegal_offset_unset_isset_empty.phpt b/Zend/tests/illegal_offset_unset_isset_empty.phpt index ee837f0b6143..eef2dbc2e8fd 100644 --- a/Zend/tests/illegal_offset_unset_isset_empty.phpt +++ b/Zend/tests/illegal_offset_unset_isset_empty.phpt @@ -7,21 +7,21 @@ $ary = []; try { unset($ary[[]]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { isset($ary[[]]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { empty($ary[[]]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset offset of type array on array -Cannot access offset of type array in isset or empty -Cannot access offset of type array in isset or empty +TypeError: Cannot unset offset of type array on array +TypeError: Cannot access offset of type array in isset or empty +TypeError: Cannot access offset of type array in isset or empty diff --git a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt index 21b4a9b01684..358b6a2882f4 100644 --- a/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt +++ b/Zend/tests/in-de-crement/decrement_with_castable_objects_no_subtraction.phpt @@ -14,25 +14,25 @@ $nf = new NumericCastableNoOperations(58.3); try { var_dump($l - 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($f - 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($nl - 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($nf - 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* Decrement */ @@ -40,37 +40,37 @@ try { $l--; var_dump($l); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $f--; var_dump($f); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $nl--; var_dump($nl); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $nf--; var_dump($nf); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Unsupported operand types: LongCastableNoOperations - int -Unsupported operand types: FloatCastableNoOperations - int +TypeError: Unsupported operand types: LongCastableNoOperations - int +TypeError: Unsupported operand types: FloatCastableNoOperations - int int(51) float(57.3) -Cannot decrement LongCastableNoOperations -Cannot decrement FloatCastableNoOperations +TypeError: Cannot decrement LongCastableNoOperations +TypeError: Cannot decrement FloatCastableNoOperations int(51) float(57.3) diff --git a/Zend/tests/in-de-crement/incdec_bool_exception.phpt b/Zend/tests/in-de-crement/incdec_bool_exception.phpt index f819af1e2395..82f161daf700 100644 --- a/Zend/tests/in-de-crement/incdec_bool_exception.phpt +++ b/Zend/tests/in-de-crement/incdec_bool_exception.phpt @@ -12,17 +12,17 @@ foreach ($values as $value) { try { $value++; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $value--; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -Increment on type bool has no effect, this will change in the next major version of PHP -Decrement on type bool has no effect, this will change in the next major version of PHP -Increment on type bool has no effect, this will change in the next major version of PHP -Decrement on type bool has no effect, this will change in the next major version of PHP +Exception: Increment on type bool has no effect, this will change in the next major version of PHP +Exception: Decrement on type bool has no effect, this will change in the next major version of PHP +Exception: Increment on type bool has no effect, this will change in the next major version of PHP +Exception: Decrement on type bool has no effect, this will change in the next major version of PHP diff --git a/Zend/tests/in-de-crement/incdec_strings_exception.phpt b/Zend/tests/in-de-crement/incdec_strings_exception.phpt index 5acbb1041222..b1ff56978b29 100644 --- a/Zend/tests/in-de-crement/incdec_strings_exception.phpt +++ b/Zend/tests/in-de-crement/incdec_strings_exception.phpt @@ -29,47 +29,47 @@ foreach ($values as $value) { try { $value++; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($value); try { $value--; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($value); } ?> --EXPECT-- -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(0) "" -Deprecated: Decrement on empty string is deprecated as non-numeric +Exception: Deprecated: Decrement on empty string is deprecated as non-numeric string(0) "" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(1) " " -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(1) " " -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "199A" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "199A" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "A199" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "A199" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "199Z" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "199Z" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "Z199" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "Z199" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(11) "Hello world" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(11) "Hello world" -Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead +Exception: Deprecated: Increment on non-numeric string is deprecated, use str_increment() instead string(4) "🐘" -Deprecated: Decrement on non-numeric string has no effect and is deprecated +Exception: Deprecated: Decrement on non-numeric string has no effect and is deprecated string(4) "🐘" diff --git a/Zend/tests/in-de-crement/incdec_types.phpt b/Zend/tests/in-de-crement/incdec_types.phpt index 755b63957ef3..2578e4fc2638 100644 --- a/Zend/tests/in-de-crement/incdec_types.phpt +++ b/Zend/tests/in-de-crement/incdec_types.phpt @@ -10,12 +10,12 @@ foreach ($types as $type) { try { $type++; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $type--; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -40,12 +40,12 @@ foreach ($values as $value) { } ?> --EXPECTF-- -Cannot increment array -Cannot decrement array -Cannot increment stdClass -Cannot decrement stdClass -Cannot increment resource -Cannot decrement resource +TypeError: Cannot increment array +TypeError: Cannot decrement array +TypeError: Cannot increment stdClass +TypeError: Cannot decrement stdClass +TypeError: Cannot increment resource +TypeError: Cannot decrement resource Using increment: Initial value:NULL Result value:int(1) diff --git a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt index cf08055383ed..1ee98a599216 100644 --- a/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt +++ b/Zend/tests/in-de-crement/increment_with_castable_objects_no_addition.phpt @@ -14,25 +14,25 @@ $nf = new NumericCastableNoOperations(58.3); try { var_dump($l + 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($f + 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($nl + 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($nf + 1); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* Decrement */ @@ -40,37 +40,37 @@ try { $l++; var_dump($l); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $f++; var_dump($f); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $nl++; var_dump($nl); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $nf++; var_dump($nf); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Unsupported operand types: LongCastableNoOperations + int -Unsupported operand types: FloatCastableNoOperations + int +TypeError: Unsupported operand types: LongCastableNoOperations + int +TypeError: Unsupported operand types: FloatCastableNoOperations + int int(53) float(59.3) -Cannot increment LongCastableNoOperations -Cannot increment FloatCastableNoOperations +TypeError: Cannot increment LongCastableNoOperations +TypeError: Cannot increment FloatCastableNoOperations int(53) float(59.3) diff --git a/Zend/tests/in-de-crement/object_cannot_incdec.phpt b/Zend/tests/in-de-crement/object_cannot_incdec.phpt index 39a41d61dd3e..f601316bb9a9 100644 --- a/Zend/tests/in-de-crement/object_cannot_incdec.phpt +++ b/Zend/tests/in-de-crement/object_cannot_incdec.phpt @@ -8,38 +8,38 @@ $o = new Foo; try { $o++; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { $o--; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { ++$o; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { --$o; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } ?> --EXPECT-- -Cannot increment Foo +TypeError: Cannot increment Foo object(Foo)#1 (0) { } -Cannot decrement Foo +TypeError: Cannot decrement Foo object(Foo)#1 (0) { } -Cannot increment Foo +TypeError: Cannot increment Foo object(Foo)#1 (0) { } -Cannot decrement Foo +TypeError: Cannot decrement Foo object(Foo)#1 (0) { } diff --git a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt index b4c193a67182..ba7ca7396e60 100644 --- a/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt +++ b/Zend/tests/in-de-crement/object_cannot_incdec_use_result_op.phpt @@ -8,38 +8,38 @@ $o = new Foo; try { $y = $o++; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { $y = $o--; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { $y = ++$o; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } try { $y = --$o; } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($o); } ?> --EXPECT-- -Cannot increment Foo +TypeError: Cannot increment Foo object(Foo)#1 (0) { } -Cannot decrement Foo +TypeError: Cannot decrement Foo object(Foo)#1 (0) { } -Cannot increment Foo +TypeError: Cannot increment Foo object(Foo)#1 (0) { } -Cannot decrement Foo +TypeError: Cannot decrement Foo object(Foo)#1 (0) { } diff --git a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt index 51b4c8f1fd72..183221b2b217 100644 --- a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt +++ b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt @@ -22,13 +22,13 @@ foreach (['pre', 'post'] as $prePost) { try { $foo->{$prePost . ucfirst($incDec)}(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- -Cannot increment Foo -Cannot decrement Foo -Cannot increment Foo -Cannot decrement Foo +TypeError: Cannot increment Foo +TypeError: Cannot decrement Foo +TypeError: Cannot increment Foo +TypeError: Cannot decrement Foo diff --git a/Zend/tests/in-de-crement/overloaded_access.phpt b/Zend/tests/in-de-crement/overloaded_access.phpt index 56a5c2b1d47a..feb15c60c6cf 100644 --- a/Zend/tests/in-de-crement/overloaded_access.phpt +++ b/Zend/tests/in-de-crement/overloaded_access.phpt @@ -22,15 +22,15 @@ $foo = new Foo; try { $foo[0]++; } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $foo = new Foo; try { $foo[0]--; } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Cannot increment array -Cannot decrement array +TypeError: Cannot increment array +TypeError: Cannot decrement array diff --git a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt index d435c9fb4029..eb473d9c70ec 100644 --- a/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt +++ b/Zend/tests/in-de-crement/unset_property_converted_to_obj_in_error_handler.phpt @@ -15,11 +15,11 @@ unset($c->a); try { (++$c->a); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($c->a); ?> --EXPECT-- -Cannot increment stdClass +TypeError: Cannot increment stdClass object(stdClass)#2 (0) { } diff --git a/Zend/tests/include_stat_is_quiet.phpt b/Zend/tests/include_stat_is_quiet.phpt index 39eb3053fbe4..57138ddd06c6 100644 --- a/Zend/tests/include_stat_is_quiet.phpt +++ b/Zend/tests/include_stat_is_quiet.phpt @@ -21,7 +21,7 @@ set_include_path('test://foo:test://bar'); try { require_once 'doesnt_exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/incompat_ctx_user.phpt b/Zend/tests/incompat_ctx_user.phpt index 3fe0456175f0..a50c769b3da7 100644 --- a/Zend/tests/incompat_ctx_user.phpt +++ b/Zend/tests/incompat_ctx_user.phpt @@ -13,8 +13,8 @@ $b = new B; try { $b->bar(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Non-static method A::foo() cannot be called statically +Error: Non-static method A::foo() cannot be called statically diff --git a/Zend/tests/indexing_001.phpt b/Zend/tests/indexing_001.phpt index 66b20da03a03..d98e793232af 100644 --- a/Zend/tests/indexing_001.phpt +++ b/Zend/tests/indexing_001.phpt @@ -10,7 +10,7 @@ foreach ($testvalues as $testvalue) { try { $testvalue['foo']=$array; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($testvalue); } @@ -22,7 +22,7 @@ foreach ($testvalues as $testvalue) { try { $testvalue['foo']=&$array; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($testvalue); } @@ -34,7 +34,7 @@ foreach ($testvalues as $testvalue) { try { $testvalue[]=$array; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump ($testvalue); } @@ -46,7 +46,7 @@ foreach ($testvalues as $testvalue) { try { $testvalue[]=&$array; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump ($testvalue); } @@ -61,11 +61,11 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(0) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(1) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array bool(true) Deprecated: Automatic conversion of false to array is deprecated in %s @@ -76,11 +76,11 @@ array(1) { int(1) } } -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(0) "" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(1) " " -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array float(0.1) array(1) { ["foo"]=> @@ -98,11 +98,11 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(0) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(1) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array bool(true) Deprecated: Automatic conversion of false to array is deprecated in %s @@ -113,7 +113,7 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array float(0.1) array(1) { ["foo"]=> @@ -130,11 +130,11 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(0) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(1) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array bool(true) Deprecated: Automatic conversion of false to array is deprecated in %s @@ -145,7 +145,7 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array float(0.1) array(1) { [0]=> @@ -163,11 +163,11 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(0) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(1) -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array bool(true) Deprecated: Automatic conversion of false to array is deprecated in %s @@ -178,7 +178,7 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array float(0.1) array(1) { [0]=> diff --git a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt index 603b3bfc299b..30d84109ce31 100644 --- a/Zend/tests/indirect_function_call/indirect_call_array_003.phpt +++ b/Zend/tests/indirect_function_call/indirect_call_array_003.phpt @@ -20,7 +20,7 @@ $arr = array('foo', 'abc'); try { $arr(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo = new foo; $arr = array($foo, 'abc'); @@ -31,7 +31,7 @@ $arr(); --EXPECTF-- From foo::__callStatic: string(3) "abc" -Exception: Using $this when not in object context +Error: Using $this when not in object context From foo::__call: string(3) "abc" object(foo)#%d (0) { diff --git a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt index e8520efd12b0..ed3cb5c28b8a 100644 --- a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt +++ b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt @@ -24,7 +24,7 @@ try { $arr(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $arr = array('foo', '123'); @@ -33,7 +33,7 @@ try { $arr(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -46,7 +46,7 @@ try { $arr(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -57,15 +57,15 @@ try { $arr(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -foo +Exception: foo From foo::__callStatic: -123 +Exception: 123 ------ -foo +Exception: foo From foo::__call: -123 +Exception: 123 diff --git a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt index 7704c1cd9a4d..348922169e5b 100644 --- a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt +++ b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt @@ -23,7 +23,7 @@ $callback = ['', 'method']; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test Class::method syntax with empty class name @@ -31,7 +31,7 @@ $callback = '::method'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test array syntax with empty class and method name @@ -39,7 +39,7 @@ $callback = ['', '']; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test Class::method syntax with empty class and method name @@ -47,7 +47,7 @@ $callback = '::'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test string ending in single colon @@ -55,7 +55,7 @@ $callback = 'Class:'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test string beginning in single colon @@ -63,7 +63,7 @@ $callback = ':method'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test single colon @@ -71,16 +71,16 @@ $callback = ':'; try { $callback(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(0) "" string(0) "" -Class "" not found -Class "" not found -Class "" not found -Class "" not found -Call to undefined function Class:() -Call to undefined function :method() -Call to undefined function :() +Error: Class "" not found +Error: Class "" not found +Error: Class "" not found +Error: Class "" not found +Error: Call to undefined function Class:() +Error: Call to undefined function :method() +Error: Call to undefined function :() diff --git a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt index 39967fdb267d..b2aa97cc9784 100644 --- a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt +++ b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt @@ -12,9 +12,9 @@ class foo { try { $X = (new foo)->Inexistent(3); } catch (Exception $e) { - var_dump($e->getMessage()); // foobar + echo $e::class, ': ', $e->getMessage(), "\n"; // foobar } ?> --EXPECT-- -string(6) "foobar" +Exception: foobar diff --git a/Zend/tests/init_array_illegal_offset_type.phpt b/Zend/tests/init_array_illegal_offset_type.phpt index ee41c0217ad7..d895ed053424 100644 --- a/Zend/tests/init_array_illegal_offset_type.phpt +++ b/Zend/tests/init_array_illegal_offset_type.phpt @@ -8,8 +8,8 @@ function test() { try { test(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type stdClass on array +TypeError: Cannot access offset of type stdClass on array diff --git a/Zend/tests/int_static_prop_name.phpt b/Zend/tests/int_static_prop_name.phpt index e29e2514bb97..c7a366da66bd 100644 --- a/Zend/tests/int_static_prop_name.phpt +++ b/Zend/tests/int_static_prop_name.phpt @@ -17,19 +17,19 @@ var_dump(${(int) $n}); try { var_dump(Foo::${42}); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::${(int) 42}); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(Foo::${(int) $n}); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -37,6 +37,6 @@ try { int(24) int(24) int(24) -Access to undeclared static property Foo::$42 -Access to undeclared static property Foo::$42 -Access to undeclared static property Foo::$42 +Error: Access to undeclared static property Foo::$42 +Error: Access to undeclared static property Foo::$42 +Error: Access to undeclared static property Foo::$42 diff --git a/Zend/tests/invalid_parent_const_ref_leak.phpt b/Zend/tests/invalid_parent_const_ref_leak.phpt index ed728f7d45e4..605c1524fb56 100644 --- a/Zend/tests/invalid_parent_const_ref_leak.phpt +++ b/Zend/tests/invalid_parent_const_ref_leak.phpt @@ -10,9 +10,9 @@ class A { try { A::B; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access "parent" when current class scope has no parent +Error: Cannot access "parent" when current class scope has no parent diff --git a/Zend/tests/isset/isset_array.phpt b/Zend/tests/isset/isset_array.phpt index 48e908a36d56..92bac0c8e932 100644 --- a/Zend/tests/isset/isset_array.phpt +++ b/Zend/tests/isset/isset_array.phpt @@ -25,13 +25,13 @@ var_dump(isset($array[STDIN])); try { isset($array[[]]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { isset($array[new stdClass()]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- @@ -48,5 +48,5 @@ bool(false) Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d bool(false) -Cannot access offset of type array in isset or empty -Cannot access offset of type stdClass in isset or empty +TypeError: Cannot access offset of type array in isset or empty +TypeError: Cannot access offset of type stdClass in isset or empty diff --git a/Zend/tests/iterable_or_null.phpt b/Zend/tests/iterable_or_null.phpt index a44e858bce92..6b59a117de2b 100644 --- a/Zend/tests/iterable_or_null.phpt +++ b/Zend/tests/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 diff --git a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt index c46756718649..a9abb9e9b606 100644 --- a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt +++ b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt @@ -33,7 +33,7 @@ var_dump($object2); try { var_dump($object1->propB); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // The state of both objects is unchanged @@ -52,7 +52,7 @@ lazy ghost object(MyClass)#%d (1) { ["propA"]=> string(8) "object-2" } -initializer exception +Exception: initializer exception lazy ghost object(MyClass)#%d (1) { ["propA"]=> string(8) "object-1" diff --git a/Zend/tests/lazy_objects/typed_properties_001.phpt b/Zend/tests/lazy_objects/typed_properties_001.phpt index 1f457531d87c..3f4c1d1b2734 100644 --- a/Zend/tests/lazy_objects/typed_properties_001.phpt +++ b/Zend/tests/lazy_objects/typed_properties_001.phpt @@ -21,13 +21,13 @@ $ref = "foobar"; try { $test->$name =& $ref; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); ?> --EXPECTF-- -Cannot assign string to property Test::$prop of type int +TypeError: Cannot assign string to property Test::$prop of type int lazy proxy object(Test)#%d (1) { ["instance"]=> object(Test)#%d (0) { diff --git a/Zend/tests/live_range_phi_leak.phpt b/Zend/tests/live_range_phi_leak.phpt index f07258405301..f31840d5150f 100644 --- a/Zend/tests/live_range_phi_leak.phpt +++ b/Zend/tests/live_range_phi_leak.phpt @@ -12,8 +12,8 @@ function test($k) { try { test(new stdClass); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Test +Exception: Test diff --git a/Zend/tests/magic_methods/bug26166.phpt b/Zend/tests/magic_methods/bug26166.phpt index 3e5c6daa21d4..99f4a1e08e7b 100644 --- a/Zend/tests/magic_methods/bug26166.phpt +++ b/Zend/tests/magic_methods/bug26166.phpt @@ -41,7 +41,7 @@ $o = new NoneTest; try { echo $o; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "===THROW===\n"; @@ -57,13 +57,13 @@ $o = new ErrorTest; try { echo $o; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Hello World! ===NONE=== -NoneTest::__toString(): Return value must be of type string, none returned +TypeError: NoneTest::__toString(): Return value must be of type string, none returned ===THROW=== -This is an error! +Exception: This is an error! diff --git a/Zend/tests/magic_methods/bug29368_2.phpt b/Zend/tests/magic_methods/bug29368_2.phpt index e13d6da88467..fda92130c504 100644 --- a/Zend/tests/magic_methods/bug29368_2.phpt +++ b/Zend/tests/magic_methods/bug29368_2.phpt @@ -12,10 +12,10 @@ class Bomb { try { $x = new ReflectionMethod(new Bomb(), "foo"); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok\n"; ?> --EXPECT-- -bomb! +Exception: bomb! ok diff --git a/Zend/tests/magic_methods/bug45186.phpt b/Zend/tests/magic_methods/bug45186.phpt index 9e0078d77002..f0796278c58a 100644 --- a/Zend/tests/magic_methods/bug45186.phpt +++ b/Zend/tests/magic_methods/bug45186.phpt @@ -34,7 +34,7 @@ call_user_func('BAR::www'); try { call_user_func('self::y'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -58,4 +58,4 @@ string(1) "y" ok __callstatic: string(3) "www" -call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active diff --git a/Zend/tests/magic_methods/bug45186_2.phpt b/Zend/tests/magic_methods/bug45186_2.phpt index e85528ce8b00..eec4b3ab3bcb 100644 --- a/Zend/tests/magic_methods/bug45186_2.phpt +++ b/Zend/tests/magic_methods/bug45186_2.phpt @@ -29,12 +29,12 @@ call_user_func(array('BAR','x')); try { call_user_func('BAR::www'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func('self::y'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -56,5 +56,5 @@ Deprecated: Use of "self" in callables is deprecated in %s on line %d __call: string(1) "y" ok -call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www" -call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "www" +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot access "self" when no class scope is active diff --git a/Zend/tests/magic_methods/bug76667.phpt b/Zend/tests/magic_methods/bug76667.phpt index 03bd490a0409..b0124633db17 100644 --- a/Zend/tests/magic_methods/bug76667.phpt +++ b/Zend/tests/magic_methods/bug76667.phpt @@ -19,11 +19,11 @@ $x = new T; try { $x->x = 1; } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Warning: Undefined variable $undefined in %s on line %d Warning: Attempt to read property "1" on null in %s on line %d -Division by zero +DivisionByZeroError: Division by zero diff --git a/Zend/tests/match/043.phpt b/Zend/tests/match/043.phpt index 03ff0cbf36d6..ab993b13bc43 100644 --- a/Zend/tests/match/043.phpt +++ b/Zend/tests/match/043.phpt @@ -9,7 +9,7 @@ function test(mixed $var) { try { match($var) {}; } catch (UnhandledMatchError $e) { - print $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -27,14 +27,14 @@ test(str_repeat('e', 100)); test(str_repeat("e\n", 100)); ?> --EXPECT-- -Unhandled match case NULL -Unhandled match case 1 -Unhandled match case 5.5 -Unhandled match case 5.0 -Unhandled match case 'foo' -Unhandled match case true -Unhandled match case false -Unhandled match case of type array -Unhandled match case of type Beep -Unhandled match case 'eeeeeeeeeeeeeee...' -Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...' +UnhandledMatchError: Unhandled match case NULL +UnhandledMatchError: Unhandled match case 1 +UnhandledMatchError: Unhandled match case 5.5 +UnhandledMatchError: Unhandled match case 5.0 +UnhandledMatchError: Unhandled match case 'foo' +UnhandledMatchError: Unhandled match case true +UnhandledMatchError: Unhandled match case false +UnhandledMatchError: Unhandled match case of type array +UnhandledMatchError: Unhandled match case of type Beep +UnhandledMatchError: Unhandled match case 'eeeeeeeeeeeeeee...' +UnhandledMatchError: Unhandled match case 'e\ne\ne\ne\ne\ne\ne\ne...' diff --git a/Zend/tests/match/045.phpt b/Zend/tests/match/045.phpt index da8991cf595c..0857c6734af2 100644 --- a/Zend/tests/match/045.phpt +++ b/Zend/tests/match/045.phpt @@ -11,8 +11,8 @@ function test() { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "x" +Error: Undefined constant "x" diff --git a/Zend/tests/match/048.phpt b/Zend/tests/match/048.phpt index e5c6bb2e0bcb..11f6508b2efd 100644 --- a/Zend/tests/match/048.phpt +++ b/Zend/tests/match/048.phpt @@ -11,7 +11,7 @@ function test(mixed $var) { try { match($var) {}; } catch (UnhandledMatchError $e) { - print $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -29,14 +29,14 @@ test(str_repeat('e', 100)); test(str_repeat("e\n", 100)); ?> --EXPECT-- -Unhandled match case NULL -Unhandled match case 1 -Unhandled match case 5.5 -Unhandled match case 5.0 -Unhandled match case of type string -Unhandled match case true -Unhandled match case false -Unhandled match case of type array -Unhandled match case of type Beep -Unhandled match case of type string -Unhandled match case of type string +UnhandledMatchError: Unhandled match case NULL +UnhandledMatchError: Unhandled match case 1 +UnhandledMatchError: Unhandled match case 5.5 +UnhandledMatchError: Unhandled match case 5.0 +UnhandledMatchError: Unhandled match case of type string +UnhandledMatchError: Unhandled match case true +UnhandledMatchError: Unhandled match case false +UnhandledMatchError: Unhandled match case of type array +UnhandledMatchError: Unhandled match case of type Beep +UnhandledMatchError: Unhandled match case of type string +UnhandledMatchError: Unhandled match case of type string diff --git a/Zend/tests/match/049.phpt b/Zend/tests/match/049.phpt index 2a2385f704ff..05d68e4b33da 100644 --- a/Zend/tests/match/049.phpt +++ b/Zend/tests/match/049.phpt @@ -11,7 +11,7 @@ function test(mixed $var) { try { match($var) {}; } catch (UnhandledMatchError $e) { - print $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -29,14 +29,14 @@ test(str_repeat('e', 100)); test(str_repeat("e\n", 100)); ?> --EXPECT-- -Unhandled match case of type null -Unhandled match case of type int -Unhandled match case of type float -Unhandled match case of type float -Unhandled match case of type string -Unhandled match case of type bool -Unhandled match case of type bool -Unhandled match case of type array -Unhandled match case of type Beep -Unhandled match case of type string -Unhandled match case of type string +UnhandledMatchError: Unhandled match case of type null +UnhandledMatchError: Unhandled match case of type int +UnhandledMatchError: Unhandled match case of type float +UnhandledMatchError: Unhandled match case of type float +UnhandledMatchError: Unhandled match case of type string +UnhandledMatchError: Unhandled match case of type bool +UnhandledMatchError: Unhandled match case of type bool +UnhandledMatchError: Unhandled match case of type array +UnhandledMatchError: Unhandled match case of type Beep +UnhandledMatchError: Unhandled match case of type string +UnhandledMatchError: Unhandled match case of type string diff --git a/Zend/tests/match/unmatched_enum.phpt b/Zend/tests/match/unmatched_enum.phpt index 93f368a316b6..a92d905fbe83 100644 --- a/Zend/tests/match/unmatched_enum.phpt +++ b/Zend/tests/match/unmatched_enum.phpt @@ -13,9 +13,9 @@ try { Foo::Baz => 42, }; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unhandled match case Foo::Bar +UnhandledMatchError: Unhandled match case Foo::Bar diff --git a/Zend/tests/methods-on-non-objects-call-user-func.phpt b/Zend/tests/methods-on-non-objects-call-user-func.phpt index 7a8ab5a2647b..c1ea2867f0c6 100644 --- a/Zend/tests/methods-on-non-objects-call-user-func.phpt +++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt @@ -6,8 +6,8 @@ $comparator = null; try { var_dump(call_user_func([$comparator, 'compare'], 1, 2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object diff --git a/Zend/tests/methods-on-non-objects-catch.phpt b/Zend/tests/methods-on-non-objects-catch.phpt index b090437084ff..2c2bbd7c1072 100644 --- a/Zend/tests/methods-on-non-objects-catch.phpt +++ b/Zend/tests/methods-on-non-objects-catch.phpt @@ -10,11 +10,10 @@ $x= null; try { var_dump($x->method()); } catch (Error $e) { - var_dump($e->getCode(), $e->getMessage()); + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n"; } echo "Alive\n"; ?> --EXPECTF-- -int(0) -string(%d) "Call to a member function method() on null" +Error: 0: Call to a member function method() on null Alive diff --git a/Zend/tests/methods-on-non-objects-usort.phpt b/Zend/tests/methods-on-non-objects-usort.phpt index 8a89023b7e81..3d216af74c3d 100644 --- a/Zend/tests/methods-on-non-objects-usort.phpt +++ b/Zend/tests/methods-on-non-objects-usort.phpt @@ -12,7 +12,7 @@ usort($list, function($a, $b) use ($comparator) { try { return $comparator->compare($a, $b); } catch (Error $e) { - var_dump($e->getCode(), $e->getMessage()); + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n"; return 0; } }); @@ -20,14 +20,10 @@ var_dump($list); echo "Alive\n"; ?> --EXPECT-- -int(0) -string(43) "Call to a member function compare() on null" -int(0) -string(43) "Call to a member function compare() on null" -int(0) -string(43) "Call to a member function compare() on null" -int(0) -string(43) "Call to a member function compare() on null" +Error: 0: Call to a member function compare() on null +Error: 0: Call to a member function compare() on null +Error: 0: Call to a member function compare() on null +Error: 0: Call to a member function compare() on null array(5) { [0]=> int(1) diff --git a/Zend/tests/mod_001.phpt b/Zend/tests/mod_001.phpt index 5c543a26192c..6c161efe323f 100644 --- a/Zend/tests/mod_001.phpt +++ b/Zend/tests/mod_001.phpt @@ -10,11 +10,11 @@ try { $c = $a % $b; var_dump($c); } catch (TypeError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array % array +TypeError: Unsupported operand types: array % array Done diff --git a/Zend/tests/mul_001.phpt b/Zend/tests/mul_001.phpt index ddb657685302..3ead1f34e1ac 100644 --- a/Zend/tests/mul_001.phpt +++ b/Zend/tests/mul_001.phpt @@ -9,7 +9,7 @@ $b = array(1); try { var_dump($a * $b); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a * $b; @@ -18,7 +18,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array * array +TypeError: Unsupported operand types: array * array Fatal error: Uncaught TypeError: Unsupported operand types: array * array in %s:%d Stack trace: diff --git a/Zend/tests/named_params/__invoke.phpt b/Zend/tests/named_params/__invoke.phpt index 6ebbac0f07f4..f50743b8d8f7 100644 --- a/Zend/tests/named_params/__invoke.phpt +++ b/Zend/tests/named_params/__invoke.phpt @@ -22,7 +22,7 @@ $test(b: 'B'); try { $test(b: 'B', c: 'C'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -39,14 +39,14 @@ $test3(b: 'B'); try { $test3(b: 'B', c: 'C'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- a: A, b: B a: a, b: B -Unknown named parameter $c +Error: Unknown named parameter $c a: A, b: B array(1) { @@ -61,4 +61,4 @@ array(1) { a: A, b: B a: a, b: B -Unknown named parameter $c +Error: Unknown named parameter $c diff --git a/Zend/tests/named_params/assert.phpt b/Zend/tests/named_params/assert.phpt index 40a92a2f1fec..a65ae460126c 100644 --- a/Zend/tests/named_params/assert.phpt +++ b/Zend/tests/named_params/assert.phpt @@ -7,24 +7,24 @@ assert(assertion: true); try { assert(assertion: false); } catch (AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } assert(assertion: true, description: "Description"); try { assert(assertion: false, description: "Description"); } catch (AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { assert(description: "Description"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(assertion: false) -Description -Named parameter $description overwrites previous argument +AssertionError: assert(assertion: false) +AssertionError: Description +Error: Named parameter $description overwrites previous argument diff --git a/Zend/tests/named_params/attributes.phpt b/Zend/tests/named_params/attributes.phpt index 94d2fad19f4d..9b16feb724d7 100644 --- a/Zend/tests/named_params/attributes.phpt +++ b/Zend/tests/named_params/attributes.phpt @@ -27,7 +27,7 @@ $attr = (new ReflectionClass(Test2::class))->getAttributes()[0]; try { var_dump($attr->newInstance()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,4 +47,4 @@ object(MyAttribute)#1 (3) { ["c"]=> string(1) "C" } -Named parameter $a overwrites previous argument +Error: Named parameter $a overwrites previous argument diff --git a/Zend/tests/named_params/call_user_func.phpt b/Zend/tests/named_params/call_user_func.phpt index 50f2ed588e92..a11198a7fca3 100644 --- a/Zend/tests/named_params/call_user_func.phpt +++ b/Zend/tests/named_params/call_user_func.phpt @@ -37,17 +37,17 @@ var_dump(call_user_func('call_user_func', $test, c: 'D')); try { call_user_func($test_required, b: 'B'); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(call_user_func('array_slice', [1, 2, 3, 4, 5], length: 2)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(call_user_func('array_slice', [1, 2, 3, 4, 'x' => 5], 3, preserve_keys: true)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -82,8 +82,8 @@ array(2) { Warning: {closure:%s:%d}(): Argument #1 ($ref) must be passed by reference, value given in %s on line %d a = a, b = b, c = D NULL -{closure:%s:%d}(): Argument #1 ($a) not passed -array_slice(): Argument #2 ($offset) not passed +ArgumentCountError: {closure:%s:%d}(): Argument #1 ($a) not passed +ArgumentCountError: array_slice(): Argument #2 ($offset) not passed array(2) { [3]=> int(4) diff --git a/Zend/tests/named_params/call_user_func_array.phpt b/Zend/tests/named_params/call_user_func_array.phpt index ebee06ea6af7..8dde83574c17 100644 --- a/Zend/tests/named_params/call_user_func_array.phpt +++ b/Zend/tests/named_params/call_user_func_array.phpt @@ -18,12 +18,12 @@ namespace { try { call_user_func_array($test, ['d' => 'D']); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func_array($test, ['c' => 'C', 'A']); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } @@ -36,12 +36,12 @@ namespace Foo { try { call_user_func_array($test, ['d' => 'D']); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func_array($test, ['c' => 'C', 'A']); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -56,8 +56,8 @@ array(2) { ["c"]=> string(1) "C" } -Unknown named parameter $d -Cannot use positional argument after named argument +Error: Unknown named parameter $d +Error: Cannot use positional argument after named argument a = A, b = B, c = c a = A, b = B, c = c @@ -68,5 +68,5 @@ array(2) { ["c"]=> string(1) "C" } -Unknown named parameter $d -Cannot use positional argument after named argument +Error: Unknown named parameter $d +Error: Cannot use positional argument after named argument diff --git a/Zend/tests/named_params/cannot_pass_by_ref.phpt b/Zend/tests/named_params/cannot_pass_by_ref.phpt index a910cd4410c4..fd77fff70ebd 100644 --- a/Zend/tests/named_params/cannot_pass_by_ref.phpt +++ b/Zend/tests/named_params/cannot_pass_by_ref.phpt @@ -6,8 +6,8 @@ function test($a, &$e) {} try { test(e: 42); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -test(): Argument #2 ($e) could not be passed by reference +Error: test(): Argument #2 ($e) could not be passed by reference diff --git a/Zend/tests/named_params/ctor_extra_named_args.phpt b/Zend/tests/named_params/ctor_extra_named_args.phpt index ae569ea65d39..76490a76cf4f 100644 --- a/Zend/tests/named_params/ctor_extra_named_args.phpt +++ b/Zend/tests/named_params/ctor_extra_named_args.phpt @@ -8,16 +8,16 @@ class Test {} try { new stdClass(x: "nope"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new Test(x: "nope"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unknown named parameter $x -Unknown named parameter $x +Error: Unknown named parameter $x +Error: Unknown named parameter $x diff --git a/Zend/tests/named_params/duplicate_param.phpt b/Zend/tests/named_params/duplicate_param.phpt index 6abc95bba0fb..04cd76134ce8 100644 --- a/Zend/tests/named_params/duplicate_param.phpt +++ b/Zend/tests/named_params/duplicate_param.phpt @@ -8,16 +8,16 @@ function test($a) {} try { test(a: 1, a: 2); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(1, a: 2); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Named parameter $a overwrites previous argument -Named parameter $a overwrites previous argument +Error: Named parameter $a overwrites previous argument +Error: Named parameter $a overwrites previous argument diff --git a/Zend/tests/named_params/gh17216.phpt b/Zend/tests/named_params/gh17216.phpt index 4cb4df0ec431..0fc0349983df 100644 --- a/Zend/tests/named_params/gh17216.phpt +++ b/Zend/tests/named_params/gh17216.phpt @@ -13,10 +13,10 @@ $array = ["a" => "b", 1]; try { forward_static_call_array($callback, $array); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -Cannot use positional argument after named argument +Error: Cannot use positional argument after named argument Done diff --git a/Zend/tests/named_params/internal_variadics.phpt b/Zend/tests/named_params/internal_variadics.phpt index 8312bde406d2..ecad7f5c83e0 100644 --- a/Zend/tests/named_params/internal_variadics.phpt +++ b/Zend/tests/named_params/internal_variadics.phpt @@ -6,23 +6,23 @@ Named params on internal functions: Variadic functions that don't support extra try { array_merge([1, 2], a: [3, 4]); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_diff_key([1, 2], [3, 4], a: [5, 6]); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $array = [1, 2]; array_push($array, ...['values' => 3]); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Internal function array_merge() does not accept named variadic arguments -Internal function array_diff_key() does not accept named variadic arguments -Internal function array_push() does not accept named variadic arguments +ArgumentCountError: Internal function array_merge() does not accept named variadic arguments +ArgumentCountError: Internal function array_diff_key() does not accept named variadic arguments +ArgumentCountError: Internal function array_push() does not accept named variadic arguments diff --git a/Zend/tests/named_params/missing_param.phpt b/Zend/tests/named_params/missing_param.phpt index f8b0b356ceeb..a213c834df5d 100644 --- a/Zend/tests/named_params/missing_param.phpt +++ b/Zend/tests/named_params/missing_param.phpt @@ -9,19 +9,19 @@ function test($a, $b, $c, $d) { try { test(a: 'a', d: 'd'); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_keys(strict: true); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_keys([], strict: true); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // This works fine, as search_value is explicitly specified. @@ -29,9 +29,9 @@ var_dump(array_keys([41, 42], filter_value: 42, strict: true)); ?> --EXPECT-- -test(): Argument #2 ($b) not passed -array_keys(): Argument #1 ($array) not passed -array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known +ArgumentCountError: test(): Argument #2 ($b) not passed +ArgumentCountError: array_keys(): Argument #1 ($array) not passed +ArgumentCountError: array_keys(): Argument #2 ($filter_value) must be passed explicitly, because the default value is not known array(1) { [0]=> int(1) diff --git a/Zend/tests/named_params/unknown_named_param.phpt b/Zend/tests/named_params/unknown_named_param.phpt index 5a18932ffd17..b005674c35df 100644 --- a/Zend/tests/named_params/unknown_named_param.phpt +++ b/Zend/tests/named_params/unknown_named_param.phpt @@ -12,36 +12,36 @@ function test2(...$a) { try { test(b: 42); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(b: new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(b: 2, a: 1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(...new ArrayIterator(['unknown' => 42])); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(a: 42); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unknown named parameter $b -Unknown named parameter $b -Unknown named parameter $b -Unknown named parameter $unknown +Error: Unknown named parameter $b +Error: Unknown named parameter $b +Error: Unknown named parameter $b +Error: Unknown named parameter $unknown diff --git a/Zend/tests/named_params/unpack.phpt b/Zend/tests/named_params/unpack.phpt index 92bb4792c3e5..018ccf69a642 100644 --- a/Zend/tests/named_params/unpack.phpt +++ b/Zend/tests/named_params/unpack.phpt @@ -18,13 +18,13 @@ test(...['a', 'b' => 'b', 'c' => 'c']); try { test(...['a', 'b' => 'b', 'c']); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(...['a', 'a' => 'a']); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ary = ['b' => 0]; @@ -39,13 +39,13 @@ test(...new ArrayIterator(['a', 'b' => 'b', 'c' => 'c'])); try { test(...new ArrayIterator(['a', 'b' => 'b', 'c'])); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test(...new ArrayIterator(['a', 'a' => 'a'])); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ary = ['b' => 0]; @@ -58,8 +58,8 @@ var_dump($ary, $ary2); a = a, b = b, c = c a = a, b = b, c = c a = a, b = b, c = c -Cannot use positional argument after named argument during unpacking -Named parameter $a overwrites previous argument +Error: Cannot use positional argument after named argument during unpacking +Error: Named parameter $a overwrites previous argument array(1) { ["b"]=> int(1) @@ -71,8 +71,8 @@ array(1) { a = a, b = b, c = c a = a, b = b, c = c a = a, b = b, c = c -Cannot use positional argument after named argument during unpacking -Named parameter $a overwrites previous argument +Error: Cannot use positional argument after named argument during unpacking +Error: Named parameter $a overwrites previous argument Warning: Cannot pass by-reference argument 2 of test2() by unpacking a Traversable, passing by-value instead in %s on line %d array(1) { diff --git a/Zend/tests/named_params/unpack_and_named_1.phpt b/Zend/tests/named_params/unpack_and_named_1.phpt index 1e08163724d4..e1177347b461 100644 --- a/Zend/tests/named_params/unpack_and_named_1.phpt +++ b/Zend/tests/named_params/unpack_and_named_1.phpt @@ -20,12 +20,12 @@ test2(...['b' => 2, 'a' => 1], d: 40); try { test2(...[1, 2], b: 20); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(...[1, 'b' => 2], b: 20); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -54,5 +54,5 @@ int(1) int(2) int(3) int(40) -Named parameter $b overwrites previous argument -Named parameter $b overwrites previous argument +Error: Named parameter $b overwrites previous argument +Error: Named parameter $b overwrites previous argument diff --git a/Zend/tests/namespaces/ns_076.phpt b/Zend/tests/namespaces/ns_076.phpt index 230b498b54ac..73c610399b40 100644 --- a/Zend/tests/namespaces/ns_076.phpt +++ b/Zend/tests/namespaces/ns_076.phpt @@ -8,23 +8,23 @@ use Error; try { $a = array(unknown => unknown); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo unknown; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo \unknown; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "foo\unknown" -Undefined constant "foo\unknown" -Undefined constant "unknown" +Error: Undefined constant "foo\unknown" +Error: Undefined constant "foo\unknown" +Error: Undefined constant "unknown" diff --git a/Zend/tests/not_002.phpt b/Zend/tests/not_002.phpt index 3282053b6b9d..273325a6aafa 100644 --- a/Zend/tests/not_002.phpt +++ b/Zend/tests/not_002.phpt @@ -9,7 +9,7 @@ $b = array(1,2); try { var_dump(~$b); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $a = ~$b; @@ -18,7 +18,7 @@ var_dump($a); echo "Done\n"; ?> --EXPECTF-- -Exception: Cannot perform bitwise not on array +TypeError: Cannot perform bitwise not on array Fatal error: Uncaught TypeError: Cannot perform bitwise not on array in %s:%d Stack trace: diff --git a/Zend/tests/nullsafe_operator/001.phpt b/Zend/tests/nullsafe_operator/001.phpt index 22776006a717..8e0affeb3ec4 100644 --- a/Zend/tests/nullsafe_operator/001.phpt +++ b/Zend/tests/nullsafe_operator/001.phpt @@ -45,7 +45,7 @@ var_dump($foo->self(null?->bar())->null()); try { var_dump($foo?->self()[null?->bar()]); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -103,4 +103,4 @@ string(11) "Foo::self()" string(11) "Foo::null()" NULL string(11) "Foo::self()" -string(38) "Cannot use object of type Foo as array" +Error: Cannot use object of type Foo as array diff --git a/Zend/tests/nullsafe_operator/002.phpt b/Zend/tests/nullsafe_operator/002.phpt index 87642bdcb5f0..19439bdd892d 100644 --- a/Zend/tests/nullsafe_operator/002.phpt +++ b/Zend/tests/nullsafe_operator/002.phpt @@ -6,37 +6,37 @@ Test nullsafe strict type check try { false?->bar(); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { []?->bar(); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (0)?->bar(); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (0.0)?->bar(); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ''?->bar(); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(40) "Call to a member function bar() on false" -string(40) "Call to a member function bar() on array" -string(38) "Call to a member function bar() on int" -string(40) "Call to a member function bar() on float" -string(41) "Call to a member function bar() on string" +Error: Call to a member function bar() on false +Error: Call to a member function bar() on array +Error: Call to a member function bar() on int +Error: Call to a member function bar() on float +Error: Call to a member function bar() on string diff --git a/Zend/tests/nullsafe_operator/003.phpt b/Zend/tests/nullsafe_operator/003.phpt index 83c2863d1a10..4164ffab9f97 100644 --- a/Zend/tests/nullsafe_operator/003.phpt +++ b/Zend/tests/nullsafe_operator/003.phpt @@ -25,7 +25,7 @@ var_dump($foo?->qux()); try { var_dump($foo?->quux()); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump((new Foo)?->bar); @@ -34,7 +34,7 @@ var_dump((new Foo)?->qux()); try { var_dump((new Foo)?->quux()); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -48,10 +48,10 @@ string(3) "bar" Warning: Undefined property: Foo::$baz in %s.php on line 20 NULL string(3) "qux" -string(36) "Call to undefined method Foo::quux()" +Error: Call to undefined method Foo::quux() string(3) "bar" Warning: Undefined property: Foo::$baz in %s.php on line 29 NULL string(3) "qux" -string(36) "Call to undefined method Foo::quux()" +Error: Call to undefined method Foo::quux() diff --git a/Zend/tests/nullsafe_operator/013.phpt b/Zend/tests/nullsafe_operator/013.phpt index ea3539954891..775397a941ad 100644 Binary files a/Zend/tests/nullsafe_operator/013.phpt and b/Zend/tests/nullsafe_operator/013.phpt differ diff --git a/Zend/tests/nullsafe_operator/014.phpt b/Zend/tests/nullsafe_operator/014.phpt index 896e831ec9fa..b09ace2b1806 100644 --- a/Zend/tests/nullsafe_operator/014.phpt +++ b/Zend/tests/nullsafe_operator/014.phpt @@ -7,7 +7,7 @@ function try_and_dump($fn) { try { var_dump($fn()); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -40,8 +40,8 @@ bar int(0) bar int(0) -Call to a member function null() on null -Call to a member function null() on null +Error: Call to a member function null() on null +Error: Call to a member function null() on null bar bar -Call to a member function baz() on int +Error: Call to a member function baz() on int diff --git a/Zend/tests/nullsafe_operator/016.phpt b/Zend/tests/nullsafe_operator/016.phpt index 5bc8516ae4b9..f8e35c25b0af 100644 --- a/Zend/tests/nullsafe_operator/016.phpt +++ b/Zend/tests/nullsafe_operator/016.phpt @@ -15,12 +15,12 @@ function test($foo) { try { set($foo?->bar, 'bar'); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { (strrev('tes'))($foo?->bar, 'bar2'); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -29,7 +29,7 @@ test(new Foo()); ?> --EXPECT-- -set(): Argument #1 ($ref) could not be passed by reference -set(): Argument #1 ($ref) could not be passed by reference -set(): Argument #1 ($ref) could not be passed by reference -set(): Argument #1 ($ref) could not be passed by reference +Error: set(): Argument #1 ($ref) could not be passed by reference +Error: set(): Argument #1 ($ref) could not be passed by reference +Error: set(): Argument #1 ($ref) could not be passed by reference +Error: set(): Argument #1 ($ref) could not be passed by reference diff --git a/Zend/tests/nullsafe_operator/026.phpt b/Zend/tests/nullsafe_operator/026.phpt index c4e825febbc5..ba34aa11e0a2 100644 --- a/Zend/tests/nullsafe_operator/026.phpt +++ b/Zend/tests/nullsafe_operator/026.phpt @@ -11,16 +11,16 @@ $null = null; try { Test::${$null?->foo}->bar; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Test::{$null?->foo}()->bar; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Access to undeclared static property Test::$ -Method name must be a string +Error: Access to undeclared static property Test::$ +Error: Method name must be a string diff --git a/Zend/tests/nullsafe_operator/033.phpt b/Zend/tests/nullsafe_operator/033.phpt index 63ee2f850a56..58579d325e04 100644 --- a/Zend/tests/nullsafe_operator/033.phpt +++ b/Zend/tests/nullsafe_operator/033.phpt @@ -25,7 +25,7 @@ var_dump("{$foo?->qux()}"); try { var_dump("{$foo?->quux()}"); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump("$foo?->bar"); @@ -34,7 +34,7 @@ var_dump("$foo?->qux()"); try { var_dump("$foo?->quux()"); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -48,7 +48,7 @@ string(3) "bar" Warning: Undefined property: Foo::$baz in %s.php on line 20 string(0) "" string(3) "qux" -string(36) "Call to undefined method Foo::quux()" +Error: Call to undefined method Foo::quux() string(3) "bar" Warning: Undefined property: Foo::$baz in %s.php on line 29 diff --git a/Zend/tests/nullsafe_operator/039.phpt b/Zend/tests/nullsafe_operator/039.phpt index 92983c1592e0..20e209143714 100644 --- a/Zend/tests/nullsafe_operator/039.phpt +++ b/Zend/tests/nullsafe_operator/039.phpt @@ -10,9 +10,9 @@ set_error_handler(function($_, $m) { try { $foo?->foo; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $foo +Exception: Undefined variable $foo diff --git a/Zend/tests/nullsafe_operator/constant_propagation.phpt b/Zend/tests/nullsafe_operator/constant_propagation.phpt index e41201d0e496..7660f20d1a7e 100644 --- a/Zend/tests/nullsafe_operator/constant_propagation.phpt +++ b/Zend/tests/nullsafe_operator/constant_propagation.phpt @@ -8,9 +8,9 @@ class Bar { const FOO = "foo"; } 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 +Error: Call to a member function length() on string diff --git a/Zend/tests/number_or_str_zpp.phpt b/Zend/tests/number_or_str_zpp.phpt index 6ee47ec6f63d..2548e0499ec0 100644 --- a/Zend/tests/number_or_str_zpp.phpt +++ b/Zend/tests/number_or_str_zpp.phpt @@ -23,12 +23,12 @@ var_dump(zend_number_or_string(new ToString())); try { zend_string_or_object([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { zend_number_or_string(new Foo()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(zend_number_or_string_or_null("string")); @@ -42,12 +42,12 @@ var_dump(zend_number_or_string_or_null(new ToString())); try { zend_number_or_string_or_null([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { zend_number_or_string_or_null(new Foo()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -61,8 +61,8 @@ int(0) int(0) int(1) string(8) "ToString" -zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given -zend_number_or_string(): Argument #1 ($param) must be of type string|int|float, Foo given +TypeError: zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given +TypeError: zend_number_or_string(): Argument #1 ($param) must be of type string|int|float, Foo given string(6) "string" int(1) float(5.5) @@ -70,5 +70,5 @@ NULL int(0) int(1) string(8) "ToString" -zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, array given -zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, Foo given +TypeError: zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, array given +TypeError: zend_number_or_string_or_null(): Argument #1 ($param) must be of type string|int|float|null, Foo given diff --git a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt index 51df22634869..39d2d3a60beb 100644 --- a/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt +++ b/Zend/tests/numeric_strings/invalid_numeric_string_must_generate_warning_assign.phpt @@ -16,7 +16,7 @@ try { $a += "sit"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("5 amet,"); @@ -27,7 +27,7 @@ try { $a -= "elit,"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("11 sed"); @@ -38,7 +38,7 @@ try { $a *= "tempor"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("17 incididunt"); @@ -49,7 +49,7 @@ try { $a /= "et"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("23 dolore"); @@ -60,7 +60,7 @@ try { $a **= "Ut"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("31 enim"); @@ -71,7 +71,7 @@ try { $a %= "veniam,"; var_dump($a); } catch (\TypeError $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("41 minim"); @@ -81,7 +81,7 @@ try { $a = foxcache("quis"); $a <<= "nostrud"; } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($a); echo "---", PHP_EOL; @@ -93,7 +93,7 @@ try { $a >>= "nisi"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("59 ut"); @@ -107,14 +107,14 @@ try { $a |= 73; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $a = foxcache(79); $a |= "ea"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("83 commodo"); @@ -128,14 +128,14 @@ try { $a &= 103; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $a = foxcache(107); $a &= "aute"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; $a = foxcache("109 irure"); @@ -149,14 +149,14 @@ try { $a ^= 137; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $a = foxcache(139); $a ^= "reprehenderit"; var_dump($a); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -164,35 +164,35 @@ Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(5) -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(-2) -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(143) -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d float(0.8947368421052632) -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d float(3.0910586430935376E+39) -Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string --- Warning: A non-numeric value encountered in %s on line %d @@ -206,7 +206,7 @@ Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(%d) -Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string string(4) "quis" --- @@ -214,7 +214,7 @@ Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(0) -Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string --- Warning: A non-numeric value encountered in %s on line %d @@ -222,8 +222,8 @@ int(63) Warning: A non-numeric value encountered in %s on line %d int(71) -Unsupported operand types: string | int -Unsupported operand types: int | string +TypeError: Unsupported operand types: string | int +TypeError: Unsupported operand types: int | string --- Warning: A non-numeric value encountered in %s on line %d @@ -231,8 +231,8 @@ int(81) Warning: A non-numeric value encountered in %s on line %d int(97) -Unsupported operand types: string & int -Unsupported operand types: int & string +TypeError: Unsupported operand types: string & int +TypeError: Unsupported operand types: int & string --- Warning: A non-numeric value encountered in %s on line %d @@ -240,5 +240,5 @@ int(28) Warning: A non-numeric value encountered in %s on line %d int(252) -Unsupported operand types: string ^ int -Unsupported operand types: int ^ string +TypeError: Unsupported operand types: string ^ int +TypeError: Unsupported operand types: int ^ string diff --git a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt index 2b76f538f46e..ab508a3391a9 100644 --- a/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt +++ b/Zend/tests/numeric_strings/invalid_numeric_strings_must_generate_warning.phpt @@ -7,56 +7,56 @@ var_dump("2 Lorem" + "3 ipsum"); try { var_dump("dolor" + "sit"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("5 amet," - "7 consectetur"); try { var_dump("adipiscing" - "elit,"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("11 sed" * "13 do"); try { var_dump("eiusmod" * "tempor"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("17 incididunt" / "19 ut"); try { var_dump("labore" / "et"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("23 dolore" ** "29 magna"); try { var_dump("aliqua." ** "Ut"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("31 enim" % "37 ad"); try { var_dump("minim" % "veniam,"); } catch (\TypeError $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("41 minim" << "43 veniam,"); try { var_dump("quis" << "nostrud"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("47 exercitation" >> "53 ullamco"); try { var_dump("laboris" >> "nisi"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("59 ut" | 61); @@ -64,12 +64,12 @@ var_dump(67 | "71 aliquip"); try { var_dump("ex" | 73); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(79 | "ea"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("83 commodo" & 89); @@ -77,12 +77,12 @@ var_dump(97 & "101 consequat."); try { var_dump("Duis" & 103); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(107 & "aute"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump("109 irure" ^ 113); @@ -90,26 +90,26 @@ var_dump(127 ^ "131 dolor"); try { var_dump("in" ^ 137); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(139 ^ "reprehenderit"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump(+"149 in"); try { var_dump(+"voluptate"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "---", PHP_EOL; var_dump(-"151 velit"); try { var_dump(-"esse"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -117,35 +117,35 @@ Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(5) -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(-2) -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(143) -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d float(0.8947368421052632) -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d float(3.0910586430935376E+39) -Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string --- Warning: A non-numeric value encountered in %s on line %d @@ -159,14 +159,14 @@ Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(%d) -Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string --- Warning: A non-numeric value encountered in %s on line %d Warning: A non-numeric value encountered in %s on line %d int(0) -Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string --- Warning: A non-numeric value encountered in %s on line %d @@ -174,8 +174,8 @@ int(63) Warning: A non-numeric value encountered in %s on line %d int(71) -Unsupported operand types: string | int -Unsupported operand types: int | string +TypeError: Unsupported operand types: string | int +TypeError: Unsupported operand types: int | string --- Warning: A non-numeric value encountered in %s on line %d @@ -183,8 +183,8 @@ int(81) Warning: A non-numeric value encountered in %s on line %d int(97) -Unsupported operand types: string & int -Unsupported operand types: int & string +TypeError: Unsupported operand types: string & int +TypeError: Unsupported operand types: int & string --- Warning: A non-numeric value encountered in %s on line %d @@ -192,15 +192,15 @@ int(28) Warning: A non-numeric value encountered in %s on line %d int(252) -Unsupported operand types: string ^ int -Unsupported operand types: int ^ string +TypeError: Unsupported operand types: string ^ int +TypeError: Unsupported operand types: int ^ string --- Warning: A non-numeric value encountered in %s on line %d int(149) -Unsupported operand types: string * int +TypeError: Unsupported operand types: string * int --- Warning: A non-numeric value encountered in %s on line %d int(-151) -Unsupported operand types: string * int +TypeError: Unsupported operand types: string * int diff --git a/Zend/tests/numeric_strings/string_offset.phpt b/Zend/tests/numeric_strings/string_offset.phpt index 0c43bc151210..01948437ef04 100644 --- a/Zend/tests/numeric_strings/string_offset.phpt +++ b/Zend/tests/numeric_strings/string_offset.phpt @@ -31,7 +31,7 @@ foreach ($keys as $key) { try { var_dump($str[$key]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -39,29 +39,29 @@ echo "Done\n"; ?> --EXPECTF-- string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "7str" in %s on line %d string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset " 7str" in %s on line %d string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset " 7 str" in %s on line %d string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "7 str" in %s on line %d string(1) "l" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "0xC" in %s on line %d string(1) "T" diff --git a/Zend/tests/offset_array.phpt b/Zend/tests/offset_array.phpt index e50ffad18cb2..a84a3bf48e0b 100644 --- a/Zend/tests/offset_array.phpt +++ b/Zend/tests/offset_array.phpt @@ -20,14 +20,14 @@ $obj = new stdClass; try { var_dump($arr[$obj]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $arr1 = Array(1,2,3); try { var_dump($arr[$arr1]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -50,6 +50,6 @@ int(1) Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d int(%d) -Cannot access offset of type stdClass on array -Cannot access offset of type array on array +TypeError: Cannot access offset of type stdClass on array +TypeError: Cannot access offset of type array on array Done diff --git a/Zend/tests/offset_string.phpt b/Zend/tests/offset_string.phpt index a32a68265689..a622f0e24545 100644 --- a/Zend/tests/offset_string.phpt +++ b/Zend/tests/offset_string.phpt @@ -11,13 +11,13 @@ var_dump($str[NULL]); try { var_dump($str["run away"]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($str["13"]); try { var_dump($str["14.5"]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($str["15 and then some"]); @@ -28,21 +28,21 @@ $fp = fopen(__FILE__, "r"); try { var_dump($str[$fp]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $obj = new stdClass; try { var_dump($str[$obj]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $arr = Array(1,2,3); try { var_dump($str[$arr]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -55,9 +55,9 @@ string(1) "S" Warning: String offset cast occurred in %s on line %d string(1) "S" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string string(1) "c" -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "15 and then some" in %s on line %d string(1) "r" @@ -67,7 +67,7 @@ string(1) "i" Warning: String offset cast occurred in %s on line %d string(1) "S" -Cannot access offset of type resource on string -Cannot access offset of type stdClass on string -Cannot access offset of type array on string +TypeError: Cannot access offset of type resource on string +TypeError: Cannot access offset of type stdClass on string +TypeError: Cannot access offset of type array on string Done diff --git a/Zend/tests/offsets/appending_containers.phpt b/Zend/tests/offsets/appending_containers.phpt index 0372c28bf184..85eb50812468 100644 --- a/Zend/tests/offsets/appending_containers.phpt +++ b/Zend/tests/offsets/appending_containers.phpt @@ -11,7 +11,7 @@ foreach ($containers as $container) { $container[] = 'value'; var_dump($container); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -30,26 +30,26 @@ array(1) { string(5) "value" } true container: -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array 4 container: -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array 5.5 container: -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array '10' container: -[] operator not supported for strings +Error: [] operator not supported for strings '25.5' container: -[] operator not supported for strings +Error: [] operator not supported for strings 'string' container: -[] operator not supported for strings +Error: [] operator not supported for strings [] container: array(1) { [0]=> string(5) "value" } STDERR container: -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array new stdClass() container: -Cannot use object of type stdClass as array +Error: Cannot use object of type stdClass as array new ArrayObject() container: object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> diff --git a/Zend/tests/operator_unsupported_types.phpt b/Zend/tests/operator_unsupported_types.phpt index 904ac402b372..e6923b4e64f3 100644 --- a/Zend/tests/operator_unsupported_types.phpt +++ b/Zend/tests/operator_unsupported_types.phpt @@ -46,7 +46,7 @@ function evalBinOp(string $op, string $value1, string $value2) { eval("return $value1 $op $value2;"); echo "No error for $value1 $op $value2\n"; } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -56,7 +56,7 @@ function evalAssignOp(string $op, string $value1, string $value2) { eval("\$x $op= $value2;"); echo "No error for $value1 $op= $value2\n"; } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; if ($x !== $origX) { die("Value corrupted!"); } @@ -101,7 +101,7 @@ foreach ($illegalValues as $illegalValue) { eval("return ~$illegalValue;"); echo "No error for ~$illegalValue\n"; } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -112,14 +112,14 @@ foreach ($illegalValues as $illegalValue) { $copy++; echo "No error for $copy++\n"; } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $copy = eval("return $illegalValue;"); try { $copy--; echo "No error for $copy--\n"; } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -127,844 +127,844 @@ foreach ($illegalValues as $illegalValue) { --EXPECT-- BINARY OP: No error for [] + [] -Unsupported operand types: array + stdClass -Unsupported operand types: array + resource -Unsupported operand types: array + string -Unsupported operand types: stdClass + array -Unsupported operand types: stdClass + stdClass -Unsupported operand types: stdClass + resource -Unsupported operand types: stdClass + string -Unsupported operand types: resource + array -Unsupported operand types: resource + stdClass -Unsupported operand types: resource + resource -Unsupported operand types: resource + string -Unsupported operand types: string + array -Unsupported operand types: string + stdClass -Unsupported operand types: string + resource -Unsupported operand types: string + string -Unsupported operand types: array + null -Unsupported operand types: null + array -Unsupported operand types: array + bool -Unsupported operand types: bool + array -Unsupported operand types: array + bool -Unsupported operand types: bool + array -Unsupported operand types: array + int -Unsupported operand types: int + array -Unsupported operand types: array + float -Unsupported operand types: float + array -Unsupported operand types: array + string -Unsupported operand types: string + array -Unsupported operand types: array + string -Warning: A non-numeric value encountered -Unsupported operand types: string + array -Unsupported operand types: stdClass + null -Unsupported operand types: null + stdClass -Unsupported operand types: stdClass + bool -Unsupported operand types: bool + stdClass -Unsupported operand types: stdClass + bool -Unsupported operand types: bool + stdClass -Unsupported operand types: stdClass + int -Unsupported operand types: int + stdClass -Unsupported operand types: stdClass + float -Unsupported operand types: float + stdClass -Unsupported operand types: stdClass + string -Unsupported operand types: string + stdClass -Unsupported operand types: stdClass + string -Warning: A non-numeric value encountered -Unsupported operand types: string + stdClass -Unsupported operand types: resource + null -Unsupported operand types: null + resource -Unsupported operand types: resource + bool -Unsupported operand types: bool + resource -Unsupported operand types: resource + bool -Unsupported operand types: bool + resource -Unsupported operand types: resource + int -Unsupported operand types: int + resource -Unsupported operand types: resource + float -Unsupported operand types: float + resource -Unsupported operand types: resource + string -Unsupported operand types: string + resource -Unsupported operand types: resource + string -Warning: A non-numeric value encountered -Unsupported operand types: string + resource -Unsupported operand types: string + null -Unsupported operand types: null + string -Unsupported operand types: string + bool -Unsupported operand types: bool + string -Unsupported operand types: string + bool -Unsupported operand types: bool + string -Unsupported operand types: string + int -Unsupported operand types: int + string -Unsupported operand types: string + float -Unsupported operand types: float + string -Unsupported operand types: string + string -Unsupported operand types: string + string -Unsupported operand types: string + string -Warning: A non-numeric value encountered -Unsupported operand types: string + string -Unsupported operand types: array - array -Unsupported operand types: array - stdClass -Unsupported operand types: array - resource -Unsupported operand types: array - string -Unsupported operand types: stdClass - array -Unsupported operand types: stdClass - stdClass -Unsupported operand types: stdClass - resource -Unsupported operand types: stdClass - string -Unsupported operand types: resource - array -Unsupported operand types: resource - stdClass -Unsupported operand types: resource - resource -Unsupported operand types: resource - string -Unsupported operand types: string - array -Unsupported operand types: string - stdClass -Unsupported operand types: string - resource -Unsupported operand types: string - string -Unsupported operand types: array - null -Unsupported operand types: null - array -Unsupported operand types: array - bool -Unsupported operand types: bool - array -Unsupported operand types: array - bool -Unsupported operand types: bool - array -Unsupported operand types: array - int -Unsupported operand types: int - array -Unsupported operand types: array - float -Unsupported operand types: float - array -Unsupported operand types: array - string -Unsupported operand types: string - array -Unsupported operand types: array - string -Warning: A non-numeric value encountered -Unsupported operand types: string - array -Unsupported operand types: stdClass - null -Unsupported operand types: null - stdClass -Unsupported operand types: stdClass - bool -Unsupported operand types: bool - stdClass -Unsupported operand types: stdClass - bool -Unsupported operand types: bool - stdClass -Unsupported operand types: stdClass - int -Unsupported operand types: int - stdClass -Unsupported operand types: stdClass - float -Unsupported operand types: float - stdClass -Unsupported operand types: stdClass - string -Unsupported operand types: string - stdClass -Unsupported operand types: stdClass - string -Warning: A non-numeric value encountered -Unsupported operand types: string - stdClass -Unsupported operand types: resource - null -Unsupported operand types: null - resource -Unsupported operand types: resource - bool -Unsupported operand types: bool - resource -Unsupported operand types: resource - bool -Unsupported operand types: bool - resource -Unsupported operand types: resource - int -Unsupported operand types: int - resource -Unsupported operand types: resource - float -Unsupported operand types: float - resource -Unsupported operand types: resource - string -Unsupported operand types: string - resource -Unsupported operand types: resource - string -Warning: A non-numeric value encountered -Unsupported operand types: string - resource -Unsupported operand types: string - null -Unsupported operand types: null - string -Unsupported operand types: string - bool -Unsupported operand types: bool - string -Unsupported operand types: string - bool -Unsupported operand types: bool - string -Unsupported operand types: string - int -Unsupported operand types: int - string -Unsupported operand types: string - float -Unsupported operand types: float - string -Unsupported operand types: string - string -Unsupported operand types: string - string -Unsupported operand types: string - string -Warning: A non-numeric value encountered -Unsupported operand types: string - string -Unsupported operand types: array * array -Unsupported operand types: stdClass * array -Unsupported operand types: resource * array -Unsupported operand types: array * string -Unsupported operand types: stdClass * array -Unsupported operand types: stdClass * stdClass -Unsupported operand types: stdClass * resource -Unsupported operand types: stdClass * string -Unsupported operand types: resource * array -Unsupported operand types: resource * stdClass -Unsupported operand types: resource * resource -Unsupported operand types: resource * string -Unsupported operand types: string * array -Unsupported operand types: stdClass * string -Unsupported operand types: resource * string -Unsupported operand types: string * string -Unsupported operand types: array * null -Unsupported operand types: null * array -Unsupported operand types: array * bool -Unsupported operand types: bool * array -Unsupported operand types: array * bool -Unsupported operand types: bool * array -Unsupported operand types: array * int -Unsupported operand types: int * array -Unsupported operand types: array * float -Unsupported operand types: float * array -Unsupported operand types: array * string -Unsupported operand types: string * array -Unsupported operand types: array * string -Warning: A non-numeric value encountered -Unsupported operand types: string * array -Unsupported operand types: stdClass * null -Unsupported operand types: stdClass * null -Unsupported operand types: stdClass * bool -Unsupported operand types: stdClass * bool -Unsupported operand types: stdClass * bool -Unsupported operand types: stdClass * bool -Unsupported operand types: stdClass * int -Unsupported operand types: stdClass * int -Unsupported operand types: stdClass * float -Unsupported operand types: stdClass * float -Unsupported operand types: stdClass * string -Unsupported operand types: stdClass * string -Unsupported operand types: stdClass * string -Unsupported operand types: stdClass * string -Unsupported operand types: resource * null -Unsupported operand types: resource * null -Unsupported operand types: resource * bool -Unsupported operand types: resource * bool -Unsupported operand types: resource * bool -Unsupported operand types: resource * bool -Unsupported operand types: resource * int -Unsupported operand types: resource * int -Unsupported operand types: resource * float -Unsupported operand types: resource * float -Unsupported operand types: resource * string -Unsupported operand types: resource * string -Unsupported operand types: resource * string -Unsupported operand types: resource * string -Unsupported operand types: string * null -Unsupported operand types: null * string -Unsupported operand types: string * bool -Unsupported operand types: bool * string -Unsupported operand types: string * bool -Unsupported operand types: bool * string -Unsupported operand types: string * int -Unsupported operand types: int * string -Unsupported operand types: string * float -Unsupported operand types: float * string -Unsupported operand types: string * string -Unsupported operand types: string * string -Unsupported operand types: string * string -Warning: A non-numeric value encountered -Unsupported operand types: string * string -Unsupported operand types: array / array -Unsupported operand types: array / stdClass -Unsupported operand types: array / resource -Unsupported operand types: array / string -Unsupported operand types: stdClass / array -Unsupported operand types: stdClass / stdClass -Unsupported operand types: stdClass / resource -Unsupported operand types: stdClass / string -Unsupported operand types: resource / array -Unsupported operand types: resource / stdClass -Unsupported operand types: resource / resource -Unsupported operand types: resource / string -Unsupported operand types: string / array -Unsupported operand types: string / stdClass -Unsupported operand types: string / resource -Unsupported operand types: string / string -Unsupported operand types: array / null -Unsupported operand types: null / array -Unsupported operand types: array / bool -Unsupported operand types: bool / array -Unsupported operand types: array / bool -Unsupported operand types: bool / array -Unsupported operand types: array / int -Unsupported operand types: int / array -Unsupported operand types: array / float -Unsupported operand types: float / array -Unsupported operand types: array / string -Unsupported operand types: string / array -Unsupported operand types: array / string -Warning: A non-numeric value encountered -Unsupported operand types: string / array -Unsupported operand types: stdClass / null -Unsupported operand types: null / stdClass -Unsupported operand types: stdClass / bool -Unsupported operand types: bool / stdClass -Unsupported operand types: stdClass / bool -Unsupported operand types: bool / stdClass -Unsupported operand types: stdClass / int -Unsupported operand types: int / stdClass -Unsupported operand types: stdClass / float -Unsupported operand types: float / stdClass -Unsupported operand types: stdClass / string -Unsupported operand types: string / stdClass -Unsupported operand types: stdClass / string -Warning: A non-numeric value encountered -Unsupported operand types: string / stdClass -Unsupported operand types: resource / null -Unsupported operand types: null / resource -Unsupported operand types: resource / bool -Unsupported operand types: bool / resource -Unsupported operand types: resource / bool -Unsupported operand types: bool / resource -Unsupported operand types: resource / int -Unsupported operand types: int / resource -Unsupported operand types: resource / float -Unsupported operand types: float / resource -Unsupported operand types: resource / string -Unsupported operand types: string / resource -Unsupported operand types: resource / string -Warning: A non-numeric value encountered -Unsupported operand types: string / resource -Unsupported operand types: string / null -Unsupported operand types: null / string -Unsupported operand types: string / bool -Unsupported operand types: bool / string -Unsupported operand types: string / bool -Unsupported operand types: bool / string -Unsupported operand types: string / int -Unsupported operand types: int / string -Unsupported operand types: string / float -Unsupported operand types: float / string -Unsupported operand types: string / string -Unsupported operand types: string / string -Unsupported operand types: string / string -Warning: A non-numeric value encountered -Unsupported operand types: string / string -Unsupported operand types: array % array -Unsupported operand types: array % stdClass -Unsupported operand types: array % resource -Unsupported operand types: array % string -Unsupported operand types: stdClass % array -Unsupported operand types: stdClass % stdClass -Unsupported operand types: stdClass % resource -Unsupported operand types: stdClass % string -Unsupported operand types: resource % array -Unsupported operand types: resource % stdClass -Unsupported operand types: resource % resource -Unsupported operand types: resource % string -Unsupported operand types: string % array -Unsupported operand types: string % stdClass -Unsupported operand types: string % resource -Unsupported operand types: string % string -Unsupported operand types: array % null -Unsupported operand types: null % array -Unsupported operand types: array % bool -Unsupported operand types: bool % array -Unsupported operand types: array % bool -Unsupported operand types: bool % array -Unsupported operand types: array % int -Unsupported operand types: int % array -Unsupported operand types: array % float +TypeError: Unsupported operand types: array + stdClass +TypeError: Unsupported operand types: array + resource +TypeError: Unsupported operand types: array + string +TypeError: Unsupported operand types: stdClass + array +TypeError: Unsupported operand types: stdClass + stdClass +TypeError: Unsupported operand types: stdClass + resource +TypeError: Unsupported operand types: stdClass + string +TypeError: Unsupported operand types: resource + array +TypeError: Unsupported operand types: resource + stdClass +TypeError: Unsupported operand types: resource + resource +TypeError: Unsupported operand types: resource + string +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: array + null +TypeError: Unsupported operand types: null + array +TypeError: Unsupported operand types: array + bool +TypeError: Unsupported operand types: bool + array +TypeError: Unsupported operand types: array + bool +TypeError: Unsupported operand types: bool + array +TypeError: Unsupported operand types: array + int +TypeError: Unsupported operand types: int + array +TypeError: Unsupported operand types: array + float +TypeError: Unsupported operand types: float + array +TypeError: Unsupported operand types: array + string +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: array + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: stdClass + null +TypeError: Unsupported operand types: null + stdClass +TypeError: Unsupported operand types: stdClass + bool +TypeError: Unsupported operand types: bool + stdClass +TypeError: Unsupported operand types: stdClass + bool +TypeError: Unsupported operand types: bool + stdClass +TypeError: Unsupported operand types: stdClass + int +TypeError: Unsupported operand types: int + stdClass +TypeError: Unsupported operand types: stdClass + float +TypeError: Unsupported operand types: float + stdClass +TypeError: Unsupported operand types: stdClass + string +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: stdClass + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: resource + null +TypeError: Unsupported operand types: null + resource +TypeError: Unsupported operand types: resource + bool +TypeError: Unsupported operand types: bool + resource +TypeError: Unsupported operand types: resource + bool +TypeError: Unsupported operand types: bool + resource +TypeError: Unsupported operand types: resource + int +TypeError: Unsupported operand types: int + resource +TypeError: Unsupported operand types: resource + float +TypeError: Unsupported operand types: float + resource +TypeError: Unsupported operand types: resource + string +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: resource + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: string + null +TypeError: Unsupported operand types: null + string +TypeError: Unsupported operand types: string + bool +TypeError: Unsupported operand types: bool + string +TypeError: Unsupported operand types: string + bool +TypeError: Unsupported operand types: bool + string +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: int + string +TypeError: Unsupported operand types: string + float +TypeError: Unsupported operand types: float + string +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: array - array +TypeError: Unsupported operand types: array - stdClass +TypeError: Unsupported operand types: array - resource +TypeError: Unsupported operand types: array - string +TypeError: Unsupported operand types: stdClass - array +TypeError: Unsupported operand types: stdClass - stdClass +TypeError: Unsupported operand types: stdClass - resource +TypeError: Unsupported operand types: stdClass - string +TypeError: Unsupported operand types: resource - array +TypeError: Unsupported operand types: resource - stdClass +TypeError: Unsupported operand types: resource - resource +TypeError: Unsupported operand types: resource - string +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: array - null +TypeError: Unsupported operand types: null - array +TypeError: Unsupported operand types: array - bool +TypeError: Unsupported operand types: bool - array +TypeError: Unsupported operand types: array - bool +TypeError: Unsupported operand types: bool - array +TypeError: Unsupported operand types: array - int +TypeError: Unsupported operand types: int - array +TypeError: Unsupported operand types: array - float +TypeError: Unsupported operand types: float - array +TypeError: Unsupported operand types: array - string +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: array - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: stdClass - null +TypeError: Unsupported operand types: null - stdClass +TypeError: Unsupported operand types: stdClass - bool +TypeError: Unsupported operand types: bool - stdClass +TypeError: Unsupported operand types: stdClass - bool +TypeError: Unsupported operand types: bool - stdClass +TypeError: Unsupported operand types: stdClass - int +TypeError: Unsupported operand types: int - stdClass +TypeError: Unsupported operand types: stdClass - float +TypeError: Unsupported operand types: float - stdClass +TypeError: Unsupported operand types: stdClass - string +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: stdClass - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: resource - null +TypeError: Unsupported operand types: null - resource +TypeError: Unsupported operand types: resource - bool +TypeError: Unsupported operand types: bool - resource +TypeError: Unsupported operand types: resource - bool +TypeError: Unsupported operand types: bool - resource +TypeError: Unsupported operand types: resource - int +TypeError: Unsupported operand types: int - resource +TypeError: Unsupported operand types: resource - float +TypeError: Unsupported operand types: float - resource +TypeError: Unsupported operand types: resource - string +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: resource - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: string - null +TypeError: Unsupported operand types: null - string +TypeError: Unsupported operand types: string - bool +TypeError: Unsupported operand types: bool - string +TypeError: Unsupported operand types: string - bool +TypeError: Unsupported operand types: bool - string +TypeError: Unsupported operand types: string - int +TypeError: Unsupported operand types: int - string +TypeError: Unsupported operand types: string - float +TypeError: Unsupported operand types: float - string +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: array * array +TypeError: Unsupported operand types: stdClass * array +TypeError: Unsupported operand types: resource * array +TypeError: Unsupported operand types: array * string +TypeError: Unsupported operand types: stdClass * array +TypeError: Unsupported operand types: stdClass * stdClass +TypeError: Unsupported operand types: stdClass * resource +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: resource * array +TypeError: Unsupported operand types: resource * stdClass +TypeError: Unsupported operand types: resource * resource +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: array * null +TypeError: Unsupported operand types: null * array +TypeError: Unsupported operand types: array * bool +TypeError: Unsupported operand types: bool * array +TypeError: Unsupported operand types: array * bool +TypeError: Unsupported operand types: bool * array +TypeError: Unsupported operand types: array * int +TypeError: Unsupported operand types: int * array +TypeError: Unsupported operand types: array * float +TypeError: Unsupported operand types: float * array +TypeError: Unsupported operand types: array * string +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: array * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: stdClass * null +TypeError: Unsupported operand types: stdClass * null +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: stdClass * int +TypeError: Unsupported operand types: stdClass * int +TypeError: Unsupported operand types: stdClass * float +TypeError: Unsupported operand types: stdClass * float +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: resource * null +TypeError: Unsupported operand types: resource * null +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: resource * int +TypeError: Unsupported operand types: resource * int +TypeError: Unsupported operand types: resource * float +TypeError: Unsupported operand types: resource * float +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: string * null +TypeError: Unsupported operand types: null * string +TypeError: Unsupported operand types: string * bool +TypeError: Unsupported operand types: bool * string +TypeError: Unsupported operand types: string * bool +TypeError: Unsupported operand types: bool * string +TypeError: Unsupported operand types: string * int +TypeError: Unsupported operand types: int * string +TypeError: Unsupported operand types: string * float +TypeError: Unsupported operand types: float * string +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: array / array +TypeError: Unsupported operand types: array / stdClass +TypeError: Unsupported operand types: array / resource +TypeError: Unsupported operand types: array / string +TypeError: Unsupported operand types: stdClass / array +TypeError: Unsupported operand types: stdClass / stdClass +TypeError: Unsupported operand types: stdClass / resource +TypeError: Unsupported operand types: stdClass / string +TypeError: Unsupported operand types: resource / array +TypeError: Unsupported operand types: resource / stdClass +TypeError: Unsupported operand types: resource / resource +TypeError: Unsupported operand types: resource / string +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: array / null +TypeError: Unsupported operand types: null / array +TypeError: Unsupported operand types: array / bool +TypeError: Unsupported operand types: bool / array +TypeError: Unsupported operand types: array / bool +TypeError: Unsupported operand types: bool / array +TypeError: Unsupported operand types: array / int +TypeError: Unsupported operand types: int / array +TypeError: Unsupported operand types: array / float +TypeError: Unsupported operand types: float / array +TypeError: Unsupported operand types: array / string +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: array / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: stdClass / null +TypeError: Unsupported operand types: null / stdClass +TypeError: Unsupported operand types: stdClass / bool +TypeError: Unsupported operand types: bool / stdClass +TypeError: Unsupported operand types: stdClass / bool +TypeError: Unsupported operand types: bool / stdClass +TypeError: Unsupported operand types: stdClass / int +TypeError: Unsupported operand types: int / stdClass +TypeError: Unsupported operand types: stdClass / float +TypeError: Unsupported operand types: float / stdClass +TypeError: Unsupported operand types: stdClass / string +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: stdClass / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: resource / null +TypeError: Unsupported operand types: null / resource +TypeError: Unsupported operand types: resource / bool +TypeError: Unsupported operand types: bool / resource +TypeError: Unsupported operand types: resource / bool +TypeError: Unsupported operand types: bool / resource +TypeError: Unsupported operand types: resource / int +TypeError: Unsupported operand types: int / resource +TypeError: Unsupported operand types: resource / float +TypeError: Unsupported operand types: float / resource +TypeError: Unsupported operand types: resource / string +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: resource / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: string / null +TypeError: Unsupported operand types: null / string +TypeError: Unsupported operand types: string / bool +TypeError: Unsupported operand types: bool / string +TypeError: Unsupported operand types: string / bool +TypeError: Unsupported operand types: bool / string +TypeError: Unsupported operand types: string / int +TypeError: Unsupported operand types: int / string +TypeError: Unsupported operand types: string / float +TypeError: Unsupported operand types: float / string +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: array % array +TypeError: Unsupported operand types: array % stdClass +TypeError: Unsupported operand types: array % resource +TypeError: Unsupported operand types: array % string +TypeError: Unsupported operand types: stdClass % array +TypeError: Unsupported operand types: stdClass % stdClass +TypeError: Unsupported operand types: stdClass % resource +TypeError: Unsupported operand types: stdClass % string +TypeError: Unsupported operand types: resource % array +TypeError: Unsupported operand types: resource % stdClass +TypeError: Unsupported operand types: resource % resource +TypeError: Unsupported operand types: resource % string +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: array % null +TypeError: Unsupported operand types: null % array +TypeError: Unsupported operand types: array % bool +TypeError: Unsupported operand types: bool % array +TypeError: Unsupported operand types: array % bool +TypeError: Unsupported operand types: bool % array +TypeError: Unsupported operand types: array % int +TypeError: Unsupported operand types: int % array +TypeError: Unsupported operand types: array % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % array -Unsupported operand types: array % string -Unsupported operand types: string % array -Unsupported operand types: array % string -Warning: A non-numeric value encountered -Unsupported operand types: string % array -Unsupported operand types: stdClass % null -Unsupported operand types: null % stdClass -Unsupported operand types: stdClass % bool -Unsupported operand types: bool % stdClass -Unsupported operand types: stdClass % bool -Unsupported operand types: bool % stdClass -Unsupported operand types: stdClass % int -Unsupported operand types: int % stdClass -Unsupported operand types: stdClass % float +TypeError: Unsupported operand types: float % array +TypeError: Unsupported operand types: array % string +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: array % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: stdClass % null +TypeError: Unsupported operand types: null % stdClass +TypeError: Unsupported operand types: stdClass % bool +TypeError: Unsupported operand types: bool % stdClass +TypeError: Unsupported operand types: stdClass % bool +TypeError: Unsupported operand types: bool % stdClass +TypeError: Unsupported operand types: stdClass % int +TypeError: Unsupported operand types: int % stdClass +TypeError: Unsupported operand types: stdClass % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % stdClass -Unsupported operand types: stdClass % string -Unsupported operand types: string % stdClass -Unsupported operand types: stdClass % string -Warning: A non-numeric value encountered -Unsupported operand types: string % stdClass -Unsupported operand types: resource % null -Unsupported operand types: null % resource -Unsupported operand types: resource % bool -Unsupported operand types: bool % resource -Unsupported operand types: resource % bool -Unsupported operand types: bool % resource -Unsupported operand types: resource % int -Unsupported operand types: int % resource -Unsupported operand types: resource % float +TypeError: Unsupported operand types: float % stdClass +TypeError: Unsupported operand types: stdClass % string +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: stdClass % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: resource % null +TypeError: Unsupported operand types: null % resource +TypeError: Unsupported operand types: resource % bool +TypeError: Unsupported operand types: bool % resource +TypeError: Unsupported operand types: resource % bool +TypeError: Unsupported operand types: bool % resource +TypeError: Unsupported operand types: resource % int +TypeError: Unsupported operand types: int % resource +TypeError: Unsupported operand types: resource % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % resource -Unsupported operand types: resource % string -Unsupported operand types: string % resource -Unsupported operand types: resource % string -Warning: A non-numeric value encountered -Unsupported operand types: string % resource -Unsupported operand types: string % null -Unsupported operand types: null % string -Unsupported operand types: string % bool -Unsupported operand types: bool % string -Unsupported operand types: string % bool -Unsupported operand types: bool % string -Unsupported operand types: string % int -Unsupported operand types: int % string -Unsupported operand types: string % float +TypeError: Unsupported operand types: float % resource +TypeError: Unsupported operand types: resource % string +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: resource % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: string % null +TypeError: Unsupported operand types: null % string +TypeError: Unsupported operand types: string % bool +TypeError: Unsupported operand types: bool % string +TypeError: Unsupported operand types: string % bool +TypeError: Unsupported operand types: bool % string +TypeError: Unsupported operand types: string % int +TypeError: Unsupported operand types: int % string +TypeError: Unsupported operand types: string % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % string -Unsupported operand types: string % string -Unsupported operand types: string % string -Unsupported operand types: string % string -Warning: A non-numeric value encountered -Unsupported operand types: string % string -Unsupported operand types: array ** array -Unsupported operand types: array ** stdClass -Unsupported operand types: array ** resource -Unsupported operand types: array ** string -Unsupported operand types: stdClass ** array -Unsupported operand types: stdClass ** stdClass -Unsupported operand types: stdClass ** resource -Unsupported operand types: stdClass ** string -Unsupported operand types: resource ** array -Unsupported operand types: resource ** stdClass -Unsupported operand types: resource ** resource -Unsupported operand types: resource ** string -Unsupported operand types: string ** array -Unsupported operand types: string ** stdClass -Unsupported operand types: string ** resource -Unsupported operand types: string ** string -Unsupported operand types: array ** null -Unsupported operand types: null ** array -Unsupported operand types: array ** bool -Unsupported operand types: bool ** array -Unsupported operand types: array ** bool -Unsupported operand types: bool ** array -Unsupported operand types: array ** int -Unsupported operand types: int ** array -Unsupported operand types: array ** float -Unsupported operand types: float ** array -Unsupported operand types: array ** string -Unsupported operand types: string ** array -Unsupported operand types: array ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** array -Unsupported operand types: stdClass ** null -Unsupported operand types: null ** stdClass -Unsupported operand types: stdClass ** bool -Unsupported operand types: bool ** stdClass -Unsupported operand types: stdClass ** bool -Unsupported operand types: bool ** stdClass -Unsupported operand types: stdClass ** int -Unsupported operand types: int ** stdClass -Unsupported operand types: stdClass ** float -Unsupported operand types: float ** stdClass -Unsupported operand types: stdClass ** string -Unsupported operand types: string ** stdClass -Unsupported operand types: stdClass ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** stdClass -Unsupported operand types: resource ** null -Unsupported operand types: null ** resource -Unsupported operand types: resource ** bool -Unsupported operand types: bool ** resource -Unsupported operand types: resource ** bool -Unsupported operand types: bool ** resource -Unsupported operand types: resource ** int -Unsupported operand types: int ** resource -Unsupported operand types: resource ** float -Unsupported operand types: float ** resource -Unsupported operand types: resource ** string -Unsupported operand types: string ** resource -Unsupported operand types: resource ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** resource -Unsupported operand types: string ** null -Unsupported operand types: null ** string -Unsupported operand types: string ** bool -Unsupported operand types: bool ** string -Unsupported operand types: string ** bool -Unsupported operand types: bool ** string -Unsupported operand types: string ** int -Unsupported operand types: int ** string -Unsupported operand types: string ** float -Unsupported operand types: float ** string -Unsupported operand types: string ** string -Unsupported operand types: string ** string -Unsupported operand types: string ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** string -Unsupported operand types: array << array -Unsupported operand types: array << stdClass -Unsupported operand types: array << resource -Unsupported operand types: array << string -Unsupported operand types: stdClass << array -Unsupported operand types: stdClass << stdClass -Unsupported operand types: stdClass << resource -Unsupported operand types: stdClass << string -Unsupported operand types: resource << array -Unsupported operand types: resource << stdClass -Unsupported operand types: resource << resource -Unsupported operand types: resource << string -Unsupported operand types: string << array -Unsupported operand types: string << stdClass -Unsupported operand types: string << resource -Unsupported operand types: string << string -Unsupported operand types: array << null -Unsupported operand types: null << array -Unsupported operand types: array << bool -Unsupported operand types: bool << array -Unsupported operand types: array << bool -Unsupported operand types: bool << array -Unsupported operand types: array << int -Unsupported operand types: int << array -Unsupported operand types: array << float +TypeError: Unsupported operand types: float % string +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: string % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: array ** array +TypeError: Unsupported operand types: array ** stdClass +TypeError: Unsupported operand types: array ** resource +TypeError: Unsupported operand types: array ** string +TypeError: Unsupported operand types: stdClass ** array +TypeError: Unsupported operand types: stdClass ** stdClass +TypeError: Unsupported operand types: stdClass ** resource +TypeError: Unsupported operand types: stdClass ** string +TypeError: Unsupported operand types: resource ** array +TypeError: Unsupported operand types: resource ** stdClass +TypeError: Unsupported operand types: resource ** resource +TypeError: Unsupported operand types: resource ** string +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: array ** null +TypeError: Unsupported operand types: null ** array +TypeError: Unsupported operand types: array ** bool +TypeError: Unsupported operand types: bool ** array +TypeError: Unsupported operand types: array ** bool +TypeError: Unsupported operand types: bool ** array +TypeError: Unsupported operand types: array ** int +TypeError: Unsupported operand types: int ** array +TypeError: Unsupported operand types: array ** float +TypeError: Unsupported operand types: float ** array +TypeError: Unsupported operand types: array ** string +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: array ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: stdClass ** null +TypeError: Unsupported operand types: null ** stdClass +TypeError: Unsupported operand types: stdClass ** bool +TypeError: Unsupported operand types: bool ** stdClass +TypeError: Unsupported operand types: stdClass ** bool +TypeError: Unsupported operand types: bool ** stdClass +TypeError: Unsupported operand types: stdClass ** int +TypeError: Unsupported operand types: int ** stdClass +TypeError: Unsupported operand types: stdClass ** float +TypeError: Unsupported operand types: float ** stdClass +TypeError: Unsupported operand types: stdClass ** string +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: stdClass ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: resource ** null +TypeError: Unsupported operand types: null ** resource +TypeError: Unsupported operand types: resource ** bool +TypeError: Unsupported operand types: bool ** resource +TypeError: Unsupported operand types: resource ** bool +TypeError: Unsupported operand types: bool ** resource +TypeError: Unsupported operand types: resource ** int +TypeError: Unsupported operand types: int ** resource +TypeError: Unsupported operand types: resource ** float +TypeError: Unsupported operand types: float ** resource +TypeError: Unsupported operand types: resource ** string +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: resource ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: string ** null +TypeError: Unsupported operand types: null ** string +TypeError: Unsupported operand types: string ** bool +TypeError: Unsupported operand types: bool ** string +TypeError: Unsupported operand types: string ** bool +TypeError: Unsupported operand types: bool ** string +TypeError: Unsupported operand types: string ** int +TypeError: Unsupported operand types: int ** string +TypeError: Unsupported operand types: string ** float +TypeError: Unsupported operand types: float ** string +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: array << array +TypeError: Unsupported operand types: array << stdClass +TypeError: Unsupported operand types: array << resource +TypeError: Unsupported operand types: array << string +TypeError: Unsupported operand types: stdClass << array +TypeError: Unsupported operand types: stdClass << stdClass +TypeError: Unsupported operand types: stdClass << resource +TypeError: Unsupported operand types: stdClass << string +TypeError: Unsupported operand types: resource << array +TypeError: Unsupported operand types: resource << stdClass +TypeError: Unsupported operand types: resource << resource +TypeError: Unsupported operand types: resource << string +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: array << null +TypeError: Unsupported operand types: null << array +TypeError: Unsupported operand types: array << bool +TypeError: Unsupported operand types: bool << array +TypeError: Unsupported operand types: array << bool +TypeError: Unsupported operand types: bool << array +TypeError: Unsupported operand types: array << int +TypeError: Unsupported operand types: int << array +TypeError: Unsupported operand types: array << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << array -Unsupported operand types: array << string -Unsupported operand types: string << array -Unsupported operand types: array << string -Warning: A non-numeric value encountered -Unsupported operand types: string << array -Unsupported operand types: stdClass << null -Unsupported operand types: null << stdClass -Unsupported operand types: stdClass << bool -Unsupported operand types: bool << stdClass -Unsupported operand types: stdClass << bool -Unsupported operand types: bool << stdClass -Unsupported operand types: stdClass << int -Unsupported operand types: int << stdClass -Unsupported operand types: stdClass << float +TypeError: Unsupported operand types: float << array +TypeError: Unsupported operand types: array << string +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: array << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: stdClass << null +TypeError: Unsupported operand types: null << stdClass +TypeError: Unsupported operand types: stdClass << bool +TypeError: Unsupported operand types: bool << stdClass +TypeError: Unsupported operand types: stdClass << bool +TypeError: Unsupported operand types: bool << stdClass +TypeError: Unsupported operand types: stdClass << int +TypeError: Unsupported operand types: int << stdClass +TypeError: Unsupported operand types: stdClass << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << stdClass -Unsupported operand types: stdClass << string -Unsupported operand types: string << stdClass -Unsupported operand types: stdClass << string -Warning: A non-numeric value encountered -Unsupported operand types: string << stdClass -Unsupported operand types: resource << null -Unsupported operand types: null << resource -Unsupported operand types: resource << bool -Unsupported operand types: bool << resource -Unsupported operand types: resource << bool -Unsupported operand types: bool << resource -Unsupported operand types: resource << int -Unsupported operand types: int << resource -Unsupported operand types: resource << float +TypeError: Unsupported operand types: float << stdClass +TypeError: Unsupported operand types: stdClass << string +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: stdClass << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: resource << null +TypeError: Unsupported operand types: null << resource +TypeError: Unsupported operand types: resource << bool +TypeError: Unsupported operand types: bool << resource +TypeError: Unsupported operand types: resource << bool +TypeError: Unsupported operand types: bool << resource +TypeError: Unsupported operand types: resource << int +TypeError: Unsupported operand types: int << resource +TypeError: Unsupported operand types: resource << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << resource -Unsupported operand types: resource << string -Unsupported operand types: string << resource -Unsupported operand types: resource << string -Warning: A non-numeric value encountered -Unsupported operand types: string << resource -Unsupported operand types: string << null -Unsupported operand types: null << string -Unsupported operand types: string << bool -Unsupported operand types: bool << string -Unsupported operand types: string << bool -Unsupported operand types: bool << string -Unsupported operand types: string << int -Unsupported operand types: int << string -Unsupported operand types: string << float +TypeError: Unsupported operand types: float << resource +TypeError: Unsupported operand types: resource << string +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: resource << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: string << null +TypeError: Unsupported operand types: null << string +TypeError: Unsupported operand types: string << bool +TypeError: Unsupported operand types: bool << string +TypeError: Unsupported operand types: string << bool +TypeError: Unsupported operand types: bool << string +TypeError: Unsupported operand types: string << int +TypeError: Unsupported operand types: int << string +TypeError: Unsupported operand types: string << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << string -Unsupported operand types: string << string -Unsupported operand types: string << string -Unsupported operand types: string << string -Warning: A non-numeric value encountered -Unsupported operand types: string << string -Unsupported operand types: array >> array -Unsupported operand types: array >> stdClass -Unsupported operand types: array >> resource -Unsupported operand types: array >> string -Unsupported operand types: stdClass >> array -Unsupported operand types: stdClass >> stdClass -Unsupported operand types: stdClass >> resource -Unsupported operand types: stdClass >> string -Unsupported operand types: resource >> array -Unsupported operand types: resource >> stdClass -Unsupported operand types: resource >> resource -Unsupported operand types: resource >> string -Unsupported operand types: string >> array -Unsupported operand types: string >> stdClass -Unsupported operand types: string >> resource -Unsupported operand types: string >> string -Unsupported operand types: array >> null -Unsupported operand types: null >> array -Unsupported operand types: array >> bool -Unsupported operand types: bool >> array -Unsupported operand types: array >> bool -Unsupported operand types: bool >> array -Unsupported operand types: array >> int -Unsupported operand types: int >> array -Unsupported operand types: array >> float +TypeError: Unsupported operand types: float << string +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: array >> array +TypeError: Unsupported operand types: array >> stdClass +TypeError: Unsupported operand types: array >> resource +TypeError: Unsupported operand types: array >> string +TypeError: Unsupported operand types: stdClass >> array +TypeError: Unsupported operand types: stdClass >> stdClass +TypeError: Unsupported operand types: stdClass >> resource +TypeError: Unsupported operand types: stdClass >> string +TypeError: Unsupported operand types: resource >> array +TypeError: Unsupported operand types: resource >> stdClass +TypeError: Unsupported operand types: resource >> resource +TypeError: Unsupported operand types: resource >> string +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: array >> null +TypeError: Unsupported operand types: null >> array +TypeError: Unsupported operand types: array >> bool +TypeError: Unsupported operand types: bool >> array +TypeError: Unsupported operand types: array >> bool +TypeError: Unsupported operand types: bool >> array +TypeError: Unsupported operand types: array >> int +TypeError: Unsupported operand types: int >> array +TypeError: Unsupported operand types: array >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> array -Unsupported operand types: array >> string -Unsupported operand types: string >> array -Unsupported operand types: array >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> array -Unsupported operand types: stdClass >> null -Unsupported operand types: null >> stdClass -Unsupported operand types: stdClass >> bool -Unsupported operand types: bool >> stdClass -Unsupported operand types: stdClass >> bool -Unsupported operand types: bool >> stdClass -Unsupported operand types: stdClass >> int -Unsupported operand types: int >> stdClass -Unsupported operand types: stdClass >> float +TypeError: Unsupported operand types: float >> array +TypeError: Unsupported operand types: array >> string +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: array >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: stdClass >> null +TypeError: Unsupported operand types: null >> stdClass +TypeError: Unsupported operand types: stdClass >> bool +TypeError: Unsupported operand types: bool >> stdClass +TypeError: Unsupported operand types: stdClass >> bool +TypeError: Unsupported operand types: bool >> stdClass +TypeError: Unsupported operand types: stdClass >> int +TypeError: Unsupported operand types: int >> stdClass +TypeError: Unsupported operand types: stdClass >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> stdClass -Unsupported operand types: stdClass >> string -Unsupported operand types: string >> stdClass -Unsupported operand types: stdClass >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> stdClass -Unsupported operand types: resource >> null -Unsupported operand types: null >> resource -Unsupported operand types: resource >> bool -Unsupported operand types: bool >> resource -Unsupported operand types: resource >> bool -Unsupported operand types: bool >> resource -Unsupported operand types: resource >> int -Unsupported operand types: int >> resource -Unsupported operand types: resource >> float +TypeError: Unsupported operand types: float >> stdClass +TypeError: Unsupported operand types: stdClass >> string +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: stdClass >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: resource >> null +TypeError: Unsupported operand types: null >> resource +TypeError: Unsupported operand types: resource >> bool +TypeError: Unsupported operand types: bool >> resource +TypeError: Unsupported operand types: resource >> bool +TypeError: Unsupported operand types: bool >> resource +TypeError: Unsupported operand types: resource >> int +TypeError: Unsupported operand types: int >> resource +TypeError: Unsupported operand types: resource >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> resource -Unsupported operand types: resource >> string -Unsupported operand types: string >> resource -Unsupported operand types: resource >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> resource -Unsupported operand types: string >> null -Unsupported operand types: null >> string -Unsupported operand types: string >> bool -Unsupported operand types: bool >> string -Unsupported operand types: string >> bool -Unsupported operand types: bool >> string -Unsupported operand types: string >> int -Unsupported operand types: int >> string -Unsupported operand types: string >> float +TypeError: Unsupported operand types: float >> resource +TypeError: Unsupported operand types: resource >> string +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: resource >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: string >> null +TypeError: Unsupported operand types: null >> string +TypeError: Unsupported operand types: string >> bool +TypeError: Unsupported operand types: bool >> string +TypeError: Unsupported operand types: string >> bool +TypeError: Unsupported operand types: bool >> string +TypeError: Unsupported operand types: string >> int +TypeError: Unsupported operand types: int >> string +TypeError: Unsupported operand types: string >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> string -Unsupported operand types: string >> string -Unsupported operand types: string >> string -Unsupported operand types: string >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> string -Unsupported operand types: array & array -Unsupported operand types: stdClass & array -Unsupported operand types: resource & array -Unsupported operand types: array & string -Unsupported operand types: stdClass & array -Unsupported operand types: stdClass & stdClass -Unsupported operand types: stdClass & resource -Unsupported operand types: stdClass & string -Unsupported operand types: resource & array -Unsupported operand types: resource & stdClass -Unsupported operand types: resource & resource -Unsupported operand types: resource & string -Unsupported operand types: string & array -Unsupported operand types: stdClass & string -Unsupported operand types: resource & string +TypeError: Unsupported operand types: float >> string +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: array & array +TypeError: Unsupported operand types: stdClass & array +TypeError: Unsupported operand types: resource & array +TypeError: Unsupported operand types: array & string +TypeError: Unsupported operand types: stdClass & array +TypeError: Unsupported operand types: stdClass & stdClass +TypeError: Unsupported operand types: stdClass & resource +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: resource & array +TypeError: Unsupported operand types: resource & stdClass +TypeError: Unsupported operand types: resource & resource +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: resource & string No error for "foo" & "foo" -Unsupported operand types: array & null -Unsupported operand types: null & array -Unsupported operand types: array & bool -Unsupported operand types: bool & array -Unsupported operand types: array & bool -Unsupported operand types: bool & array -Unsupported operand types: array & int -Unsupported operand types: int & array -Unsupported operand types: array & float +TypeError: Unsupported operand types: array & null +TypeError: Unsupported operand types: null & array +TypeError: Unsupported operand types: array & bool +TypeError: Unsupported operand types: bool & array +TypeError: Unsupported operand types: array & bool +TypeError: Unsupported operand types: bool & array +TypeError: Unsupported operand types: array & int +TypeError: Unsupported operand types: int & array +TypeError: Unsupported operand types: array & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & array -Unsupported operand types: array & string -Unsupported operand types: string & array -Unsupported operand types: array & string -Warning: A non-numeric value encountered -Unsupported operand types: string & array -Unsupported operand types: stdClass & null -Unsupported operand types: stdClass & null -Unsupported operand types: stdClass & bool -Unsupported operand types: stdClass & bool -Unsupported operand types: stdClass & bool -Unsupported operand types: stdClass & bool -Unsupported operand types: stdClass & int -Unsupported operand types: stdClass & int -Unsupported operand types: stdClass & float -Unsupported operand types: stdClass & float -Unsupported operand types: stdClass & string -Unsupported operand types: stdClass & string -Unsupported operand types: stdClass & string -Unsupported operand types: stdClass & string -Unsupported operand types: resource & null -Unsupported operand types: resource & null -Unsupported operand types: resource & bool -Unsupported operand types: resource & bool -Unsupported operand types: resource & bool -Unsupported operand types: resource & bool -Unsupported operand types: resource & int -Unsupported operand types: resource & int -Unsupported operand types: resource & float -Unsupported operand types: resource & float -Unsupported operand types: resource & string -Unsupported operand types: resource & string -Unsupported operand types: resource & string -Unsupported operand types: resource & string -Unsupported operand types: string & null -Unsupported operand types: null & string -Unsupported operand types: string & bool -Unsupported operand types: bool & string -Unsupported operand types: string & bool -Unsupported operand types: bool & string -Unsupported operand types: string & int -Unsupported operand types: int & string -Unsupported operand types: string & float +TypeError: Unsupported operand types: float & array +TypeError: Unsupported operand types: array & string +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: array & string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: stdClass & null +TypeError: Unsupported operand types: stdClass & null +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: stdClass & int +TypeError: Unsupported operand types: stdClass & int +TypeError: Unsupported operand types: stdClass & float +TypeError: Unsupported operand types: stdClass & float +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: resource & null +TypeError: Unsupported operand types: resource & null +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: resource & int +TypeError: Unsupported operand types: resource & int +TypeError: Unsupported operand types: resource & float +TypeError: Unsupported operand types: resource & float +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: string & null +TypeError: Unsupported operand types: null & string +TypeError: Unsupported operand types: string & bool +TypeError: Unsupported operand types: bool & string +TypeError: Unsupported operand types: string & bool +TypeError: Unsupported operand types: bool & string +TypeError: Unsupported operand types: string & int +TypeError: Unsupported operand types: int & string +TypeError: Unsupported operand types: string & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & string +TypeError: Unsupported operand types: float & string No error for "foo" & "123" No error for "123" & "foo" No error for "foo" & "123foo" No error for "123foo" & "foo" -Unsupported operand types: array | array -Unsupported operand types: stdClass | array -Unsupported operand types: resource | array -Unsupported operand types: array | string -Unsupported operand types: stdClass | array -Unsupported operand types: stdClass | stdClass -Unsupported operand types: stdClass | resource -Unsupported operand types: stdClass | string -Unsupported operand types: resource | array -Unsupported operand types: resource | stdClass -Unsupported operand types: resource | resource -Unsupported operand types: resource | string -Unsupported operand types: string | array -Unsupported operand types: stdClass | string -Unsupported operand types: resource | string +TypeError: Unsupported operand types: array | array +TypeError: Unsupported operand types: stdClass | array +TypeError: Unsupported operand types: resource | array +TypeError: Unsupported operand types: array | string +TypeError: Unsupported operand types: stdClass | array +TypeError: Unsupported operand types: stdClass | stdClass +TypeError: Unsupported operand types: stdClass | resource +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: resource | array +TypeError: Unsupported operand types: resource | stdClass +TypeError: Unsupported operand types: resource | resource +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: resource | string No error for "foo" | "foo" -Unsupported operand types: array | null -Unsupported operand types: null | array -Unsupported operand types: array | bool -Unsupported operand types: bool | array -Unsupported operand types: array | bool -Unsupported operand types: bool | array -Unsupported operand types: array | int -Unsupported operand types: int | array -Unsupported operand types: array | float +TypeError: Unsupported operand types: array | null +TypeError: Unsupported operand types: null | array +TypeError: Unsupported operand types: array | bool +TypeError: Unsupported operand types: bool | array +TypeError: Unsupported operand types: array | bool +TypeError: Unsupported operand types: bool | array +TypeError: Unsupported operand types: array | int +TypeError: Unsupported operand types: int | array +TypeError: Unsupported operand types: array | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | array -Unsupported operand types: array | string -Unsupported operand types: string | array -Unsupported operand types: array | string -Warning: A non-numeric value encountered -Unsupported operand types: string | array -Unsupported operand types: stdClass | null -Unsupported operand types: stdClass | null -Unsupported operand types: stdClass | bool -Unsupported operand types: stdClass | bool -Unsupported operand types: stdClass | bool -Unsupported operand types: stdClass | bool -Unsupported operand types: stdClass | int -Unsupported operand types: stdClass | int -Unsupported operand types: stdClass | float -Unsupported operand types: stdClass | float -Unsupported operand types: stdClass | string -Unsupported operand types: stdClass | string -Unsupported operand types: stdClass | string -Unsupported operand types: stdClass | string -Unsupported operand types: resource | null -Unsupported operand types: resource | null -Unsupported operand types: resource | bool -Unsupported operand types: resource | bool -Unsupported operand types: resource | bool -Unsupported operand types: resource | bool -Unsupported operand types: resource | int -Unsupported operand types: resource | int -Unsupported operand types: resource | float -Unsupported operand types: resource | float -Unsupported operand types: resource | string -Unsupported operand types: resource | string -Unsupported operand types: resource | string -Unsupported operand types: resource | string -Unsupported operand types: string | null -Unsupported operand types: null | string -Unsupported operand types: string | bool -Unsupported operand types: bool | string -Unsupported operand types: string | bool -Unsupported operand types: bool | string -Unsupported operand types: string | int -Unsupported operand types: int | string -Unsupported operand types: string | float +TypeError: Unsupported operand types: float | array +TypeError: Unsupported operand types: array | string +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: array | string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: stdClass | null +TypeError: Unsupported operand types: stdClass | null +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: stdClass | int +TypeError: Unsupported operand types: stdClass | int +TypeError: Unsupported operand types: stdClass | float +TypeError: Unsupported operand types: stdClass | float +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: resource | null +TypeError: Unsupported operand types: resource | null +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: resource | int +TypeError: Unsupported operand types: resource | int +TypeError: Unsupported operand types: resource | float +TypeError: Unsupported operand types: resource | float +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: string | null +TypeError: Unsupported operand types: null | string +TypeError: Unsupported operand types: string | bool +TypeError: Unsupported operand types: bool | string +TypeError: Unsupported operand types: string | bool +TypeError: Unsupported operand types: bool | string +TypeError: Unsupported operand types: string | int +TypeError: Unsupported operand types: int | string +TypeError: Unsupported operand types: string | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | string +TypeError: Unsupported operand types: float | string No error for "foo" | "123" No error for "123" | "foo" No error for "foo" | "123foo" No error for "123foo" | "foo" -Unsupported operand types: array ^ array -Unsupported operand types: stdClass ^ array -Unsupported operand types: resource ^ array -Unsupported operand types: array ^ string -Unsupported operand types: stdClass ^ array -Unsupported operand types: stdClass ^ stdClass -Unsupported operand types: stdClass ^ resource -Unsupported operand types: stdClass ^ string -Unsupported operand types: resource ^ array -Unsupported operand types: resource ^ stdClass -Unsupported operand types: resource ^ resource -Unsupported operand types: resource ^ string -Unsupported operand types: string ^ array -Unsupported operand types: stdClass ^ string -Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: array ^ array +TypeError: Unsupported operand types: stdClass ^ array +TypeError: Unsupported operand types: resource ^ array +TypeError: Unsupported operand types: array ^ string +TypeError: Unsupported operand types: stdClass ^ array +TypeError: Unsupported operand types: stdClass ^ stdClass +TypeError: Unsupported operand types: stdClass ^ resource +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: resource ^ array +TypeError: Unsupported operand types: resource ^ stdClass +TypeError: Unsupported operand types: resource ^ resource +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: resource ^ string No error for "foo" ^ "foo" -Unsupported operand types: array ^ null -Unsupported operand types: null ^ array -Unsupported operand types: array ^ bool -Unsupported operand types: bool ^ array -Unsupported operand types: array ^ bool -Unsupported operand types: bool ^ array -Unsupported operand types: array ^ int -Unsupported operand types: int ^ array -Unsupported operand types: array ^ float +TypeError: Unsupported operand types: array ^ null +TypeError: Unsupported operand types: null ^ array +TypeError: Unsupported operand types: array ^ bool +TypeError: Unsupported operand types: bool ^ array +TypeError: Unsupported operand types: array ^ bool +TypeError: Unsupported operand types: bool ^ array +TypeError: Unsupported operand types: array ^ int +TypeError: Unsupported operand types: int ^ array +TypeError: Unsupported operand types: array ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ array -Unsupported operand types: array ^ string -Unsupported operand types: string ^ array -Unsupported operand types: array ^ string -Warning: A non-numeric value encountered -Unsupported operand types: string ^ array -Unsupported operand types: stdClass ^ null -Unsupported operand types: stdClass ^ null -Unsupported operand types: stdClass ^ bool -Unsupported operand types: stdClass ^ bool -Unsupported operand types: stdClass ^ bool -Unsupported operand types: stdClass ^ bool -Unsupported operand types: stdClass ^ int -Unsupported operand types: stdClass ^ int -Unsupported operand types: stdClass ^ float -Unsupported operand types: stdClass ^ float -Unsupported operand types: stdClass ^ string -Unsupported operand types: stdClass ^ string -Unsupported operand types: stdClass ^ string -Unsupported operand types: stdClass ^ string -Unsupported operand types: resource ^ null -Unsupported operand types: resource ^ null -Unsupported operand types: resource ^ bool -Unsupported operand types: resource ^ bool -Unsupported operand types: resource ^ bool -Unsupported operand types: resource ^ bool -Unsupported operand types: resource ^ int -Unsupported operand types: resource ^ int -Unsupported operand types: resource ^ float -Unsupported operand types: resource ^ float -Unsupported operand types: resource ^ string -Unsupported operand types: resource ^ string -Unsupported operand types: resource ^ string -Unsupported operand types: resource ^ string -Unsupported operand types: string ^ null -Unsupported operand types: null ^ string -Unsupported operand types: string ^ bool -Unsupported operand types: bool ^ string -Unsupported operand types: string ^ bool -Unsupported operand types: bool ^ string -Unsupported operand types: string ^ int -Unsupported operand types: int ^ string -Unsupported operand types: string ^ float +TypeError: Unsupported operand types: float ^ array +TypeError: Unsupported operand types: array ^ string +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: array ^ string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: stdClass ^ null +TypeError: Unsupported operand types: stdClass ^ null +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: stdClass ^ int +TypeError: Unsupported operand types: stdClass ^ int +TypeError: Unsupported operand types: stdClass ^ float +TypeError: Unsupported operand types: stdClass ^ float +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: resource ^ null +TypeError: Unsupported operand types: resource ^ null +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: resource ^ int +TypeError: Unsupported operand types: resource ^ int +TypeError: Unsupported operand types: resource ^ float +TypeError: Unsupported operand types: resource ^ float +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: string ^ null +TypeError: Unsupported operand types: null ^ string +TypeError: Unsupported operand types: string ^ bool +TypeError: Unsupported operand types: bool ^ string +TypeError: Unsupported operand types: string ^ bool +TypeError: Unsupported operand types: bool ^ string +TypeError: Unsupported operand types: string ^ int +TypeError: Unsupported operand types: int ^ string +TypeError: Unsupported operand types: string ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ string +TypeError: Unsupported operand types: float ^ string No error for "foo" ^ "123" No error for "123" ^ "foo" No error for "foo" ^ "123foo" @@ -1045,24 +1045,24 @@ Warning: Array to string conversion Warning: Array to string conversion No error for [] . [] Warning: Array to string conversion -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string Warning: Array to string conversion No error for [] . STDOUT Warning: Array to string conversion No error for [] . "foo" Warning: Array to string conversion -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string Warning: Array to string conversion No error for STDOUT . [] -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for STDOUT . STDOUT No error for STDOUT . "foo" Warning: Array to string conversion No error for "foo" . [] -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for "foo" . STDOUT No error for "foo" . "foo" Warning: Array to string conversion @@ -1093,20 +1093,20 @@ Warning: Array to string conversion No error for [] . "123foo" Warning: Array to string conversion No error for "123foo" . [] -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for STDOUT . null No error for null . STDOUT No error for STDOUT . true @@ -1139,858 +1139,858 @@ No error for "123foo" . "foo" ASSIGN OP: No error for [] += [] -Unsupported operand types: array + stdClass -Unsupported operand types: array + resource -Unsupported operand types: array + string -Unsupported operand types: stdClass + array -Unsupported operand types: stdClass + stdClass -Unsupported operand types: stdClass + resource -Unsupported operand types: stdClass + string -Unsupported operand types: resource + array -Unsupported operand types: resource + stdClass -Unsupported operand types: resource + resource -Unsupported operand types: resource + string -Unsupported operand types: string + array -Unsupported operand types: string + stdClass -Unsupported operand types: string + resource -Unsupported operand types: string + string -Unsupported operand types: array + null -Unsupported operand types: null + array -Unsupported operand types: array + bool -Unsupported operand types: bool + array -Unsupported operand types: array + bool -Unsupported operand types: bool + array -Unsupported operand types: array + int -Unsupported operand types: int + array -Unsupported operand types: array + float -Unsupported operand types: float + array -Unsupported operand types: array + string -Unsupported operand types: string + array -Unsupported operand types: array + string -Warning: A non-numeric value encountered -Unsupported operand types: string + array -Unsupported operand types: stdClass + null -Unsupported operand types: null + stdClass -Unsupported operand types: stdClass + bool -Unsupported operand types: bool + stdClass -Unsupported operand types: stdClass + bool -Unsupported operand types: bool + stdClass -Unsupported operand types: stdClass + int -Unsupported operand types: int + stdClass -Unsupported operand types: stdClass + float -Unsupported operand types: float + stdClass -Unsupported operand types: stdClass + string -Unsupported operand types: string + stdClass -Unsupported operand types: stdClass + string -Warning: A non-numeric value encountered -Unsupported operand types: string + stdClass -Unsupported operand types: resource + null -Unsupported operand types: null + resource -Unsupported operand types: resource + bool -Unsupported operand types: bool + resource -Unsupported operand types: resource + bool -Unsupported operand types: bool + resource -Unsupported operand types: resource + int -Unsupported operand types: int + resource -Unsupported operand types: resource + float -Unsupported operand types: float + resource -Unsupported operand types: resource + string -Unsupported operand types: string + resource -Unsupported operand types: resource + string -Warning: A non-numeric value encountered -Unsupported operand types: string + resource -Unsupported operand types: string + null -Unsupported operand types: null + string -Unsupported operand types: string + bool -Unsupported operand types: bool + string -Unsupported operand types: string + bool -Unsupported operand types: bool + string -Unsupported operand types: string + int -Unsupported operand types: int + string -Unsupported operand types: string + float -Unsupported operand types: float + string -Unsupported operand types: string + string -Unsupported operand types: string + string -Unsupported operand types: string + string -Warning: A non-numeric value encountered -Unsupported operand types: string + string -Unsupported operand types: array - array -Unsupported operand types: array - stdClass -Unsupported operand types: array - resource -Unsupported operand types: array - string -Unsupported operand types: stdClass - array -Unsupported operand types: stdClass - stdClass -Unsupported operand types: stdClass - resource -Unsupported operand types: stdClass - string -Unsupported operand types: resource - array -Unsupported operand types: resource - stdClass -Unsupported operand types: resource - resource -Unsupported operand types: resource - string -Unsupported operand types: string - array -Unsupported operand types: string - stdClass -Unsupported operand types: string - resource -Unsupported operand types: string - string -Unsupported operand types: array - null -Unsupported operand types: null - array -Unsupported operand types: array - bool -Unsupported operand types: bool - array -Unsupported operand types: array - bool -Unsupported operand types: bool - array -Unsupported operand types: array - int -Unsupported operand types: int - array -Unsupported operand types: array - float -Unsupported operand types: float - array -Unsupported operand types: array - string -Unsupported operand types: string - array -Unsupported operand types: array - string -Warning: A non-numeric value encountered -Unsupported operand types: string - array -Unsupported operand types: stdClass - null -Unsupported operand types: null - stdClass -Unsupported operand types: stdClass - bool -Unsupported operand types: bool - stdClass -Unsupported operand types: stdClass - bool -Unsupported operand types: bool - stdClass -Unsupported operand types: stdClass - int -Unsupported operand types: int - stdClass -Unsupported operand types: stdClass - float -Unsupported operand types: float - stdClass -Unsupported operand types: stdClass - string -Unsupported operand types: string - stdClass -Unsupported operand types: stdClass - string -Warning: A non-numeric value encountered -Unsupported operand types: string - stdClass -Unsupported operand types: resource - null -Unsupported operand types: null - resource -Unsupported operand types: resource - bool -Unsupported operand types: bool - resource -Unsupported operand types: resource - bool -Unsupported operand types: bool - resource -Unsupported operand types: resource - int -Unsupported operand types: int - resource -Unsupported operand types: resource - float -Unsupported operand types: float - resource -Unsupported operand types: resource - string -Unsupported operand types: string - resource -Unsupported operand types: resource - string -Warning: A non-numeric value encountered -Unsupported operand types: string - resource -Unsupported operand types: string - null -Unsupported operand types: null - string -Unsupported operand types: string - bool -Unsupported operand types: bool - string -Unsupported operand types: string - bool -Unsupported operand types: bool - string -Unsupported operand types: string - int -Unsupported operand types: int - string -Unsupported operand types: string - float -Unsupported operand types: float - string -Unsupported operand types: string - string -Unsupported operand types: string - string -Unsupported operand types: string - string -Warning: A non-numeric value encountered -Unsupported operand types: string - string -Unsupported operand types: array * array -Unsupported operand types: array * stdClass -Unsupported operand types: array * resource -Unsupported operand types: array * string -Unsupported operand types: stdClass * array -Unsupported operand types: stdClass * stdClass -Unsupported operand types: stdClass * resource -Unsupported operand types: stdClass * string -Unsupported operand types: resource * array -Unsupported operand types: resource * stdClass -Unsupported operand types: resource * resource -Unsupported operand types: resource * string -Unsupported operand types: string * array -Unsupported operand types: string * stdClass -Unsupported operand types: string * resource -Unsupported operand types: string * string -Unsupported operand types: array * null -Unsupported operand types: null * array -Unsupported operand types: array * bool -Unsupported operand types: bool * array -Unsupported operand types: array * bool -Unsupported operand types: bool * array -Unsupported operand types: array * int -Unsupported operand types: int * array -Unsupported operand types: array * float -Unsupported operand types: float * array -Unsupported operand types: array * string -Unsupported operand types: string * array -Unsupported operand types: array * string -Warning: A non-numeric value encountered -Unsupported operand types: string * array -Unsupported operand types: stdClass * null -Unsupported operand types: null * stdClass -Unsupported operand types: stdClass * bool -Unsupported operand types: bool * stdClass -Unsupported operand types: stdClass * bool -Unsupported operand types: bool * stdClass -Unsupported operand types: stdClass * int -Unsupported operand types: int * stdClass -Unsupported operand types: stdClass * float -Unsupported operand types: float * stdClass -Unsupported operand types: stdClass * string -Unsupported operand types: string * stdClass -Unsupported operand types: stdClass * string -Warning: A non-numeric value encountered -Unsupported operand types: string * stdClass -Unsupported operand types: resource * null -Unsupported operand types: null * resource -Unsupported operand types: resource * bool -Unsupported operand types: bool * resource -Unsupported operand types: resource * bool -Unsupported operand types: bool * resource -Unsupported operand types: resource * int -Unsupported operand types: int * resource -Unsupported operand types: resource * float -Unsupported operand types: float * resource -Unsupported operand types: resource * string -Unsupported operand types: string * resource -Unsupported operand types: resource * string -Warning: A non-numeric value encountered -Unsupported operand types: string * resource -Unsupported operand types: string * null -Unsupported operand types: null * string -Unsupported operand types: string * bool -Unsupported operand types: bool * string -Unsupported operand types: string * bool -Unsupported operand types: bool * string -Unsupported operand types: string * int -Unsupported operand types: int * string -Unsupported operand types: string * float -Unsupported operand types: float * string -Unsupported operand types: string * string -Unsupported operand types: string * string -Unsupported operand types: string * string -Warning: A non-numeric value encountered -Unsupported operand types: string * string -Unsupported operand types: array / array -Unsupported operand types: array / stdClass -Unsupported operand types: array / resource -Unsupported operand types: array / string -Unsupported operand types: stdClass / array -Unsupported operand types: stdClass / stdClass -Unsupported operand types: stdClass / resource -Unsupported operand types: stdClass / string -Unsupported operand types: resource / array -Unsupported operand types: resource / stdClass -Unsupported operand types: resource / resource -Unsupported operand types: resource / string -Unsupported operand types: string / array -Unsupported operand types: string / stdClass -Unsupported operand types: string / resource -Unsupported operand types: string / string -Unsupported operand types: array / null -Unsupported operand types: null / array -Unsupported operand types: array / bool -Unsupported operand types: bool / array -Unsupported operand types: array / bool -Unsupported operand types: bool / array -Unsupported operand types: array / int -Unsupported operand types: int / array -Unsupported operand types: array / float -Unsupported operand types: float / array -Unsupported operand types: array / string -Unsupported operand types: string / array -Unsupported operand types: array / string -Warning: A non-numeric value encountered -Unsupported operand types: string / array -Unsupported operand types: stdClass / null -Unsupported operand types: null / stdClass -Unsupported operand types: stdClass / bool -Unsupported operand types: bool / stdClass -Unsupported operand types: stdClass / bool -Unsupported operand types: bool / stdClass -Unsupported operand types: stdClass / int -Unsupported operand types: int / stdClass -Unsupported operand types: stdClass / float -Unsupported operand types: float / stdClass -Unsupported operand types: stdClass / string -Unsupported operand types: string / stdClass -Unsupported operand types: stdClass / string -Warning: A non-numeric value encountered -Unsupported operand types: string / stdClass -Unsupported operand types: resource / null -Unsupported operand types: null / resource -Unsupported operand types: resource / bool -Unsupported operand types: bool / resource -Unsupported operand types: resource / bool -Unsupported operand types: bool / resource -Unsupported operand types: resource / int -Unsupported operand types: int / resource -Unsupported operand types: resource / float -Unsupported operand types: float / resource -Unsupported operand types: resource / string -Unsupported operand types: string / resource -Unsupported operand types: resource / string -Warning: A non-numeric value encountered -Unsupported operand types: string / resource -Unsupported operand types: string / null -Unsupported operand types: null / string -Unsupported operand types: string / bool -Unsupported operand types: bool / string -Unsupported operand types: string / bool -Unsupported operand types: bool / string -Unsupported operand types: string / int -Unsupported operand types: int / string -Unsupported operand types: string / float -Unsupported operand types: float / string -Unsupported operand types: string / string -Unsupported operand types: string / string -Unsupported operand types: string / string -Warning: A non-numeric value encountered -Unsupported operand types: string / string -Unsupported operand types: array % array -Unsupported operand types: array % stdClass -Unsupported operand types: array % resource -Unsupported operand types: array % string -Unsupported operand types: stdClass % array -Unsupported operand types: stdClass % stdClass -Unsupported operand types: stdClass % resource -Unsupported operand types: stdClass % string -Unsupported operand types: resource % array -Unsupported operand types: resource % stdClass -Unsupported operand types: resource % resource -Unsupported operand types: resource % string -Unsupported operand types: string % array -Unsupported operand types: string % stdClass -Unsupported operand types: string % resource -Unsupported operand types: string % string -Unsupported operand types: array % null -Unsupported operand types: null % array -Unsupported operand types: array % bool -Unsupported operand types: bool % array -Unsupported operand types: array % bool -Unsupported operand types: bool % array -Unsupported operand types: array % int -Unsupported operand types: int % array -Unsupported operand types: array % float +TypeError: Unsupported operand types: array + stdClass +TypeError: Unsupported operand types: array + resource +TypeError: Unsupported operand types: array + string +TypeError: Unsupported operand types: stdClass + array +TypeError: Unsupported operand types: stdClass + stdClass +TypeError: Unsupported operand types: stdClass + resource +TypeError: Unsupported operand types: stdClass + string +TypeError: Unsupported operand types: resource + array +TypeError: Unsupported operand types: resource + stdClass +TypeError: Unsupported operand types: resource + resource +TypeError: Unsupported operand types: resource + string +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: array + null +TypeError: Unsupported operand types: null + array +TypeError: Unsupported operand types: array + bool +TypeError: Unsupported operand types: bool + array +TypeError: Unsupported operand types: array + bool +TypeError: Unsupported operand types: bool + array +TypeError: Unsupported operand types: array + int +TypeError: Unsupported operand types: int + array +TypeError: Unsupported operand types: array + float +TypeError: Unsupported operand types: float + array +TypeError: Unsupported operand types: array + string +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: array + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + array +TypeError: Unsupported operand types: stdClass + null +TypeError: Unsupported operand types: null + stdClass +TypeError: Unsupported operand types: stdClass + bool +TypeError: Unsupported operand types: bool + stdClass +TypeError: Unsupported operand types: stdClass + bool +TypeError: Unsupported operand types: bool + stdClass +TypeError: Unsupported operand types: stdClass + int +TypeError: Unsupported operand types: int + stdClass +TypeError: Unsupported operand types: stdClass + float +TypeError: Unsupported operand types: float + stdClass +TypeError: Unsupported operand types: stdClass + string +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: stdClass + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + stdClass +TypeError: Unsupported operand types: resource + null +TypeError: Unsupported operand types: null + resource +TypeError: Unsupported operand types: resource + bool +TypeError: Unsupported operand types: bool + resource +TypeError: Unsupported operand types: resource + bool +TypeError: Unsupported operand types: bool + resource +TypeError: Unsupported operand types: resource + int +TypeError: Unsupported operand types: int + resource +TypeError: Unsupported operand types: resource + float +TypeError: Unsupported operand types: float + resource +TypeError: Unsupported operand types: resource + string +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: resource + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + resource +TypeError: Unsupported operand types: string + null +TypeError: Unsupported operand types: null + string +TypeError: Unsupported operand types: string + bool +TypeError: Unsupported operand types: bool + string +TypeError: Unsupported operand types: string + bool +TypeError: Unsupported operand types: bool + string +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: int + string +TypeError: Unsupported operand types: string + float +TypeError: Unsupported operand types: float + string +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string + string +TypeError: Unsupported operand types: array - array +TypeError: Unsupported operand types: array - stdClass +TypeError: Unsupported operand types: array - resource +TypeError: Unsupported operand types: array - string +TypeError: Unsupported operand types: stdClass - array +TypeError: Unsupported operand types: stdClass - stdClass +TypeError: Unsupported operand types: stdClass - resource +TypeError: Unsupported operand types: stdClass - string +TypeError: Unsupported operand types: resource - array +TypeError: Unsupported operand types: resource - stdClass +TypeError: Unsupported operand types: resource - resource +TypeError: Unsupported operand types: resource - string +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: array - null +TypeError: Unsupported operand types: null - array +TypeError: Unsupported operand types: array - bool +TypeError: Unsupported operand types: bool - array +TypeError: Unsupported operand types: array - bool +TypeError: Unsupported operand types: bool - array +TypeError: Unsupported operand types: array - int +TypeError: Unsupported operand types: int - array +TypeError: Unsupported operand types: array - float +TypeError: Unsupported operand types: float - array +TypeError: Unsupported operand types: array - string +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: array - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - array +TypeError: Unsupported operand types: stdClass - null +TypeError: Unsupported operand types: null - stdClass +TypeError: Unsupported operand types: stdClass - bool +TypeError: Unsupported operand types: bool - stdClass +TypeError: Unsupported operand types: stdClass - bool +TypeError: Unsupported operand types: bool - stdClass +TypeError: Unsupported operand types: stdClass - int +TypeError: Unsupported operand types: int - stdClass +TypeError: Unsupported operand types: stdClass - float +TypeError: Unsupported operand types: float - stdClass +TypeError: Unsupported operand types: stdClass - string +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: stdClass - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - stdClass +TypeError: Unsupported operand types: resource - null +TypeError: Unsupported operand types: null - resource +TypeError: Unsupported operand types: resource - bool +TypeError: Unsupported operand types: bool - resource +TypeError: Unsupported operand types: resource - bool +TypeError: Unsupported operand types: bool - resource +TypeError: Unsupported operand types: resource - int +TypeError: Unsupported operand types: int - resource +TypeError: Unsupported operand types: resource - float +TypeError: Unsupported operand types: float - resource +TypeError: Unsupported operand types: resource - string +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: resource - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - resource +TypeError: Unsupported operand types: string - null +TypeError: Unsupported operand types: null - string +TypeError: Unsupported operand types: string - bool +TypeError: Unsupported operand types: bool - string +TypeError: Unsupported operand types: string - bool +TypeError: Unsupported operand types: bool - string +TypeError: Unsupported operand types: string - int +TypeError: Unsupported operand types: int - string +TypeError: Unsupported operand types: string - float +TypeError: Unsupported operand types: float - string +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string - string +TypeError: Unsupported operand types: array * array +TypeError: Unsupported operand types: array * stdClass +TypeError: Unsupported operand types: array * resource +TypeError: Unsupported operand types: array * string +TypeError: Unsupported operand types: stdClass * array +TypeError: Unsupported operand types: stdClass * stdClass +TypeError: Unsupported operand types: stdClass * resource +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: resource * array +TypeError: Unsupported operand types: resource * stdClass +TypeError: Unsupported operand types: resource * resource +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: string * stdClass +TypeError: Unsupported operand types: string * resource +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: array * null +TypeError: Unsupported operand types: null * array +TypeError: Unsupported operand types: array * bool +TypeError: Unsupported operand types: bool * array +TypeError: Unsupported operand types: array * bool +TypeError: Unsupported operand types: bool * array +TypeError: Unsupported operand types: array * int +TypeError: Unsupported operand types: int * array +TypeError: Unsupported operand types: array * float +TypeError: Unsupported operand types: float * array +TypeError: Unsupported operand types: array * string +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: array * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * array +TypeError: Unsupported operand types: stdClass * null +TypeError: Unsupported operand types: null * stdClass +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: bool * stdClass +TypeError: Unsupported operand types: stdClass * bool +TypeError: Unsupported operand types: bool * stdClass +TypeError: Unsupported operand types: stdClass * int +TypeError: Unsupported operand types: int * stdClass +TypeError: Unsupported operand types: stdClass * float +TypeError: Unsupported operand types: float * stdClass +TypeError: Unsupported operand types: stdClass * string +TypeError: Unsupported operand types: string * stdClass +TypeError: Unsupported operand types: stdClass * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * stdClass +TypeError: Unsupported operand types: resource * null +TypeError: Unsupported operand types: null * resource +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: bool * resource +TypeError: Unsupported operand types: resource * bool +TypeError: Unsupported operand types: bool * resource +TypeError: Unsupported operand types: resource * int +TypeError: Unsupported operand types: int * resource +TypeError: Unsupported operand types: resource * float +TypeError: Unsupported operand types: float * resource +TypeError: Unsupported operand types: resource * string +TypeError: Unsupported operand types: string * resource +TypeError: Unsupported operand types: resource * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * resource +TypeError: Unsupported operand types: string * null +TypeError: Unsupported operand types: null * string +TypeError: Unsupported operand types: string * bool +TypeError: Unsupported operand types: bool * string +TypeError: Unsupported operand types: string * bool +TypeError: Unsupported operand types: bool * string +TypeError: Unsupported operand types: string * int +TypeError: Unsupported operand types: int * string +TypeError: Unsupported operand types: string * float +TypeError: Unsupported operand types: float * string +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string * string +TypeError: Unsupported operand types: array / array +TypeError: Unsupported operand types: array / stdClass +TypeError: Unsupported operand types: array / resource +TypeError: Unsupported operand types: array / string +TypeError: Unsupported operand types: stdClass / array +TypeError: Unsupported operand types: stdClass / stdClass +TypeError: Unsupported operand types: stdClass / resource +TypeError: Unsupported operand types: stdClass / string +TypeError: Unsupported operand types: resource / array +TypeError: Unsupported operand types: resource / stdClass +TypeError: Unsupported operand types: resource / resource +TypeError: Unsupported operand types: resource / string +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: array / null +TypeError: Unsupported operand types: null / array +TypeError: Unsupported operand types: array / bool +TypeError: Unsupported operand types: bool / array +TypeError: Unsupported operand types: array / bool +TypeError: Unsupported operand types: bool / array +TypeError: Unsupported operand types: array / int +TypeError: Unsupported operand types: int / array +TypeError: Unsupported operand types: array / float +TypeError: Unsupported operand types: float / array +TypeError: Unsupported operand types: array / string +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: array / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / array +TypeError: Unsupported operand types: stdClass / null +TypeError: Unsupported operand types: null / stdClass +TypeError: Unsupported operand types: stdClass / bool +TypeError: Unsupported operand types: bool / stdClass +TypeError: Unsupported operand types: stdClass / bool +TypeError: Unsupported operand types: bool / stdClass +TypeError: Unsupported operand types: stdClass / int +TypeError: Unsupported operand types: int / stdClass +TypeError: Unsupported operand types: stdClass / float +TypeError: Unsupported operand types: float / stdClass +TypeError: Unsupported operand types: stdClass / string +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: stdClass / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / stdClass +TypeError: Unsupported operand types: resource / null +TypeError: Unsupported operand types: null / resource +TypeError: Unsupported operand types: resource / bool +TypeError: Unsupported operand types: bool / resource +TypeError: Unsupported operand types: resource / bool +TypeError: Unsupported operand types: bool / resource +TypeError: Unsupported operand types: resource / int +TypeError: Unsupported operand types: int / resource +TypeError: Unsupported operand types: resource / float +TypeError: Unsupported operand types: float / resource +TypeError: Unsupported operand types: resource / string +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: resource / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / resource +TypeError: Unsupported operand types: string / null +TypeError: Unsupported operand types: null / string +TypeError: Unsupported operand types: string / bool +TypeError: Unsupported operand types: bool / string +TypeError: Unsupported operand types: string / bool +TypeError: Unsupported operand types: bool / string +TypeError: Unsupported operand types: string / int +TypeError: Unsupported operand types: int / string +TypeError: Unsupported operand types: string / float +TypeError: Unsupported operand types: float / string +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string / string +TypeError: Unsupported operand types: array % array +TypeError: Unsupported operand types: array % stdClass +TypeError: Unsupported operand types: array % resource +TypeError: Unsupported operand types: array % string +TypeError: Unsupported operand types: stdClass % array +TypeError: Unsupported operand types: stdClass % stdClass +TypeError: Unsupported operand types: stdClass % resource +TypeError: Unsupported operand types: stdClass % string +TypeError: Unsupported operand types: resource % array +TypeError: Unsupported operand types: resource % stdClass +TypeError: Unsupported operand types: resource % resource +TypeError: Unsupported operand types: resource % string +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: array % null +TypeError: Unsupported operand types: null % array +TypeError: Unsupported operand types: array % bool +TypeError: Unsupported operand types: bool % array +TypeError: Unsupported operand types: array % bool +TypeError: Unsupported operand types: bool % array +TypeError: Unsupported operand types: array % int +TypeError: Unsupported operand types: int % array +TypeError: Unsupported operand types: array % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % array -Unsupported operand types: array % string -Unsupported operand types: string % array -Unsupported operand types: array % string -Warning: A non-numeric value encountered -Unsupported operand types: string % array -Unsupported operand types: stdClass % null -Unsupported operand types: null % stdClass -Unsupported operand types: stdClass % bool -Unsupported operand types: bool % stdClass -Unsupported operand types: stdClass % bool -Unsupported operand types: bool % stdClass -Unsupported operand types: stdClass % int -Unsupported operand types: int % stdClass -Unsupported operand types: stdClass % float +TypeError: Unsupported operand types: float % array +TypeError: Unsupported operand types: array % string +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: array % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % array +TypeError: Unsupported operand types: stdClass % null +TypeError: Unsupported operand types: null % stdClass +TypeError: Unsupported operand types: stdClass % bool +TypeError: Unsupported operand types: bool % stdClass +TypeError: Unsupported operand types: stdClass % bool +TypeError: Unsupported operand types: bool % stdClass +TypeError: Unsupported operand types: stdClass % int +TypeError: Unsupported operand types: int % stdClass +TypeError: Unsupported operand types: stdClass % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % stdClass -Unsupported operand types: stdClass % string -Unsupported operand types: string % stdClass -Unsupported operand types: stdClass % string -Warning: A non-numeric value encountered -Unsupported operand types: string % stdClass -Unsupported operand types: resource % null -Unsupported operand types: null % resource -Unsupported operand types: resource % bool -Unsupported operand types: bool % resource -Unsupported operand types: resource % bool -Unsupported operand types: bool % resource -Unsupported operand types: resource % int -Unsupported operand types: int % resource -Unsupported operand types: resource % float +TypeError: Unsupported operand types: float % stdClass +TypeError: Unsupported operand types: stdClass % string +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: stdClass % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % stdClass +TypeError: Unsupported operand types: resource % null +TypeError: Unsupported operand types: null % resource +TypeError: Unsupported operand types: resource % bool +TypeError: Unsupported operand types: bool % resource +TypeError: Unsupported operand types: resource % bool +TypeError: Unsupported operand types: bool % resource +TypeError: Unsupported operand types: resource % int +TypeError: Unsupported operand types: int % resource +TypeError: Unsupported operand types: resource % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % resource -Unsupported operand types: resource % string -Unsupported operand types: string % resource -Unsupported operand types: resource % string -Warning: A non-numeric value encountered -Unsupported operand types: string % resource -Unsupported operand types: string % null -Unsupported operand types: null % string -Unsupported operand types: string % bool -Unsupported operand types: bool % string -Unsupported operand types: string % bool -Unsupported operand types: bool % string -Unsupported operand types: string % int -Unsupported operand types: int % string -Unsupported operand types: string % float +TypeError: Unsupported operand types: float % resource +TypeError: Unsupported operand types: resource % string +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: resource % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % resource +TypeError: Unsupported operand types: string % null +TypeError: Unsupported operand types: null % string +TypeError: Unsupported operand types: string % bool +TypeError: Unsupported operand types: bool % string +TypeError: Unsupported operand types: string % bool +TypeError: Unsupported operand types: bool % string +TypeError: Unsupported operand types: string % int +TypeError: Unsupported operand types: int % string +TypeError: Unsupported operand types: string % float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float % string -Unsupported operand types: string % string -Unsupported operand types: string % string -Unsupported operand types: string % string -Warning: A non-numeric value encountered -Unsupported operand types: string % string -Unsupported operand types: array ** array -Unsupported operand types: array ** stdClass -Unsupported operand types: array ** resource -Unsupported operand types: array ** string -Unsupported operand types: stdClass ** array -Unsupported operand types: stdClass ** stdClass -Unsupported operand types: stdClass ** resource -Unsupported operand types: stdClass ** string -Unsupported operand types: resource ** array -Unsupported operand types: resource ** stdClass -Unsupported operand types: resource ** resource -Unsupported operand types: resource ** string -Unsupported operand types: string ** array -Unsupported operand types: string ** stdClass -Unsupported operand types: string ** resource -Unsupported operand types: string ** string -Unsupported operand types: array ** null -Unsupported operand types: null ** array -Unsupported operand types: array ** bool -Unsupported operand types: bool ** array -Unsupported operand types: array ** bool -Unsupported operand types: bool ** array -Unsupported operand types: array ** int -Unsupported operand types: int ** array -Unsupported operand types: array ** float -Unsupported operand types: float ** array -Unsupported operand types: array ** string -Unsupported operand types: string ** array -Unsupported operand types: array ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** array -Unsupported operand types: stdClass ** null -Unsupported operand types: null ** stdClass -Unsupported operand types: stdClass ** bool -Unsupported operand types: bool ** stdClass -Unsupported operand types: stdClass ** bool -Unsupported operand types: bool ** stdClass -Unsupported operand types: stdClass ** int -Unsupported operand types: int ** stdClass -Unsupported operand types: stdClass ** float -Unsupported operand types: float ** stdClass -Unsupported operand types: stdClass ** string -Unsupported operand types: string ** stdClass -Unsupported operand types: stdClass ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** stdClass -Unsupported operand types: resource ** null -Unsupported operand types: null ** resource -Unsupported operand types: resource ** bool -Unsupported operand types: bool ** resource -Unsupported operand types: resource ** bool -Unsupported operand types: bool ** resource -Unsupported operand types: resource ** int -Unsupported operand types: int ** resource -Unsupported operand types: resource ** float -Unsupported operand types: float ** resource -Unsupported operand types: resource ** string -Unsupported operand types: string ** resource -Unsupported operand types: resource ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** resource -Unsupported operand types: string ** null -Unsupported operand types: null ** string -Unsupported operand types: string ** bool -Unsupported operand types: bool ** string -Unsupported operand types: string ** bool -Unsupported operand types: bool ** string -Unsupported operand types: string ** int -Unsupported operand types: int ** string -Unsupported operand types: string ** float -Unsupported operand types: float ** string -Unsupported operand types: string ** string -Unsupported operand types: string ** string -Unsupported operand types: string ** string -Warning: A non-numeric value encountered -Unsupported operand types: string ** string -Unsupported operand types: array << array -Unsupported operand types: array << stdClass -Unsupported operand types: array << resource -Unsupported operand types: array << string -Unsupported operand types: stdClass << array -Unsupported operand types: stdClass << stdClass -Unsupported operand types: stdClass << resource -Unsupported operand types: stdClass << string -Unsupported operand types: resource << array -Unsupported operand types: resource << stdClass -Unsupported operand types: resource << resource -Unsupported operand types: resource << string -Unsupported operand types: string << array -Unsupported operand types: string << stdClass -Unsupported operand types: string << resource -Unsupported operand types: string << string -Unsupported operand types: array << null -Unsupported operand types: null << array -Unsupported operand types: array << bool -Unsupported operand types: bool << array -Unsupported operand types: array << bool -Unsupported operand types: bool << array -Unsupported operand types: array << int -Unsupported operand types: int << array -Unsupported operand types: array << float +TypeError: Unsupported operand types: float % string +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: string % string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string % string +TypeError: Unsupported operand types: array ** array +TypeError: Unsupported operand types: array ** stdClass +TypeError: Unsupported operand types: array ** resource +TypeError: Unsupported operand types: array ** string +TypeError: Unsupported operand types: stdClass ** array +TypeError: Unsupported operand types: stdClass ** stdClass +TypeError: Unsupported operand types: stdClass ** resource +TypeError: Unsupported operand types: stdClass ** string +TypeError: Unsupported operand types: resource ** array +TypeError: Unsupported operand types: resource ** stdClass +TypeError: Unsupported operand types: resource ** resource +TypeError: Unsupported operand types: resource ** string +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: array ** null +TypeError: Unsupported operand types: null ** array +TypeError: Unsupported operand types: array ** bool +TypeError: Unsupported operand types: bool ** array +TypeError: Unsupported operand types: array ** bool +TypeError: Unsupported operand types: bool ** array +TypeError: Unsupported operand types: array ** int +TypeError: Unsupported operand types: int ** array +TypeError: Unsupported operand types: array ** float +TypeError: Unsupported operand types: float ** array +TypeError: Unsupported operand types: array ** string +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: array ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** array +TypeError: Unsupported operand types: stdClass ** null +TypeError: Unsupported operand types: null ** stdClass +TypeError: Unsupported operand types: stdClass ** bool +TypeError: Unsupported operand types: bool ** stdClass +TypeError: Unsupported operand types: stdClass ** bool +TypeError: Unsupported operand types: bool ** stdClass +TypeError: Unsupported operand types: stdClass ** int +TypeError: Unsupported operand types: int ** stdClass +TypeError: Unsupported operand types: stdClass ** float +TypeError: Unsupported operand types: float ** stdClass +TypeError: Unsupported operand types: stdClass ** string +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: stdClass ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** stdClass +TypeError: Unsupported operand types: resource ** null +TypeError: Unsupported operand types: null ** resource +TypeError: Unsupported operand types: resource ** bool +TypeError: Unsupported operand types: bool ** resource +TypeError: Unsupported operand types: resource ** bool +TypeError: Unsupported operand types: bool ** resource +TypeError: Unsupported operand types: resource ** int +TypeError: Unsupported operand types: int ** resource +TypeError: Unsupported operand types: resource ** float +TypeError: Unsupported operand types: float ** resource +TypeError: Unsupported operand types: resource ** string +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: resource ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** resource +TypeError: Unsupported operand types: string ** null +TypeError: Unsupported operand types: null ** string +TypeError: Unsupported operand types: string ** bool +TypeError: Unsupported operand types: bool ** string +TypeError: Unsupported operand types: string ** bool +TypeError: Unsupported operand types: bool ** string +TypeError: Unsupported operand types: string ** int +TypeError: Unsupported operand types: int ** string +TypeError: Unsupported operand types: string ** float +TypeError: Unsupported operand types: float ** string +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: string ** string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ** string +TypeError: Unsupported operand types: array << array +TypeError: Unsupported operand types: array << stdClass +TypeError: Unsupported operand types: array << resource +TypeError: Unsupported operand types: array << string +TypeError: Unsupported operand types: stdClass << array +TypeError: Unsupported operand types: stdClass << stdClass +TypeError: Unsupported operand types: stdClass << resource +TypeError: Unsupported operand types: stdClass << string +TypeError: Unsupported operand types: resource << array +TypeError: Unsupported operand types: resource << stdClass +TypeError: Unsupported operand types: resource << resource +TypeError: Unsupported operand types: resource << string +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: array << null +TypeError: Unsupported operand types: null << array +TypeError: Unsupported operand types: array << bool +TypeError: Unsupported operand types: bool << array +TypeError: Unsupported operand types: array << bool +TypeError: Unsupported operand types: bool << array +TypeError: Unsupported operand types: array << int +TypeError: Unsupported operand types: int << array +TypeError: Unsupported operand types: array << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << array -Unsupported operand types: array << string -Unsupported operand types: string << array -Unsupported operand types: array << string -Warning: A non-numeric value encountered -Unsupported operand types: string << array -Unsupported operand types: stdClass << null -Unsupported operand types: null << stdClass -Unsupported operand types: stdClass << bool -Unsupported operand types: bool << stdClass -Unsupported operand types: stdClass << bool -Unsupported operand types: bool << stdClass -Unsupported operand types: stdClass << int -Unsupported operand types: int << stdClass -Unsupported operand types: stdClass << float +TypeError: Unsupported operand types: float << array +TypeError: Unsupported operand types: array << string +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: array << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << array +TypeError: Unsupported operand types: stdClass << null +TypeError: Unsupported operand types: null << stdClass +TypeError: Unsupported operand types: stdClass << bool +TypeError: Unsupported operand types: bool << stdClass +TypeError: Unsupported operand types: stdClass << bool +TypeError: Unsupported operand types: bool << stdClass +TypeError: Unsupported operand types: stdClass << int +TypeError: Unsupported operand types: int << stdClass +TypeError: Unsupported operand types: stdClass << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << stdClass -Unsupported operand types: stdClass << string -Unsupported operand types: string << stdClass -Unsupported operand types: stdClass << string -Warning: A non-numeric value encountered -Unsupported operand types: string << stdClass -Unsupported operand types: resource << null -Unsupported operand types: null << resource -Unsupported operand types: resource << bool -Unsupported operand types: bool << resource -Unsupported operand types: resource << bool -Unsupported operand types: bool << resource -Unsupported operand types: resource << int -Unsupported operand types: int << resource -Unsupported operand types: resource << float +TypeError: Unsupported operand types: float << stdClass +TypeError: Unsupported operand types: stdClass << string +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: stdClass << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << stdClass +TypeError: Unsupported operand types: resource << null +TypeError: Unsupported operand types: null << resource +TypeError: Unsupported operand types: resource << bool +TypeError: Unsupported operand types: bool << resource +TypeError: Unsupported operand types: resource << bool +TypeError: Unsupported operand types: bool << resource +TypeError: Unsupported operand types: resource << int +TypeError: Unsupported operand types: int << resource +TypeError: Unsupported operand types: resource << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << resource -Unsupported operand types: resource << string -Unsupported operand types: string << resource -Unsupported operand types: resource << string -Warning: A non-numeric value encountered -Unsupported operand types: string << resource -Unsupported operand types: string << null -Unsupported operand types: null << string -Unsupported operand types: string << bool -Unsupported operand types: bool << string -Unsupported operand types: string << bool -Unsupported operand types: bool << string -Unsupported operand types: string << int -Unsupported operand types: int << string -Unsupported operand types: string << float +TypeError: Unsupported operand types: float << resource +TypeError: Unsupported operand types: resource << string +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: resource << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << resource +TypeError: Unsupported operand types: string << null +TypeError: Unsupported operand types: null << string +TypeError: Unsupported operand types: string << bool +TypeError: Unsupported operand types: bool << string +TypeError: Unsupported operand types: string << bool +TypeError: Unsupported operand types: bool << string +TypeError: Unsupported operand types: string << int +TypeError: Unsupported operand types: int << string +TypeError: Unsupported operand types: string << float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float << string -Unsupported operand types: string << string -Unsupported operand types: string << string -Unsupported operand types: string << string -Warning: A non-numeric value encountered -Unsupported operand types: string << string -Unsupported operand types: array >> array -Unsupported operand types: array >> stdClass -Unsupported operand types: array >> resource -Unsupported operand types: array >> string -Unsupported operand types: stdClass >> array -Unsupported operand types: stdClass >> stdClass -Unsupported operand types: stdClass >> resource -Unsupported operand types: stdClass >> string -Unsupported operand types: resource >> array -Unsupported operand types: resource >> stdClass -Unsupported operand types: resource >> resource -Unsupported operand types: resource >> string -Unsupported operand types: string >> array -Unsupported operand types: string >> stdClass -Unsupported operand types: string >> resource -Unsupported operand types: string >> string -Unsupported operand types: array >> null -Unsupported operand types: null >> array -Unsupported operand types: array >> bool -Unsupported operand types: bool >> array -Unsupported operand types: array >> bool -Unsupported operand types: bool >> array -Unsupported operand types: array >> int -Unsupported operand types: int >> array -Unsupported operand types: array >> float +TypeError: Unsupported operand types: float << string +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: string << string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string << string +TypeError: Unsupported operand types: array >> array +TypeError: Unsupported operand types: array >> stdClass +TypeError: Unsupported operand types: array >> resource +TypeError: Unsupported operand types: array >> string +TypeError: Unsupported operand types: stdClass >> array +TypeError: Unsupported operand types: stdClass >> stdClass +TypeError: Unsupported operand types: stdClass >> resource +TypeError: Unsupported operand types: stdClass >> string +TypeError: Unsupported operand types: resource >> array +TypeError: Unsupported operand types: resource >> stdClass +TypeError: Unsupported operand types: resource >> resource +TypeError: Unsupported operand types: resource >> string +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: array >> null +TypeError: Unsupported operand types: null >> array +TypeError: Unsupported operand types: array >> bool +TypeError: Unsupported operand types: bool >> array +TypeError: Unsupported operand types: array >> bool +TypeError: Unsupported operand types: bool >> array +TypeError: Unsupported operand types: array >> int +TypeError: Unsupported operand types: int >> array +TypeError: Unsupported operand types: array >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> array -Unsupported operand types: array >> string -Unsupported operand types: string >> array -Unsupported operand types: array >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> array -Unsupported operand types: stdClass >> null -Unsupported operand types: null >> stdClass -Unsupported operand types: stdClass >> bool -Unsupported operand types: bool >> stdClass -Unsupported operand types: stdClass >> bool -Unsupported operand types: bool >> stdClass -Unsupported operand types: stdClass >> int -Unsupported operand types: int >> stdClass -Unsupported operand types: stdClass >> float +TypeError: Unsupported operand types: float >> array +TypeError: Unsupported operand types: array >> string +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: array >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> array +TypeError: Unsupported operand types: stdClass >> null +TypeError: Unsupported operand types: null >> stdClass +TypeError: Unsupported operand types: stdClass >> bool +TypeError: Unsupported operand types: bool >> stdClass +TypeError: Unsupported operand types: stdClass >> bool +TypeError: Unsupported operand types: bool >> stdClass +TypeError: Unsupported operand types: stdClass >> int +TypeError: Unsupported operand types: int >> stdClass +TypeError: Unsupported operand types: stdClass >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> stdClass -Unsupported operand types: stdClass >> string -Unsupported operand types: string >> stdClass -Unsupported operand types: stdClass >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> stdClass -Unsupported operand types: resource >> null -Unsupported operand types: null >> resource -Unsupported operand types: resource >> bool -Unsupported operand types: bool >> resource -Unsupported operand types: resource >> bool -Unsupported operand types: bool >> resource -Unsupported operand types: resource >> int -Unsupported operand types: int >> resource -Unsupported operand types: resource >> float +TypeError: Unsupported operand types: float >> stdClass +TypeError: Unsupported operand types: stdClass >> string +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: stdClass >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> stdClass +TypeError: Unsupported operand types: resource >> null +TypeError: Unsupported operand types: null >> resource +TypeError: Unsupported operand types: resource >> bool +TypeError: Unsupported operand types: bool >> resource +TypeError: Unsupported operand types: resource >> bool +TypeError: Unsupported operand types: bool >> resource +TypeError: Unsupported operand types: resource >> int +TypeError: Unsupported operand types: int >> resource +TypeError: Unsupported operand types: resource >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> resource -Unsupported operand types: resource >> string -Unsupported operand types: string >> resource -Unsupported operand types: resource >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> resource -Unsupported operand types: string >> null -Unsupported operand types: null >> string -Unsupported operand types: string >> bool -Unsupported operand types: bool >> string -Unsupported operand types: string >> bool -Unsupported operand types: bool >> string -Unsupported operand types: string >> int -Unsupported operand types: int >> string -Unsupported operand types: string >> float +TypeError: Unsupported operand types: float >> resource +TypeError: Unsupported operand types: resource >> string +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: resource >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> resource +TypeError: Unsupported operand types: string >> null +TypeError: Unsupported operand types: null >> string +TypeError: Unsupported operand types: string >> bool +TypeError: Unsupported operand types: bool >> string +TypeError: Unsupported operand types: string >> bool +TypeError: Unsupported operand types: bool >> string +TypeError: Unsupported operand types: string >> int +TypeError: Unsupported operand types: int >> string +TypeError: Unsupported operand types: string >> float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float >> string -Unsupported operand types: string >> string -Unsupported operand types: string >> string -Unsupported operand types: string >> string -Warning: A non-numeric value encountered -Unsupported operand types: string >> string -Unsupported operand types: array & array -Unsupported operand types: array & stdClass -Unsupported operand types: array & resource -Unsupported operand types: array & string -Unsupported operand types: stdClass & array -Unsupported operand types: stdClass & stdClass -Unsupported operand types: stdClass & resource -Unsupported operand types: stdClass & string -Unsupported operand types: resource & array -Unsupported operand types: resource & stdClass -Unsupported operand types: resource & resource -Unsupported operand types: resource & string -Unsupported operand types: string & array -Unsupported operand types: string & stdClass -Unsupported operand types: string & resource +TypeError: Unsupported operand types: float >> string +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: string >> string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string >> string +TypeError: Unsupported operand types: array & array +TypeError: Unsupported operand types: array & stdClass +TypeError: Unsupported operand types: array & resource +TypeError: Unsupported operand types: array & string +TypeError: Unsupported operand types: stdClass & array +TypeError: Unsupported operand types: stdClass & stdClass +TypeError: Unsupported operand types: stdClass & resource +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: resource & array +TypeError: Unsupported operand types: resource & stdClass +TypeError: Unsupported operand types: resource & resource +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: string & stdClass +TypeError: Unsupported operand types: string & resource No error for "foo" &= "foo" -Unsupported operand types: array & null -Unsupported operand types: null & array -Unsupported operand types: array & bool -Unsupported operand types: bool & array -Unsupported operand types: array & bool -Unsupported operand types: bool & array -Unsupported operand types: array & int -Unsupported operand types: int & array -Unsupported operand types: array & float +TypeError: Unsupported operand types: array & null +TypeError: Unsupported operand types: null & array +TypeError: Unsupported operand types: array & bool +TypeError: Unsupported operand types: bool & array +TypeError: Unsupported operand types: array & bool +TypeError: Unsupported operand types: bool & array +TypeError: Unsupported operand types: array & int +TypeError: Unsupported operand types: int & array +TypeError: Unsupported operand types: array & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & array -Unsupported operand types: array & string -Unsupported operand types: string & array -Unsupported operand types: array & string -Warning: A non-numeric value encountered -Unsupported operand types: string & array -Unsupported operand types: stdClass & null -Unsupported operand types: null & stdClass -Unsupported operand types: stdClass & bool -Unsupported operand types: bool & stdClass -Unsupported operand types: stdClass & bool -Unsupported operand types: bool & stdClass -Unsupported operand types: stdClass & int -Unsupported operand types: int & stdClass -Unsupported operand types: stdClass & float +TypeError: Unsupported operand types: float & array +TypeError: Unsupported operand types: array & string +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: array & string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string & array +TypeError: Unsupported operand types: stdClass & null +TypeError: Unsupported operand types: null & stdClass +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: bool & stdClass +TypeError: Unsupported operand types: stdClass & bool +TypeError: Unsupported operand types: bool & stdClass +TypeError: Unsupported operand types: stdClass & int +TypeError: Unsupported operand types: int & stdClass +TypeError: Unsupported operand types: stdClass & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & stdClass -Unsupported operand types: stdClass & string -Unsupported operand types: string & stdClass -Unsupported operand types: stdClass & string -Warning: A non-numeric value encountered -Unsupported operand types: string & stdClass -Unsupported operand types: resource & null -Unsupported operand types: null & resource -Unsupported operand types: resource & bool -Unsupported operand types: bool & resource -Unsupported operand types: resource & bool -Unsupported operand types: bool & resource -Unsupported operand types: resource & int -Unsupported operand types: int & resource -Unsupported operand types: resource & float +TypeError: Unsupported operand types: float & stdClass +TypeError: Unsupported operand types: stdClass & string +TypeError: Unsupported operand types: string & stdClass +TypeError: Unsupported operand types: stdClass & string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string & stdClass +TypeError: Unsupported operand types: resource & null +TypeError: Unsupported operand types: null & resource +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: bool & resource +TypeError: Unsupported operand types: resource & bool +TypeError: Unsupported operand types: bool & resource +TypeError: Unsupported operand types: resource & int +TypeError: Unsupported operand types: int & resource +TypeError: Unsupported operand types: resource & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & resource -Unsupported operand types: resource & string -Unsupported operand types: string & resource -Unsupported operand types: resource & string -Warning: A non-numeric value encountered -Unsupported operand types: string & resource -Unsupported operand types: string & null -Unsupported operand types: null & string -Unsupported operand types: string & bool -Unsupported operand types: bool & string -Unsupported operand types: string & bool -Unsupported operand types: bool & string -Unsupported operand types: string & int -Unsupported operand types: int & string -Unsupported operand types: string & float +TypeError: Unsupported operand types: float & resource +TypeError: Unsupported operand types: resource & string +TypeError: Unsupported operand types: string & resource +TypeError: Unsupported operand types: resource & string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string & resource +TypeError: Unsupported operand types: string & null +TypeError: Unsupported operand types: null & string +TypeError: Unsupported operand types: string & bool +TypeError: Unsupported operand types: bool & string +TypeError: Unsupported operand types: string & bool +TypeError: Unsupported operand types: bool & string +TypeError: Unsupported operand types: string & int +TypeError: Unsupported operand types: int & string +TypeError: Unsupported operand types: string & float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float & string +TypeError: Unsupported operand types: float & string No error for "foo" &= "123" No error for "123" &= "foo" No error for "foo" &= "123foo" No error for "123foo" &= "foo" -Unsupported operand types: array | array -Unsupported operand types: array | stdClass -Unsupported operand types: array | resource -Unsupported operand types: array | string -Unsupported operand types: stdClass | array -Unsupported operand types: stdClass | stdClass -Unsupported operand types: stdClass | resource -Unsupported operand types: stdClass | string -Unsupported operand types: resource | array -Unsupported operand types: resource | stdClass -Unsupported operand types: resource | resource -Unsupported operand types: resource | string -Unsupported operand types: string | array -Unsupported operand types: string | stdClass -Unsupported operand types: string | resource +TypeError: Unsupported operand types: array | array +TypeError: Unsupported operand types: array | stdClass +TypeError: Unsupported operand types: array | resource +TypeError: Unsupported operand types: array | string +TypeError: Unsupported operand types: stdClass | array +TypeError: Unsupported operand types: stdClass | stdClass +TypeError: Unsupported operand types: stdClass | resource +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: resource | array +TypeError: Unsupported operand types: resource | stdClass +TypeError: Unsupported operand types: resource | resource +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: string | stdClass +TypeError: Unsupported operand types: string | resource No error for "foo" |= "foo" -Unsupported operand types: array | null -Unsupported operand types: null | array -Unsupported operand types: array | bool -Unsupported operand types: bool | array -Unsupported operand types: array | bool -Unsupported operand types: bool | array -Unsupported operand types: array | int -Unsupported operand types: int | array -Unsupported operand types: array | float +TypeError: Unsupported operand types: array | null +TypeError: Unsupported operand types: null | array +TypeError: Unsupported operand types: array | bool +TypeError: Unsupported operand types: bool | array +TypeError: Unsupported operand types: array | bool +TypeError: Unsupported operand types: bool | array +TypeError: Unsupported operand types: array | int +TypeError: Unsupported operand types: int | array +TypeError: Unsupported operand types: array | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | array -Unsupported operand types: array | string -Unsupported operand types: string | array -Unsupported operand types: array | string -Warning: A non-numeric value encountered -Unsupported operand types: string | array -Unsupported operand types: stdClass | null -Unsupported operand types: null | stdClass -Unsupported operand types: stdClass | bool -Unsupported operand types: bool | stdClass -Unsupported operand types: stdClass | bool -Unsupported operand types: bool | stdClass -Unsupported operand types: stdClass | int -Unsupported operand types: int | stdClass -Unsupported operand types: stdClass | float +TypeError: Unsupported operand types: float | array +TypeError: Unsupported operand types: array | string +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: array | string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string | array +TypeError: Unsupported operand types: stdClass | null +TypeError: Unsupported operand types: null | stdClass +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: bool | stdClass +TypeError: Unsupported operand types: stdClass | bool +TypeError: Unsupported operand types: bool | stdClass +TypeError: Unsupported operand types: stdClass | int +TypeError: Unsupported operand types: int | stdClass +TypeError: Unsupported operand types: stdClass | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | stdClass -Unsupported operand types: stdClass | string -Unsupported operand types: string | stdClass -Unsupported operand types: stdClass | string -Warning: A non-numeric value encountered -Unsupported operand types: string | stdClass -Unsupported operand types: resource | null -Unsupported operand types: null | resource -Unsupported operand types: resource | bool -Unsupported operand types: bool | resource -Unsupported operand types: resource | bool -Unsupported operand types: bool | resource -Unsupported operand types: resource | int -Unsupported operand types: int | resource -Unsupported operand types: resource | float +TypeError: Unsupported operand types: float | stdClass +TypeError: Unsupported operand types: stdClass | string +TypeError: Unsupported operand types: string | stdClass +TypeError: Unsupported operand types: stdClass | string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string | stdClass +TypeError: Unsupported operand types: resource | null +TypeError: Unsupported operand types: null | resource +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: bool | resource +TypeError: Unsupported operand types: resource | bool +TypeError: Unsupported operand types: bool | resource +TypeError: Unsupported operand types: resource | int +TypeError: Unsupported operand types: int | resource +TypeError: Unsupported operand types: resource | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | resource -Unsupported operand types: resource | string -Unsupported operand types: string | resource -Unsupported operand types: resource | string -Warning: A non-numeric value encountered -Unsupported operand types: string | resource -Unsupported operand types: string | null -Unsupported operand types: null | string -Unsupported operand types: string | bool -Unsupported operand types: bool | string -Unsupported operand types: string | bool -Unsupported operand types: bool | string -Unsupported operand types: string | int -Unsupported operand types: int | string -Unsupported operand types: string | float +TypeError: Unsupported operand types: float | resource +TypeError: Unsupported operand types: resource | string +TypeError: Unsupported operand types: string | resource +TypeError: Unsupported operand types: resource | string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string | resource +TypeError: Unsupported operand types: string | null +TypeError: Unsupported operand types: null | string +TypeError: Unsupported operand types: string | bool +TypeError: Unsupported operand types: bool | string +TypeError: Unsupported operand types: string | bool +TypeError: Unsupported operand types: bool | string +TypeError: Unsupported operand types: string | int +TypeError: Unsupported operand types: int | string +TypeError: Unsupported operand types: string | float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float | string +TypeError: Unsupported operand types: float | string No error for "foo" |= "123" No error for "123" |= "foo" No error for "foo" |= "123foo" No error for "123foo" |= "foo" -Unsupported operand types: array ^ array -Unsupported operand types: array ^ stdClass -Unsupported operand types: array ^ resource -Unsupported operand types: array ^ string -Unsupported operand types: stdClass ^ array -Unsupported operand types: stdClass ^ stdClass -Unsupported operand types: stdClass ^ resource -Unsupported operand types: stdClass ^ string -Unsupported operand types: resource ^ array -Unsupported operand types: resource ^ stdClass -Unsupported operand types: resource ^ resource -Unsupported operand types: resource ^ string -Unsupported operand types: string ^ array -Unsupported operand types: string ^ stdClass -Unsupported operand types: string ^ resource +TypeError: Unsupported operand types: array ^ array +TypeError: Unsupported operand types: array ^ stdClass +TypeError: Unsupported operand types: array ^ resource +TypeError: Unsupported operand types: array ^ string +TypeError: Unsupported operand types: stdClass ^ array +TypeError: Unsupported operand types: stdClass ^ stdClass +TypeError: Unsupported operand types: stdClass ^ resource +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: resource ^ array +TypeError: Unsupported operand types: resource ^ stdClass +TypeError: Unsupported operand types: resource ^ resource +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: string ^ stdClass +TypeError: Unsupported operand types: string ^ resource No error for "foo" ^= "foo" -Unsupported operand types: array ^ null -Unsupported operand types: null ^ array -Unsupported operand types: array ^ bool -Unsupported operand types: bool ^ array -Unsupported operand types: array ^ bool -Unsupported operand types: bool ^ array -Unsupported operand types: array ^ int -Unsupported operand types: int ^ array -Unsupported operand types: array ^ float +TypeError: Unsupported operand types: array ^ null +TypeError: Unsupported operand types: null ^ array +TypeError: Unsupported operand types: array ^ bool +TypeError: Unsupported operand types: bool ^ array +TypeError: Unsupported operand types: array ^ bool +TypeError: Unsupported operand types: bool ^ array +TypeError: Unsupported operand types: array ^ int +TypeError: Unsupported operand types: int ^ array +TypeError: Unsupported operand types: array ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ array -Unsupported operand types: array ^ string -Unsupported operand types: string ^ array -Unsupported operand types: array ^ string -Warning: A non-numeric value encountered -Unsupported operand types: string ^ array -Unsupported operand types: stdClass ^ null -Unsupported operand types: null ^ stdClass -Unsupported operand types: stdClass ^ bool -Unsupported operand types: bool ^ stdClass -Unsupported operand types: stdClass ^ bool -Unsupported operand types: bool ^ stdClass -Unsupported operand types: stdClass ^ int -Unsupported operand types: int ^ stdClass -Unsupported operand types: stdClass ^ float +TypeError: Unsupported operand types: float ^ array +TypeError: Unsupported operand types: array ^ string +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: array ^ string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ^ array +TypeError: Unsupported operand types: stdClass ^ null +TypeError: Unsupported operand types: null ^ stdClass +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: bool ^ stdClass +TypeError: Unsupported operand types: stdClass ^ bool +TypeError: Unsupported operand types: bool ^ stdClass +TypeError: Unsupported operand types: stdClass ^ int +TypeError: Unsupported operand types: int ^ stdClass +TypeError: Unsupported operand types: stdClass ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ stdClass -Unsupported operand types: stdClass ^ string -Unsupported operand types: string ^ stdClass -Unsupported operand types: stdClass ^ string -Warning: A non-numeric value encountered -Unsupported operand types: string ^ stdClass -Unsupported operand types: resource ^ null -Unsupported operand types: null ^ resource -Unsupported operand types: resource ^ bool -Unsupported operand types: bool ^ resource -Unsupported operand types: resource ^ bool -Unsupported operand types: bool ^ resource -Unsupported operand types: resource ^ int -Unsupported operand types: int ^ resource -Unsupported operand types: resource ^ float +TypeError: Unsupported operand types: float ^ stdClass +TypeError: Unsupported operand types: stdClass ^ string +TypeError: Unsupported operand types: string ^ stdClass +TypeError: Unsupported operand types: stdClass ^ string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ^ stdClass +TypeError: Unsupported operand types: resource ^ null +TypeError: Unsupported operand types: null ^ resource +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: bool ^ resource +TypeError: Unsupported operand types: resource ^ bool +TypeError: Unsupported operand types: bool ^ resource +TypeError: Unsupported operand types: resource ^ int +TypeError: Unsupported operand types: int ^ resource +TypeError: Unsupported operand types: resource ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ resource -Unsupported operand types: resource ^ string -Unsupported operand types: string ^ resource -Unsupported operand types: resource ^ string -Warning: A non-numeric value encountered -Unsupported operand types: string ^ resource -Unsupported operand types: string ^ null -Unsupported operand types: null ^ string -Unsupported operand types: string ^ bool -Unsupported operand types: bool ^ string -Unsupported operand types: string ^ bool -Unsupported operand types: bool ^ string -Unsupported operand types: string ^ int -Unsupported operand types: int ^ string -Unsupported operand types: string ^ float +TypeError: Unsupported operand types: float ^ resource +TypeError: Unsupported operand types: resource ^ string +TypeError: Unsupported operand types: string ^ resource +TypeError: Unsupported operand types: resource ^ string +Warning: A non-numeric value encountered +TypeError: Unsupported operand types: string ^ resource +TypeError: Unsupported operand types: string ^ null +TypeError: Unsupported operand types: null ^ string +TypeError: Unsupported operand types: string ^ bool +TypeError: Unsupported operand types: bool ^ string +TypeError: Unsupported operand types: string ^ bool +TypeError: Unsupported operand types: bool ^ string +TypeError: Unsupported operand types: string ^ int +TypeError: Unsupported operand types: int ^ string +TypeError: Unsupported operand types: string ^ float Warning: Implicit conversion from float 3.5 to int loses precision -Unsupported operand types: float ^ string +TypeError: Unsupported operand types: float ^ string No error for "foo" ^= "123" No error for "123" ^= "foo" No error for "foo" ^= "123foo" @@ -1999,23 +1999,23 @@ Warning: Array to string conversion Warning: Array to string conversion No error for [] .= [] Warning: Array to string conversion -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string Warning: Array to string conversion No error for [] .= STDOUT Warning: Array to string conversion No error for [] .= "foo" -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string Warning: Array to string conversion No error for STDOUT .= [] -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for STDOUT .= STDOUT No error for STDOUT .= "foo" Warning: Array to string conversion No error for "foo" .= [] -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for "foo" .= STDOUT No error for "foo" .= "foo" Warning: Array to string conversion @@ -2046,20 +2046,20 @@ Warning: Array to string conversion No error for [] .= "123foo" Warning: Array to string conversion No error for "123foo" .= [] -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string No error for STDOUT .= null No error for null .= STDOUT No error for STDOUT .= true @@ -2091,19 +2091,19 @@ No error for "123foo" .= "foo" UNARY OP: -Cannot perform bitwise not on array -Cannot perform bitwise not on stdClass -Cannot perform bitwise not on resource +TypeError: Cannot perform bitwise not on array +TypeError: Cannot perform bitwise not on stdClass +TypeError: Cannot perform bitwise not on resource No error for ~"foo" INCDEC: -Cannot increment array -Cannot decrement array -Cannot increment stdClass -Cannot decrement stdClass -Cannot increment resource -Cannot decrement resource +TypeError: Cannot increment array +TypeError: Cannot decrement array +TypeError: Cannot increment stdClass +TypeError: Cannot decrement stdClass +TypeError: Cannot increment resource +TypeError: Cannot decrement resource Warning: Increment on non-numeric string is deprecated, use str_increment() instead No error for fop++ Warning: Decrement on non-numeric string has no effect and is deprecated diff --git a/Zend/tests/oss_fuzz_434346548.phpt b/Zend/tests/oss_fuzz_434346548.phpt index 139e36758bc4..fddea7f19640 100644 --- a/Zend/tests/oss_fuzz_434346548.phpt +++ b/Zend/tests/oss_fuzz_434346548.phpt @@ -14,9 +14,9 @@ function test($y = new Foo() < "") { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foo::__toString(): Return value must be of type string, none returned +TypeError: Foo::__toString(): Return value must be of type string, none returned diff --git a/Zend/tests/pipe_operator/ast.phpt b/Zend/tests/pipe_operator/ast.phpt index e8c088dabfdb..e6071d4885f7 100644 --- a/Zend/tests/pipe_operator/ast.phpt +++ b/Zend/tests/pipe_operator/ast.phpt @@ -8,37 +8,37 @@ print "Concat, which binds higher\n"; try { assert(false && foo() . bar() |> baz() . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && (foo() . bar()) |> baz() . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() . (bar() |> baz()) . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() . bar() |> (baz() . quux())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && (foo() . bar() |> baz()) . quux()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() . (bar() |> baz() . quux())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } print "<, which binds lower\n"; @@ -46,37 +46,37 @@ print "<, which binds lower\n"; try { assert(false && foo() < bar() |> baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && (foo() < bar()) |> baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() < (bar() |> baz())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() |> bar() < baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && (foo() |> bar()) < baz()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(false && foo() |> (bar() < baz())); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -86,24 +86,24 @@ print "misc examples\n"; try { assert(false && foo() |> (bar() |> baz(...))); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Concat, which binds higher -assert(false && foo() . bar() |> baz() . quux()) -assert(false && foo() . bar() |> baz() . quux()) -assert(false && foo() . (bar() |> baz()) . quux()) -assert(false && foo() . bar() |> baz() . quux()) -assert(false && (foo() . bar() |> baz()) . quux()) -assert(false && foo() . (bar() |> baz() . quux())) +AssertionError: assert(false && foo() . bar() |> baz() . quux()) +AssertionError: assert(false && foo() . bar() |> baz() . quux()) +AssertionError: assert(false && foo() . (bar() |> baz()) . quux()) +AssertionError: assert(false && foo() . bar() |> baz() . quux()) +AssertionError: assert(false && (foo() . bar() |> baz()) . quux()) +AssertionError: assert(false && foo() . (bar() |> baz() . quux())) <, which binds lower -assert(false && foo() < bar() |> baz()) -assert(false && (foo() < bar()) |> baz()) -assert(false && foo() < bar() |> baz()) -assert(false && foo() |> bar() < baz()) -assert(false && foo() |> bar() < baz()) -assert(false && foo() |> (bar() < baz())) +AssertionError: assert(false && foo() < bar() |> baz()) +AssertionError: assert(false && (foo() < bar()) |> baz()) +AssertionError: assert(false && foo() < bar() |> baz()) +AssertionError: assert(false && foo() |> bar() < baz()) +AssertionError: assert(false && foo() |> bar() < baz()) +AssertionError: assert(false && foo() |> (bar() < baz())) misc examples -assert(false && foo() |> (bar() |> baz(...))) +AssertionError: assert(false && foo() |> (bar() |> baz(...))) diff --git a/Zend/tests/pipe_operator/call_by_ref.phpt b/Zend/tests/pipe_operator/call_by_ref.phpt index 026089b0a654..869b6072f035 100644 --- a/Zend/tests/pipe_operator/call_by_ref.phpt +++ b/Zend/tests/pipe_operator/call_by_ref.phpt @@ -18,7 +18,7 @@ try { $res1 = $a |> _modify(...); var_dump($res1); } catch (\Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // Complex variables. @@ -27,11 +27,11 @@ try { $res2 = $a |> _append(...); var_dump($res2); } catch (\Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -_modify(): Argument #1 ($a) could not be passed by reference -_append(): Argument #1 ($a) could not be passed by reference +Error: _modify(): Argument #1 ($a) could not be passed by reference +Error: _append(): Argument #1 ($a) could not be passed by reference diff --git a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt index 31750ac280d7..529014fafe21 100644 --- a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt +++ b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt @@ -9,7 +9,7 @@ try { $r = $a |> array_multisort(...); var_dump($r); } catch (\Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/pipe_operator/exception_interruption.phpt b/Zend/tests/pipe_operator/exception_interruption.phpt index 6711b652e7c6..cb028e8a3e2f 100644 --- a/Zend/tests/pipe_operator/exception_interruption.phpt +++ b/Zend/tests/pipe_operator/exception_interruption.phpt @@ -14,7 +14,7 @@ try { |> var_dump(...); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -24,7 +24,7 @@ try { |> var_dump(...); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/pipe_operator/function_not_found.phpt b/Zend/tests/pipe_operator/function_not_found.phpt index 747f53ce3e3d..a7370d7a8dfa 100644 --- a/Zend/tests/pipe_operator/function_not_found.phpt +++ b/Zend/tests/pipe_operator/function_not_found.phpt @@ -7,7 +7,7 @@ try { $res1 = 5 |> '_test'; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt index 2ecfbab6348f..4d65ebbae460 100644 --- a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt +++ b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt @@ -6,21 +6,21 @@ OSS-Fuzz #427814452 try { false |> assert(...); } catch (\AssertionError $e) { - echo $e::class, ": '", $e->getMessage(), "'\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { 0 |> "assert"(...); } catch (\AssertionError $e) { - echo $e::class, ": '", $e->getMessage(), "'\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { false |> ("a"."ssert")(...); } catch (\AssertionError $e) { - echo $e::class, ": '", $e->getMessage(), "'\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -AssertionError: '' -AssertionError: '' -AssertionError: '' +AssertionError: +AssertionError: +AssertionError: diff --git a/Zend/tests/pipe_operator/prec_005.phpt b/Zend/tests/pipe_operator/prec_005.phpt index 0dd262324e3d..4d15a93dec77 100644 --- a/Zend/tests/pipe_operator/prec_005.phpt +++ b/Zend/tests/pipe_operator/prec_005.phpt @@ -6,9 +6,9 @@ Pipe precedence 005 try { assert(false && 1 |> (fn() => 2)); } catch (AssertionError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && 1 |> (fn() => 2)) +AssertionError: assert(false && 1 |> (fn() => 2)) diff --git a/Zend/tests/pipe_operator/too_many_parameters.phpt b/Zend/tests/pipe_operator/too_many_parameters.phpt index b36046bde05c..ef727952ca2d 100644 --- a/Zend/tests/pipe_operator/too_many_parameters.phpt +++ b/Zend/tests/pipe_operator/too_many_parameters.phpt @@ -12,7 +12,7 @@ try { $res1 = 5 |> '_test'; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } diff --git a/Zend/tests/pipe_operator/type_mismatch.phpt b/Zend/tests/pipe_operator/type_mismatch.phpt index 2cee15bb47a0..3a2fe1371a3c 100644 --- a/Zend/tests/pipe_operator/type_mismatch.phpt +++ b/Zend/tests/pipe_operator/type_mismatch.phpt @@ -12,7 +12,7 @@ try { var_dump($res1); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/pipe_operator/void_return.phpt b/Zend/tests/pipe_operator/void_return.phpt index 0dbba519297c..e7d463eb0335 100644 --- a/Zend/tests/pipe_operator/void_return.phpt +++ b/Zend/tests/pipe_operator/void_return.phpt @@ -13,7 +13,7 @@ try { var_dump($result); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/Zend/tests/pow_array_leak.phpt b/Zend/tests/pow_array_leak.phpt index 06dce0ac6a2b..f6c40ad239a6 100644 --- a/Zend/tests/pow_array_leak.phpt +++ b/Zend/tests/pow_array_leak.phpt @@ -7,7 +7,7 @@ $x = [0]; try { $x **= 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($x); @@ -15,18 +15,18 @@ $x = [0]; try { $x **= $x; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($x); ?> --EXPECT-- -Unsupported operand types: array ** int +TypeError: Unsupported operand types: array ** int array(1) { [0]=> int(0) } -Unsupported operand types: array ** array +TypeError: Unsupported operand types: array ** array array(1) { [0]=> int(0) diff --git a/Zend/tests/prop_const_expr/non_enums_rhs.phpt b/Zend/tests/prop_const_expr/non_enums_rhs.phpt index 0bffe9d8e02f..c5605c2ffdb9 100644 --- a/Zend/tests/prop_const_expr/non_enums_rhs.phpt +++ b/Zend/tests/prop_const_expr/non_enums_rhs.phpt @@ -13,7 +13,7 @@ function test() { try { foo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -22,5 +22,5 @@ test(); ?> --EXPECT-- -Fetching properties on non-enums in constant expressions is not allowed -Fetching properties on non-enums in constant expressions is not allowed +Error: Fetching properties on non-enums in constant expressions is not allowed +Error: Fetching properties on non-enums in constant expressions is not allowed diff --git a/Zend/tests/property_access_errors_for_guarded_properties.phpt b/Zend/tests/property_access_errors_for_guarded_properties.phpt index 0a360a9447d7..c483c56f2e8e 100644 --- a/Zend/tests/property_access_errors_for_guarded_properties.phpt +++ b/Zend/tests/property_access_errors_for_guarded_properties.phpt @@ -35,21 +35,21 @@ $test = new Test; try { $test->prop = "bar"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access private property Test::$prop -Cannot access private property Test::$prop -Cannot access private property Test::$prop +Error: Cannot access private property Test::$prop +Error: Cannot access private property Test::$prop +Error: Cannot access private property Test::$prop diff --git a/Zend/tests/property_exists_basic.phpt b/Zend/tests/property_exists_basic.phpt index 8412699e026b..964514a37692 100644 --- a/Zend/tests/property_exists_basic.phpt +++ b/Zend/tests/property_exists_basic.phpt @@ -43,27 +43,27 @@ var_dump(property_exists($foo,"")); try { var_dump(property_exists(array(), "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(property_exists(1, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(property_exists(3.14, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(property_exists(true, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(property_exists(null, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $foo->bar(); @@ -86,11 +86,11 @@ bool(true) bool(true) bool(false) bool(false) -property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given -property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given -property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given -property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given -property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given bool(true) bool(true) bool(true) diff --git a/Zend/tests/property_hooks/ast_printing.phpt b/Zend/tests/property_hooks/ast_printing.phpt index 128a84964016..8053685f686f 100644 --- a/Zend/tests/property_hooks/ast_printing.phpt +++ b/Zend/tests/property_hooks/ast_printing.phpt @@ -20,12 +20,12 @@ try { } }); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && new class { +AssertionError: assert(false && new class { public $prop1 { get; set; diff --git a/Zend/tests/property_hooks/backed_delegated_read_write.phpt b/Zend/tests/property_hooks/backed_delegated_read_write.phpt index df85768fe516..712cedf3ffd3 100644 --- a/Zend/tests/property_hooks/backed_delegated_read_write.phpt +++ b/Zend/tests/property_hooks/backed_delegated_read_write.phpt @@ -46,13 +46,13 @@ $test = new Test; try { $test->prop = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $child = new Child(); @@ -61,6 +61,6 @@ var_dump($child->prop2); ?> --EXPECTF-- -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? int(43) diff --git a/Zend/tests/property_hooks/bug001.phpt b/Zend/tests/property_hooks/bug001.phpt index 62291019b333..8fc591222802 100644 --- a/Zend/tests/property_hooks/bug001.phpt +++ b/Zend/tests/property_hooks/bug001.phpt @@ -21,10 +21,10 @@ $c = new C; try { $c->x = 3; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -Cannot write to get-only virtual property C::$x +Error: Cannot write to get-only virtual property C::$x diff --git a/Zend/tests/property_hooks/cache.phpt b/Zend/tests/property_hooks/cache.phpt index dedbfa48f4ac..5fe6f6b09d36 100644 --- a/Zend/tests/property_hooks/cache.phpt +++ b/Zend/tests/property_hooks/cache.phpt @@ -19,14 +19,14 @@ function doTest(Test $test) { try { $test->prop[] = 1; } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } isset($test->prop); isset($test->prop[0]); try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -46,10 +46,10 @@ Test::$prop::get Test::$prop::set Test::$prop::set Test::$prop::get -Indirect modification of Test::$prop is not allowed +Error: Indirect modification of Test::$prop is not allowed Test::$prop::get Test::$prop::get -Cannot unset hooked property Test::$prop +Error: Cannot unset hooked property Test::$prop Test::$prop::set Test::$prop::get @@ -58,7 +58,7 @@ Test::$prop::get Test::$prop::set Test::$prop::set Test::$prop::get -Indirect modification of Test::$prop is not allowed +Error: Indirect modification of Test::$prop is not allowed Test::$prop::get Test::$prop::get -Cannot unset hooked property Test::$prop +Error: Cannot unset hooked property Test::$prop diff --git a/Zend/tests/property_hooks/default_value_inheritance.phpt b/Zend/tests/property_hooks/default_value_inheritance.phpt index 3821e19634e7..a6ceb29b9fca 100644 --- a/Zend/tests/property_hooks/default_value_inheritance.phpt +++ b/Zend/tests/property_hooks/default_value_inheritance.phpt @@ -29,13 +29,13 @@ function test(P $p) { try { var_dump($p->b); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($p->c); try { var_dump($p->d); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -45,10 +45,10 @@ test(new GC); ?> --EXPECT-- NULL -Typed property C::$b must not be accessed before initialization +Error: Typed property C::$b must not be accessed before initialization int(2) int(2) NULL -Typed property GC::$b must not be accessed before initialization +Error: Typed property GC::$b must not be accessed before initialization NULL -Typed property GC::$d must not be accessed before initialization +Error: Typed property GC::$d must not be accessed before initialization diff --git a/Zend/tests/property_hooks/direct_hook_call.phpt b/Zend/tests/property_hooks/direct_hook_call.phpt index d97ef4c469a4..566d4b0efcc5 100644 --- a/Zend/tests/property_hooks/direct_hook_call.phpt +++ b/Zend/tests/property_hooks/direct_hook_call.phpt @@ -14,15 +14,15 @@ $test = new Test; try { $test->{'$prop::get'}(); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->{'$prop::set'}('foo'); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined method Test::$prop::get() -Call to undefined method Test::$prop::set() +Error: Call to undefined method Test::$prop::get() +Error: Call to undefined method Test::$prop::set() diff --git a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt index 32aa1f27dc32..c82af2899446 100644 --- a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt +++ b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt @@ -7,11 +7,11 @@ try { public function __construct(public final $prop) {} }); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && new class { +AssertionError: assert(false && new class { public function __construct(public final $prop) { } diff --git a/Zend/tests/property_hooks/foreach_val_to_ref.phpt b/Zend/tests/property_hooks/foreach_val_to_ref.phpt index dba71412579f..220945409014 100644 --- a/Zend/tests/property_hooks/foreach_val_to_ref.phpt +++ b/Zend/tests/property_hooks/foreach_val_to_ref.phpt @@ -25,10 +25,10 @@ function test($object) { try { test(new ByVal); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(42) -Cannot create reference to property ByVal::$byVal +Error: Cannot create reference to property ByVal::$byVal diff --git a/Zend/tests/property_hooks/get.phpt b/Zend/tests/property_hooks/get.phpt index 6d4b005843ea..cc77227b2865 100644 --- a/Zend/tests/property_hooks/get.phpt +++ b/Zend/tests/property_hooks/get.phpt @@ -15,10 +15,10 @@ var_dump($test->prop); try { $test->prop = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(42) -Cannot write to get-only virtual property Test::$prop +Error: Cannot write to get-only virtual property Test::$prop diff --git a/Zend/tests/property_hooks/get_by_ref.phpt b/Zend/tests/property_hooks/get_by_ref.phpt index f602721a791d..7bcd47f4ddc1 100644 --- a/Zend/tests/property_hooks/get_by_ref.phpt +++ b/Zend/tests/property_hooks/get_by_ref.phpt @@ -16,19 +16,19 @@ try { $test->byVal = []; $test->byVal[] = 42; } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->byVal); try { $test->byVal =& $ref; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Indirect modification of Test::$byVal is not allowed +Error: Indirect modification of Test::$byVal is not allowed array(0) { } -Cannot assign by reference to overloaded object +Error: Cannot assign by reference to overloaded object diff --git a/Zend/tests/property_hooks/get_by_ref_auto.phpt b/Zend/tests/property_hooks/get_by_ref_auto.phpt index 0dabe4c45211..322e78d69998 100644 --- a/Zend/tests/property_hooks/get_by_ref_auto.phpt +++ b/Zend/tests/property_hooks/get_by_ref_auto.phpt @@ -12,14 +12,14 @@ $test = new Test; try { $test->byVal[] = 42; } catch (\Error $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->byVal); try { $test->byVal =& $ref; } catch (Error $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/property_hooks/get_type_check.phpt b/Zend/tests/property_hooks/get_type_check.phpt index 2e0e9b9fcf6e..e9d54caccd2e 100644 --- a/Zend/tests/property_hooks/get_type_check.phpt +++ b/Zend/tests/property_hooks/get_type_check.phpt @@ -16,11 +16,11 @@ $test = new Test; try { var_dump($test->prop1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop2); ?> --EXPECT-- -Test::$prop1::get(): Return value must be of type int, string returned +TypeError: Test::$prop1::get(): Return value must be of type int, string returned int(42) diff --git a/Zend/tests/property_hooks/gh15187_3.phpt b/Zend/tests/property_hooks/gh15187_3.phpt index d82e6002f82b..712a8ba12b2d 100644 --- a/Zend/tests/property_hooks/gh15187_3.phpt +++ b/Zend/tests/property_hooks/gh15187_3.phpt @@ -18,7 +18,7 @@ foreach ($c as $k => &$v) { try { $v = 'foo'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } if ($k === 'd') { @@ -31,7 +31,7 @@ var_dump($c); ?> --EXPECTF-- int(1) -Cannot assign string to reference held by property C::$c of type int +TypeError: Cannot assign string to reference held by property C::$c of type int int(2) object(C)#%d (2) { ["b"]=> diff --git a/Zend/tests/property_hooks/gh15644.phpt b/Zend/tests/property_hooks/gh15644.phpt index 1e0dda3a0e44..360c557c7757 100644 --- a/Zend/tests/property_hooks/gh15644.phpt +++ b/Zend/tests/property_hooks/gh15644.phpt @@ -17,16 +17,16 @@ $c = new C(); try { $c->prop1 = 'hello world'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $c->prop2 = 'hello world'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify private(set) property C::$prop1 from global scope -Cannot modify private(set) property C::$prop2 from global scope +Error: Cannot modify private(set) property C::$prop1 from global scope +Error: Cannot modify private(set) property C::$prop2 from global scope diff --git a/Zend/tests/property_hooks/gh16185_002.phpt b/Zend/tests/property_hooks/gh16185_002.phpt index 39edba438b04..894edcc12148 100644 --- a/Zend/tests/property_hooks/gh16185_002.phpt +++ b/Zend/tests/property_hooks/gh16185_002.phpt @@ -22,9 +22,9 @@ $c->init(); try { foreach ($c as &$prop) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot acquire reference to readonly property C::$prop +Error: Cannot acquire reference to readonly property C::$prop diff --git a/Zend/tests/property_hooks/gh17101.phpt b/Zend/tests/property_hooks/gh17101.phpt index 3ab53fb75da0..a4302971642b 100644 --- a/Zend/tests/property_hooks/gh17101.phpt +++ b/Zend/tests/property_hooks/gh17101.phpt @@ -8,12 +8,12 @@ try { public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {} }); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && new class { +AssertionError: assert(false && new class { public function __construct(#[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1; }) { diff --git a/Zend/tests/property_hooks/gh20270.phpt b/Zend/tests/property_hooks/gh20270.phpt index 173d21990e55..a11bb0a1afcc 100644 --- a/Zend/tests/property_hooks/gh20270.phpt +++ b/Zend/tests/property_hooks/gh20270.phpt @@ -32,20 +32,20 @@ $b = new B(); try { $b->prop1 = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($b->prop1); try { $b->prop2 = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($b->prop2); ?> --EXPECT-- -Unknown named parameter $unknown +Error: Unknown named parameter $unknown int(42) -Unknown named parameter $value +Error: Unknown named parameter $value int(42) diff --git a/Zend/tests/property_hooks/indirect_modification.phpt b/Zend/tests/property_hooks/indirect_modification.phpt index 2fb8bda77a24..e547579cec76 100644 --- a/Zend/tests/property_hooks/indirect_modification.phpt +++ b/Zend/tests/property_hooks/indirect_modification.phpt @@ -24,13 +24,13 @@ $test->byVal = []; try { $test->byVal[] = 1; } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->byVal); try { $ref =& $test->byVal; } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ref = 42; var_dump($test->byVal); @@ -43,9 +43,9 @@ Test::$byVal::set Test::$byVal::set int(3) Test::$byVal::set -Indirect modification of Test::$byVal is not allowed +Error: Indirect modification of Test::$byVal is not allowed array(0) { } -Indirect modification of Test::$byVal is not allowed +Error: Indirect modification of Test::$byVal is not allowed array(0) { } diff --git a/Zend/tests/property_hooks/magic_interaction.phpt b/Zend/tests/property_hooks/magic_interaction.phpt index 7ea9e60f8969..807899ef171d 100644 --- a/Zend/tests/property_hooks/magic_interaction.phpt +++ b/Zend/tests/property_hooks/magic_interaction.phpt @@ -19,7 +19,7 @@ class B extends A { try { $this->$name; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } public function __set($name, $value) { @@ -27,7 +27,7 @@ class B extends A { try { $this->$name = $value; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } public function __isset($name) { @@ -35,7 +35,7 @@ class B extends A { try { var_dump(isset($this->$name)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } public function __unset($name) { @@ -50,7 +50,7 @@ $b->prop = 1; try { unset($b->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -59,4 +59,4 @@ A::$prop::get A::$prop::get bool(true) A::$prop::set -Cannot unset hooked property B::$prop +Error: Cannot unset hooked property B::$prop diff --git a/Zend/tests/property_hooks/override_add_get.phpt b/Zend/tests/property_hooks/override_add_get.phpt index df2739e6086c..a4222ddaa350 100644 --- a/Zend/tests/property_hooks/override_add_get.phpt +++ b/Zend/tests/property_hooks/override_add_get.phpt @@ -21,7 +21,7 @@ $a->prop = 1; try { var_dump($a->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $b = new B; @@ -31,7 +31,7 @@ var_dump($b->prop); ?> --EXPECT-- A::A::$prop::set -Cannot read from set-only virtual property A::$prop +Error: Cannot read from set-only virtual property A::$prop B::B::$prop::set B::B::$prop::get int(42) diff --git a/Zend/tests/property_hooks/override_add_set.phpt b/Zend/tests/property_hooks/override_add_set.phpt index e13de15f0b82..2a907a563bd8 100644 --- a/Zend/tests/property_hooks/override_add_set.phpt +++ b/Zend/tests/property_hooks/override_add_set.phpt @@ -20,7 +20,7 @@ $a = new A; try { $a->prop = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a->prop); @@ -30,7 +30,7 @@ var_dump($b->prop); ?> --EXPECT-- -Cannot write to get-only virtual property A::$prop +Error: Cannot write to get-only virtual property A::$prop A::A::$prop::get int(42) B::B::$prop::set diff --git a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt index 767e585f9199..6ac34a1c0a3b 100644 --- a/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt +++ b/Zend/tests/property_hooks/parent_get_in_class_with_no_parent.phpt @@ -13,9 +13,9 @@ $foo = new Foo(); try { var_dump($foo->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use "parent" when current class scope has no parent +Error: Cannot use "parent" when current class scope has no parent diff --git a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt index 0edd8ff074ef..6638b2911d29 100644 --- a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt +++ b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt @@ -17,9 +17,9 @@ $c = new C(); try { var_dump($c->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property C::$prop must not be accessed before initialization +Error: Typed property C::$prop must not be accessed before initialization diff --git a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt index 04ac779f607b..2ce345f6d1b7 100644 --- a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt +++ b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt @@ -19,9 +19,9 @@ $b = new B(); try { var_dump($b->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -A::$prop::get() expects exactly 0 arguments, 1 given +ArgumentCountError: A::$prop::get() expects exactly 0 arguments, 1 given diff --git a/Zend/tests/property_hooks/parent_get_undefined_property.phpt b/Zend/tests/property_hooks/parent_get_undefined_property.phpt index 388448963e3e..165e64470e61 100644 --- a/Zend/tests/property_hooks/parent_get_undefined_property.phpt +++ b/Zend/tests/property_hooks/parent_get_undefined_property.phpt @@ -17,9 +17,9 @@ $c = new C(); try { var_dump($c->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined property P::$prop +Error: Undefined property P::$prop diff --git a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt index aa95552af563..544a5cbc4a55 100644 --- a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt +++ b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt @@ -19,9 +19,9 @@ $b = new B(); try { $b->prop = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -A::$prop::set() expects exactly 1 argument, 2 given +ArgumentCountError: A::$prop::set() expects exactly 1 argument, 2 given diff --git a/Zend/tests/property_hooks/parent_superfluous_args.phpt b/Zend/tests/property_hooks/parent_superfluous_args.phpt index 2abcd7e7d10d..8d46b7a3442e 100644 --- a/Zend/tests/property_hooks/parent_superfluous_args.phpt +++ b/Zend/tests/property_hooks/parent_superfluous_args.phpt @@ -35,17 +35,17 @@ var_dump($b->virtual); try { var_dump($b->backed = 42); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($b->backed); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(42) NULL -A::$backed::set() expects exactly 1 argument, 2 given -A::$backed::get() expects exactly 0 arguments, 1 given +ArgumentCountError: A::$backed::set() expects exactly 1 argument, 2 given +ArgumentCountError: A::$backed::get() expects exactly 0 arguments, 1 given diff --git a/Zend/tests/property_hooks/parent_wrong_property_info.phpt b/Zend/tests/property_hooks/parent_wrong_property_info.phpt index c18aad7f11f9..6d7d30bcc73c 100644 --- a/Zend/tests/property_hooks/parent_wrong_property_info.phpt +++ b/Zend/tests/property_hooks/parent_wrong_property_info.phpt @@ -17,9 +17,9 @@ $b = new B; try { var_dump($b->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access private property A::$prop +Error: Cannot access private property A::$prop diff --git a/Zend/tests/property_hooks/read_sibling_backing_value.phpt b/Zend/tests/property_hooks/read_sibling_backing_value.phpt index 65fe28fed32c..745fa768bb88 100644 --- a/Zend/tests/property_hooks/read_sibling_backing_value.phpt +++ b/Zend/tests/property_hooks/read_sibling_backing_value.phpt @@ -26,9 +26,9 @@ $test = new Test; try { var_dump($test->a); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/property_hooks/set.phpt b/Zend/tests/property_hooks/set.phpt index 2928aee6cede..4c3a64d42464 100644 --- a/Zend/tests/property_hooks/set.phpt +++ b/Zend/tests/property_hooks/set.phpt @@ -17,16 +17,16 @@ var_dump($test->_prop); try { var_dump($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($test->prop)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(42) -Cannot read from set-only virtual property Test::$prop -Cannot read from set-only virtual property Test::$prop +Error: Cannot read from set-only virtual property Test::$prop +Error: Cannot read from set-only virtual property Test::$prop diff --git a/Zend/tests/property_hooks/unset.phpt b/Zend/tests/property_hooks/unset.phpt index 49edd56831a0..794859c85ac9 100644 --- a/Zend/tests/property_hooks/unset.phpt +++ b/Zend/tests/property_hooks/unset.phpt @@ -19,11 +19,11 @@ $test->prop = 42; try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop); ?> --EXPECT-- -Cannot unset hooked property Test::$prop +Error: Cannot unset hooked property Test::$prop int(42) diff --git a/Zend/tests/property_hooks/virtual_read_write.phpt b/Zend/tests/property_hooks/virtual_read_write.phpt index e5451ee1ceb5..a19255dfd527 100644 --- a/Zend/tests/property_hooks/virtual_read_write.phpt +++ b/Zend/tests/property_hooks/virtual_read_write.phpt @@ -34,16 +34,16 @@ $test = new Test; try { $test->prop = 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/readonly_classes/gh10377.phpt b/Zend/tests/readonly_classes/gh10377.phpt index c9e902ae739d..0b907c98dacd 100644 --- a/Zend/tests/readonly_classes/gh10377.phpt +++ b/Zend/tests/readonly_classes/gh10377.phpt @@ -21,7 +21,7 @@ var_dump($readonly_anon->field); try { $readonly_anon->field = 123; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($readonly_anon->field); @@ -29,14 +29,14 @@ var_dump($anon->field); try { $anon->field = 123; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($anon->field); ?> --EXPECT-- int(2) -Cannot modify readonly property class@anonymous::$field +Error: Cannot modify readonly property class@anonymous::$field int(2) int(2) int(123) diff --git a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt index b4da25ab0fec..b422ca9c8812 100644 --- a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt +++ b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt @@ -12,9 +12,9 @@ $foo = new Foo(); try { $foo->bar = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property Foo::$bar +Error: Cannot create dynamic property Foo::$bar diff --git a/Zend/tests/readonly_classes/readonly_class_property1.phpt b/Zend/tests/readonly_classes/readonly_class_property1.phpt index 34e09eecd7fc..70245b7cb386 100644 --- a/Zend/tests/readonly_classes/readonly_class_property1.phpt +++ b/Zend/tests/readonly_classes/readonly_class_property1.phpt @@ -17,9 +17,9 @@ $foo = new Foo(); try { $foo->bar = 2; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_classes/readonly_class_property2.phpt b/Zend/tests/readonly_classes/readonly_class_property2.phpt index 6db08f4dfb38..c5e8e218fa3c 100644 --- a/Zend/tests/readonly_classes/readonly_class_property2.phpt +++ b/Zend/tests/readonly_classes/readonly_class_property2.phpt @@ -15,9 +15,9 @@ $foo = new Foo(1); try { $foo->bar = 2; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt index e0672e4d97f8..94eb3e7ef318 100644 --- a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt +++ b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt @@ -8,9 +8,9 @@ readonly class C {} try { $readonly = unserialize('O:1:"C":1:{s:1:"x";b:1;}'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create dynamic property C::$x +Error: Cannot create dynamic property C::$x diff --git a/Zend/tests/readonly_props/array_append_initialization.phpt b/Zend/tests/readonly_props/array_append_initialization.phpt index d9b3e8c07443..5d9ccdcaeb00 100644 --- a/Zend/tests/readonly_props/array_append_initialization.phpt +++ b/Zend/tests/readonly_props/array_append_initialization.phpt @@ -22,16 +22,16 @@ function init() { try { (new C)->init(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { init(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot indirectly modify readonly property C::$a -Cannot indirectly modify readonly property C::$a +Error: Cannot indirectly modify readonly property C::$a +Error: Cannot indirectly modify readonly property C::$a diff --git a/Zend/tests/readonly_props/by_ref_foreach.phpt b/Zend/tests/readonly_props/by_ref_foreach.phpt index dfc1d1709371..ab48594ba0e2 100644 --- a/Zend/tests/readonly_props/by_ref_foreach.phpt +++ b/Zend/tests/readonly_props/by_ref_foreach.phpt @@ -21,9 +21,9 @@ $test->init(); try { foreach ($test as &$prop) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot acquire reference to readonly property Test::$prop +Error: Cannot acquire reference to readonly property Test::$prop diff --git a/Zend/tests/readonly_props/cache_slot.phpt b/Zend/tests/readonly_props/cache_slot.phpt index af7f73c36eb9..17a4ab057075 100644 --- a/Zend/tests/readonly_props/cache_slot.phpt +++ b/Zend/tests/readonly_props/cache_slot.phpt @@ -30,7 +30,7 @@ var_dump($test->prop); try { $test->setProp("b"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop); echo "\n"; @@ -39,12 +39,12 @@ $test = new Test; try { $test->initAndAppendProp2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->initAndAppendProp2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop2); echo "\n"; @@ -66,12 +66,12 @@ $appendProp2 = (function() { try { $appendProp2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $appendProp2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop2); echo "\n"; @@ -90,11 +90,11 @@ var_dump($test->prop3); ?> --EXPECTF-- string(1) "a" -Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop string(1) "a" -Cannot indirectly modify readonly property Test::$prop2 -Cannot modify readonly property Test::$prop2 +Error: Cannot indirectly modify readonly property Test::$prop2 +Error: Cannot modify readonly property Test::$prop2 array(0) { } @@ -107,8 +107,8 @@ object(stdClass)#%d (1) { int(1) } -Cannot indirectly modify readonly property Test::$prop2 -Cannot indirectly modify readonly property Test::$prop2 +Error: Cannot indirectly modify readonly property Test::$prop2 +Error: Cannot indirectly modify readonly property Test::$prop2 array(0) { } diff --git a/Zend/tests/readonly_props/gh7942.phpt b/Zend/tests/readonly_props/gh7942.phpt index 89db53439a2f..1dba45252b0d 100644 --- a/Zend/tests/readonly_props/gh7942.phpt +++ b/Zend/tests/readonly_props/gh7942.phpt @@ -14,9 +14,9 @@ try { $i = 42; new Foo($i); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$bar +Error: Cannot indirectly modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_props/initialization_scope.phpt b/Zend/tests/readonly_props/initialization_scope.phpt index 49a4341e138f..126f08acf284 100644 --- a/Zend/tests/readonly_props/initialization_scope.phpt +++ b/Zend/tests/readonly_props/initialization_scope.phpt @@ -20,7 +20,7 @@ $test = new B; try { $test->prop = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $test->initProtected(); var_dump($test); @@ -59,7 +59,7 @@ var_dump($test); ?> --EXPECTF-- -Cannot modify protected(set) readonly property A::$prop from global scope +Error: Cannot modify protected(set) readonly property A::$prop from global scope object(B)#%d (1) { ["prop"]=> int(2) diff --git a/Zend/tests/readonly_props/magic_get_set.phpt b/Zend/tests/readonly_props/magic_get_set.phpt index ff9d7c7e3325..f56396da9cb7 100644 --- a/Zend/tests/readonly_props/magic_get_set.phpt +++ b/Zend/tests/readonly_props/magic_get_set.phpt @@ -36,17 +36,17 @@ var_dump(isset($test->prop)); try { var_dump($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $test->unsetProp(); @@ -57,15 +57,15 @@ $test->prop = 2; try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -Typed property Test::$prop must not be accessed before initialization -Cannot modify protected(set) readonly property Test::$prop from global scope -Cannot unset protected(set) readonly property Test::$prop from global scope +Error: Typed property Test::$prop must not be accessed before initialization +Error: Cannot modify protected(set) readonly property Test::$prop from global scope +Error: Cannot unset protected(set) readonly property Test::$prop from global scope Test::__isset(prop) bool(true) Test::__get(prop) diff --git a/Zend/tests/readonly_props/promotion.phpt b/Zend/tests/readonly_props/promotion.phpt index ee83246083b3..2e4c23bbed70 100644 --- a/Zend/tests/readonly_props/promotion.phpt +++ b/Zend/tests/readonly_props/promotion.phpt @@ -16,7 +16,7 @@ $point = new Point(1.0, 2.0, 3.0); try { $point->x = 4.0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($point); @@ -30,7 +30,7 @@ object(Point)#1 (3) { ["z"]=> float(0) } -Cannot modify readonly property Point::$x +Error: Cannot modify readonly property Point::$x object(Point)#1 (3) { ["x"]=> float(1) diff --git a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt index 29218d837d7f..90c890688611 100644 --- a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt +++ b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt @@ -25,9 +25,9 @@ $foo = new Foo(""); try { $foo->write(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_props/readonly_clone_error1.phpt b/Zend/tests/readonly_props/readonly_clone_error1.phpt index 98829d175765..f4fc3e74cfe9 100644 --- a/Zend/tests/readonly_props/readonly_clone_error1.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error1.phpt @@ -21,7 +21,7 @@ $foo = new Foo(1); try { clone $foo; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "done"; @@ -32,5 +32,5 @@ object(Foo)#2 (1) { ["bar"]=> int(2) } -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar done diff --git a/Zend/tests/readonly_props/readonly_clone_error2.phpt b/Zend/tests/readonly_props/readonly_clone_error2.phpt index e1e42abad074..aa7a77c7c38b 100644 --- a/Zend/tests/readonly_props/readonly_clone_error2.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error2.phpt @@ -27,16 +27,16 @@ $foo = new Foo(1, 1); try { $foo->wrongCloneOld(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $foo->wrongCloneNew(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$bar -Cannot modify readonly property Foo::$baz +Error: Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$baz diff --git a/Zend/tests/readonly_props/readonly_clone_error3.phpt b/Zend/tests/readonly_props/readonly_clone_error3.phpt index a51ec165c68c..31e99180e155 100644 --- a/Zend/tests/readonly_props/readonly_clone_error3.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error3.phpt @@ -29,16 +29,16 @@ $foo = new Foo(1, 1); try { $foo->wrongCloneOld(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $foo->wrongCloneNew(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property Foo::$bar -Cannot modify readonly property Foo::$baz +Error: Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$baz diff --git a/Zend/tests/readonly_props/readonly_clone_error4.phpt b/Zend/tests/readonly_props/readonly_clone_error4.phpt index f9edcbcbaa18..c47193f1e3b6 100644 --- a/Zend/tests/readonly_props/readonly_clone_error4.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error4.phpt @@ -21,13 +21,13 @@ $foo = new Foo(1); try { clone $foo; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { clone $foo; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -36,9 +36,9 @@ object(Foo)#2 (1) { ["bar"]=> int(3) } -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar object(Foo)#2 (1) { ["bar"]=> int(3) } -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_props/readonly_clone_error5.phpt b/Zend/tests/readonly_props/readonly_clone_error5.phpt index a6a10fb8a27c..eb934d738a2d 100644 --- a/Zend/tests/readonly_props/readonly_clone_error5.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error5.phpt @@ -35,30 +35,30 @@ class TestSetTwice { try { var_dump(clone (new TestSetOnce())); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(clone (new TestSetOnce())); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(clone (new TestSetTwice())); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(clone (new TestSetTwice())); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot indirectly modify readonly property TestSetOnce::$prop -Cannot indirectly modify readonly property TestSetOnce::$prop -Cannot indirectly modify readonly property TestSetTwice::$prop -Cannot indirectly modify readonly property TestSetTwice::$prop +Error: Cannot indirectly modify readonly property TestSetOnce::$prop +Error: Cannot indirectly modify readonly property TestSetOnce::$prop +Error: Cannot indirectly modify readonly property TestSetTwice::$prop +Error: Cannot indirectly modify readonly property TestSetTwice::$prop diff --git a/Zend/tests/readonly_props/readonly_clone_error6.phpt b/Zend/tests/readonly_props/readonly_clone_error6.phpt index 16a04d802a11..ba63fecbb041 100644 --- a/Zend/tests/readonly_props/readonly_clone_error6.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error6.phpt @@ -22,13 +22,13 @@ var_dump($foo); try { $foo->__clone(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo->__clone(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); @@ -39,8 +39,8 @@ object(Foo)#%d (%d) { ["bar"]=> int(0) } -Cannot modify readonly property Foo::$bar -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar object(Foo)#%d (%d) { ["bar"]=> int(0) diff --git a/Zend/tests/readonly_props/readonly_clone_error7.phpt b/Zend/tests/readonly_props/readonly_clone_error7.phpt index e34ad9eb3d71..c653966dfc0a 100644 --- a/Zend/tests/readonly_props/readonly_clone_error7.phpt +++ b/Zend/tests/readonly_props/readonly_clone_error7.phpt @@ -19,15 +19,15 @@ $foo = new Foo([]); try { var_dump(clone $foo); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(clone $foo); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot indirectly modify readonly property Foo::$bar -Cannot indirectly modify readonly property Foo::$bar +Error: Cannot indirectly modify readonly property Foo::$bar +Error: Cannot indirectly modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_props/readonly_clone_success4.phpt b/Zend/tests/readonly_props/readonly_clone_success4.phpt index 40b7a29e3126..fea00e537046 100644 --- a/Zend/tests/readonly_props/readonly_clone_success4.phpt +++ b/Zend/tests/readonly_props/readonly_clone_success4.phpt @@ -13,7 +13,7 @@ class Foo { try { $this->bar = "foo"; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $this->bar = 2; @@ -27,12 +27,12 @@ var_dump(clone $foo); ?> --EXPECTF-- -Cannot assign string to property Foo::$bar of type int +TypeError: Cannot assign string to property Foo::$bar of type int object(Foo)#%d (%d) { ["bar"]=> int(2) } -Cannot assign string to property Foo::$bar of type int +TypeError: Cannot assign string to property Foo::$bar of type int object(Foo)#%d (%d) { ["bar"]=> int(2) diff --git a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt index d41211d8e998..ffe8411a2240 100644 --- a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt +++ b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt @@ -11,7 +11,7 @@ class Foo { try { $this->bar = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -20,4 +20,4 @@ new Foo(); ?> --EXPECTF-- -Cannot modify readonly property Foo::$bar +Error: Cannot modify readonly property Foo::$bar diff --git a/Zend/tests/readonly_props/readonly_containing_object.phpt b/Zend/tests/readonly_props/readonly_containing_object.phpt index 996b0ee3d44b..30b43619ecea 100644 --- a/Zend/tests/readonly_props/readonly_containing_object.phpt +++ b/Zend/tests/readonly_props/readonly_containing_object.phpt @@ -18,17 +18,17 @@ $test->prop->foo++; try { $test->prop += 1; } 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"; } try { --$test->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop); @@ -44,9 +44,9 @@ var_dump($test->prop); ?> --EXPECT-- -Unsupported operand types: stdClass + int -Cannot modify readonly property Test::$prop -Cannot modify readonly property Test::$prop +TypeError: Unsupported operand types: stdClass + int +Error: Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop object(stdClass)#2 (1) { ["foo"]=> int(3) diff --git a/Zend/tests/readonly_props/readonly_modification.phpt b/Zend/tests/readonly_props/readonly_modification.phpt index bd04a203be19..6d23fd1eecc8 100644 --- a/Zend/tests/readonly_props/readonly_modification.phpt +++ b/Zend/tests/readonly_props/readonly_modification.phpt @@ -21,62 +21,62 @@ var_dump($test->prop); // Read. try { $test->prop = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop += 1; } 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"; } try { ++$test->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ref =& $test->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop =& $ref; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { byRef($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->prop2); // Read. try { $test->prop2[] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $test->prop2[0][] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(1) -Cannot modify readonly property Test::$prop -Cannot modify readonly property Test::$prop -Cannot modify readonly property Test::$prop -Cannot modify readonly property Test::$prop -Cannot indirectly modify readonly property Test::$prop -Cannot indirectly modify readonly property Test::$prop -Cannot indirectly modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop +Error: Cannot indirectly modify readonly property Test::$prop +Error: Cannot indirectly modify readonly property Test::$prop +Error: Cannot indirectly modify readonly property Test::$prop array(0) { } -Cannot indirectly modify readonly property Test::$prop2 -Cannot indirectly modify readonly property Test::$prop2 +Error: Cannot indirectly modify readonly property Test::$prop2 +Error: Cannot indirectly modify readonly property Test::$prop2 diff --git a/Zend/tests/readonly_props/readonly_with_default.phpt b/Zend/tests/readonly_props/readonly_with_default.phpt index 12afe5cde153..a68b2b73596a 100644 --- a/Zend/tests/readonly_props/readonly_with_default.phpt +++ b/Zend/tests/readonly_props/readonly_with_default.phpt @@ -11,7 +11,7 @@ $test = new Test; try { $test->prop = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/readonly_props/unset.phpt b/Zend/tests/readonly_props/unset.phpt index b8bd4218fa0c..271cca24ad4d 100644 --- a/Zend/tests/readonly_props/unset.phpt +++ b/Zend/tests/readonly_props/unset.phpt @@ -15,7 +15,7 @@ $test = new Test(1); try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Test2 { @@ -40,7 +40,7 @@ var_dump($test->prop); // Don't call __get. try { unset($test->prop); // Unset initialized, illegal. } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Test3 { @@ -51,14 +51,14 @@ $test = new Test3; try { unset($test->prop); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset readonly property Test::$prop +Error: Cannot unset readonly property Test::$prop Test2::__get int(1) int(1) -Cannot unset readonly property Test2::$prop -Cannot unset protected(set) readonly property Test3::$prop from global scope +Error: Cannot unset readonly property Test2::$prop +Error: Cannot unset protected(set) readonly property Test3::$prop from global scope diff --git a/Zend/tests/readonly_props/visibility_change.phpt b/Zend/tests/readonly_props/visibility_change.phpt index f4a32f3cdaaf..aeeaa5de2b73 100644 --- a/Zend/tests/readonly_props/visibility_change.phpt +++ b/Zend/tests/readonly_props/visibility_change.phpt @@ -18,7 +18,7 @@ $a = new A(); try { var_dump($a->prop); } catch (Error $error) { - echo $error->getMessage() . "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } $b = new B(); @@ -26,5 +26,5 @@ var_dump($b->prop); ?> --EXPECT-- -Cannot access protected property A::$prop +Error: Cannot access protected property A::$prop int(42) diff --git a/Zend/tests/recursive_array_comparison.phpt b/Zend/tests/recursive_array_comparison.phpt index 53cc9736030d..0a89f820f4f3 100644 --- a/Zend/tests/recursive_array_comparison.phpt +++ b/Zend/tests/recursive_array_comparison.phpt @@ -6,16 +6,16 @@ $a = [&$a]; try { $a === [[]]; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { [[]] === $a; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a === $a); ?> --EXPECT-- -Nesting level too deep - recursive dependency? -Nesting level too deep - recursive dependency? +Error: Nesting level too deep - recursive dependency? +Error: Nesting level too deep - recursive dependency? bool(true) diff --git a/Zend/tests/recv_init_ref_type.phpt b/Zend/tests/recv_init_ref_type.phpt index 29b96d379f8d..343281249ba4 100644 --- a/Zend/tests/recv_init_ref_type.phpt +++ b/Zend/tests/recv_init_ref_type.phpt @@ -10,9 +10,9 @@ try { $bar = 42; test($bar); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d +TypeError: test(): Argument #1 ($foo) must be of type array, int given, called in %s on line %d diff --git a/Zend/tests/require_once_warning_to_exception.phpt b/Zend/tests/require_once_warning_to_exception.phpt index bc706622438f..bf51df8e8e45 100644 --- a/Zend/tests/require_once_warning_to_exception.phpt +++ b/Zend/tests/require_once_warning_to_exception.phpt @@ -11,9 +11,9 @@ set_error_handler("exception_error_handler"); try { $results = require_once 'does-not-exist.php'; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; }; ?> --EXPECT-- -require_once(): Failed to open stream: No such file or directory +Exception: require_once(): Failed to open stream: No such file or directory diff --git a/Zend/tests/require_parse_exception.phpt b/Zend/tests/require_parse_exception.phpt index d64efe178671..2c6556e38b79 100644 --- a/Zend/tests/require_parse_exception.phpt +++ b/Zend/tests/require_parse_exception.phpt @@ -9,7 +9,7 @@ function test_parse_error($code) { try { require 'data://text/plain;base64,' . base64_encode($code); } catch (ParseError $e) { - echo $e->getMessage(), " on line ", $e->getLine(), "\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } } @@ -43,9 +43,9 @@ var_dump("\u{ffffff}");'); ?> --EXPECT-- Deprecated: Directive 'allow_url_include' is deprecated in Unknown on line 0 -Unclosed '{' on line 2 -Unclosed '{' on line 3 -syntax error, unexpected end of file, expecting "(" on line 2 -Invalid numeric literal on line 2 -Invalid UTF-8 codepoint escape sequence on line 2 -Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2 +ParseError: Unclosed '{' on line 2 +ParseError: Unclosed '{' on line 3 +ParseError: syntax error, unexpected end of file, expecting "(" on line 2 +ParseError: Invalid numeric literal on line 2 +ParseError: Invalid UTF-8 codepoint escape sequence on line 2 +ParseError: Invalid UTF-8 codepoint escape sequence: Codepoint too large on line 2 diff --git a/Zend/tests/required_param_after_optional_named_args.phpt b/Zend/tests/required_param_after_optional_named_args.phpt index 19060ab108b0..f73014cc3661 100644 --- a/Zend/tests/required_param_after_optional_named_args.phpt +++ b/Zend/tests/required_param_after_optional_named_args.phpt @@ -8,10 +8,10 @@ function test($a = 1, $b) { try { test(b: 2); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: test(): Optional parameter $a declared before required parameter $b is implicitly treated as a required parameter in %s on line %d -test(): Argument #1 ($a) not passed +ArgumentCountError: test(): Argument #1 ($a) not passed diff --git a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt index afb099b6812d..c1adf8749e38 100644 --- a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt +++ b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt @@ -7,17 +7,17 @@ function by_ref(&$ref) {} try { by_ref($GLOBALS); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { by_ref2($GLOBALS); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function by_ref2(&$ref) {} ?> --EXPECT-- -by_ref(): Argument #1 ($ref) could not be passed by reference -by_ref2(): Argument #1 ($ref) could not be passed by reference +Error: by_ref(): Argument #1 ($ref) could not be passed by reference +Error: by_ref2(): Argument #1 ($ref) could not be passed by reference diff --git a/Zend/tests/return_types/028.phpt b/Zend/tests/return_types/028.phpt index 802dd7708dfe..89a5cd502514 100644 --- a/Zend/tests/return_types/028.phpt +++ b/Zend/tests/return_types/028.phpt @@ -12,9 +12,9 @@ function foo(): stdClass { try { foo(); } catch (Error $e) { - echo $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine(); + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), PHP_EOL; } ?> --EXPECTF-- -foo(): Return value must be of type stdClass, array returned in %s on line %d +TypeError: foo(): Return value must be of type stdClass, array returned in %s on line %d diff --git a/Zend/tests/return_types/bug70557.phpt b/Zend/tests/return_types/bug70557.phpt index 1795a2a26a79..5ce47d723b22 100644 --- a/Zend/tests/return_types/bug70557.phpt +++ b/Zend/tests/return_types/bug70557.phpt @@ -10,8 +10,8 @@ function getNumber() : int { try { getNumber(); } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(62) "getNumber(): Return value must be of type int, string returned" +TypeError: getNumber(): Return value must be of type int, string returned diff --git a/Zend/tests/return_types/never_disallowed5.phpt b/Zend/tests/return_types/never_disallowed5.phpt index 26887cd46833..a8df4ae61960 100644 --- a/Zend/tests/return_types/never_disallowed5.phpt +++ b/Zend/tests/return_types/never_disallowed5.phpt @@ -14,8 +14,8 @@ class Foo { try { Foo::bar(); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Foo::bar(): never-returning method must not implicitly return +TypeError: Foo::bar(): never-returning method must not implicitly return diff --git a/Zend/tests/self_and.phpt b/Zend/tests/self_and.phpt index f3662c575c48..2aa9f5b816e7 100644 --- a/Zend/tests/self_and.phpt +++ b/Zend/tests/self_and.phpt @@ -16,7 +16,7 @@ try { $s1 &= 11; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 &= 33; @@ -32,7 +32,7 @@ echo "Done\n"; ?> --EXPECTF-- int(18) -Unsupported operand types: string & int +TypeError: Unsupported operand types: string & int Warning: A non-numeric value encountered in %s on line %d int(33) diff --git a/Zend/tests/self_instanceof_outside_class.phpt b/Zend/tests/self_instanceof_outside_class.phpt index ecb593a6a580..564267883207 100644 --- a/Zend/tests/self_instanceof_outside_class.phpt +++ b/Zend/tests/self_instanceof_outside_class.phpt @@ -7,11 +7,11 @@ $fn = function() { try { new stdClass instanceof self; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; $fn(); ?> --EXPECT-- -Cannot access "self" when no class scope is active +Error: Cannot access "self" when no class scope is active diff --git a/Zend/tests/self_method_or_prop_outside_class.phpt b/Zend/tests/self_method_or_prop_outside_class.phpt index feaeccf25f95..d77398f35341 100644 --- a/Zend/tests/self_method_or_prop_outside_class.phpt +++ b/Zend/tests/self_method_or_prop_outside_class.phpt @@ -8,29 +8,29 @@ $fn = function() { try { self::${$str . "bar"}; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset(self::${$str . "bar"}); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { isset(self::${$str . "bar"}); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { self::{$str . "bar"}(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; $fn(); ?> --EXPECT-- -Cannot access "self" when no class scope is active -Cannot access "self" when no class scope is active -Cannot access "self" when no class scope is active -Cannot access "self" when no class scope is active +Error: Cannot access "self" when no class scope is active +Error: Cannot access "self" when no class scope is active +Error: Cannot access "self" when no class scope is active +Error: Cannot access "self" when no class scope is active diff --git a/Zend/tests/self_mod.phpt b/Zend/tests/self_mod.phpt index 7d469f800239..e5c924d67c35 100644 --- a/Zend/tests/self_mod.phpt +++ b/Zend/tests/self_mod.phpt @@ -14,7 +14,7 @@ try { $s1 %= 11; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 %= 33; @@ -24,7 +24,7 @@ echo "Done\n"; ?> --EXPECTF-- int(13) -Unsupported operand types: string % int +TypeError: Unsupported operand types: string % int Warning: A non-numeric value encountered in %s on line %d int(3) diff --git a/Zend/tests/self_or.phpt b/Zend/tests/self_or.phpt index 61f1f4203b08..7559065c8862 100644 --- a/Zend/tests/self_or.phpt +++ b/Zend/tests/self_or.phpt @@ -16,7 +16,7 @@ try { $s1 |= 11; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 |= 33; @@ -32,7 +32,7 @@ echo "Done\n"; ?> --EXPECTF-- int(127) -Unsupported operand types: string | int +TypeError: Unsupported operand types: string | int Warning: A non-numeric value encountered in %s on line %d int(45345) diff --git a/Zend/tests/self_xor.phpt b/Zend/tests/self_xor.phpt index 4bff3f6d508e..7bf62b963734 100644 --- a/Zend/tests/self_xor.phpt +++ b/Zend/tests/self_xor.phpt @@ -16,7 +16,7 @@ try { $s1 ^= 11; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 ^= 33; @@ -32,7 +32,7 @@ echo "Done\n"; ?> --EXPECTF-- int(109) -Unsupported operand types: string ^ int +TypeError: Unsupported operand types: string ^ int Warning: A non-numeric value encountered in %s on line %d int(45312) diff --git a/Zend/tests/serialize/bug64354.phpt b/Zend/tests/serialize/bug64354.phpt index 11b0aa31e247..a7c40a1631e6 100644 --- a/Zend/tests/serialize/bug64354.phpt +++ b/Zend/tests/serialize/bug64354.phpt @@ -17,9 +17,9 @@ $data = array(new B); try { serialize($data); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: B implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d -string(9) "serialize" +Exception: serialize diff --git a/Zend/tests/serialize/bug71841.phpt b/Zend/tests/serialize/bug71841.phpt index f32b0e9b231f..c99e1ecc5091 100644 --- a/Zend/tests/serialize/bug71841.phpt +++ b/Zend/tests/serialize/bug71841.phpt @@ -6,40 +6,40 @@ $z = unserialize('O:1:"A":0:{}'); try { var_dump($z->e.=0); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(++$z->x); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($z->y++); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $y = array(PHP_INT_MAX => 0); try { var_dump($y[] .= 0); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(++$y[]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($y[]++); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition -The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition -The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied -Cannot add element to the array as the next element is already occupied +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "A" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/Zend/tests/shift_001.phpt b/Zend/tests/shift_001.phpt index f441cf2dcf8b..96a5e16986ee 100644 --- a/Zend/tests/shift_001.phpt +++ b/Zend/tests/shift_001.phpt @@ -14,7 +14,7 @@ try { $s1 <<= 1; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 <<= 3; @@ -24,7 +24,7 @@ echo "Done\n"; ?> --EXPECTF-- int(492) -Unsupported operand types: string << int +TypeError: Unsupported operand types: string << int Warning: A non-numeric value encountered in %s on line %d int(362760) diff --git a/Zend/tests/shift_002.phpt b/Zend/tests/shift_002.phpt index 0bdc9b3eeb3c..a6087155ff7a 100644 --- a/Zend/tests/shift_002.phpt +++ b/Zend/tests/shift_002.phpt @@ -14,7 +14,7 @@ try { $s1 >>= 1; var_dump($s1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s2 >>= 3; @@ -24,7 +24,7 @@ echo "Done\n"; ?> --EXPECTF-- int(30) -Unsupported operand types: string >> int +TypeError: Unsupported operand types: string >> int Warning: A non-numeric value encountered in %s on line %d int(5668) diff --git a/Zend/tests/stack_limit/stack_limit_001.phpt b/Zend/tests/stack_limit/stack_limit_001.phpt index 73cc3c08fe9d..56f84e751a64 100644 --- a/Zend/tests/stack_limit/stack_limit_001.phpt +++ b/Zend/tests/stack_limit/stack_limit_001.phpt @@ -36,19 +36,19 @@ function replace() { try { new Test1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone new Test2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -63,6 +63,6 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_002.phpt b/Zend/tests/stack_limit/stack_limit_002.phpt index 64a11e1b2638..05d4c2dc03ed 100644 --- a/Zend/tests/stack_limit/stack_limit_002.phpt +++ b/Zend/tests/stack_limit/stack_limit_002.phpt @@ -35,19 +35,19 @@ $fiber = new Fiber(function (): void { try { new Test1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone new Test2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }); @@ -65,6 +65,6 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_003.phpt b/Zend/tests/stack_limit/stack_limit_003.phpt index 9956c761cb18..97f9756970bf 100644 --- a/Zend/tests/stack_limit/stack_limit_003.phpt +++ b/Zend/tests/stack_limit/stack_limit_003.phpt @@ -34,19 +34,19 @@ function replace() { try { new Test1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone new Test2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -61,6 +61,6 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_006.phpt b/Zend/tests/stack_limit/stack_limit_006.phpt index d8d6251cf0c6..e97a1c2e0c5d 100644 --- a/Zend/tests/stack_limit/stack_limit_006.phpt +++ b/Zend/tests/stack_limit/stack_limit_006.phpt @@ -293,19 +293,19 @@ function replace() { try { new Test1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone new Test2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -320,6 +320,6 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_007.phpt b/Zend/tests/stack_limit/stack_limit_007.phpt index d34e244234c2..2c77eca61b2e 100644 --- a/Zend/tests/stack_limit/stack_limit_007.phpt +++ b/Zend/tests/stack_limit/stack_limit_007.phpt @@ -19,7 +19,7 @@ function replace() { $tryExecuted = true; return replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; // We should not enter the catch block if we haven't executed at // least one op in the try block printf("Try executed: %d\n", $tryExecuted ?? 0); @@ -41,5 +41,5 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? Try executed: 1 diff --git a/Zend/tests/stack_limit/stack_limit_008.phpt b/Zend/tests/stack_limit/stack_limit_008.phpt index db61fb15e52c..b160b2010e81 100644 --- a/Zend/tests/stack_limit/stack_limit_008.phpt +++ b/Zend/tests/stack_limit/stack_limit_008.phpt @@ -22,7 +22,7 @@ function replace() { try { return replace2(); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } }, 'x'); @@ -55,4 +55,4 @@ array(4) { string(%d) "0x%x" } Will throw: -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_011.phpt b/Zend/tests/stack_limit/stack_limit_011.phpt index 762f67184f6a..7d26a3269336 100644 --- a/Zend/tests/stack_limit/stack_limit_011.phpt +++ b/Zend/tests/stack_limit/stack_limit_011.phpt @@ -35,7 +35,7 @@ function replace() { try { replace(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo 'Previous: ', $e->getPrevious()->getMessage(), "\n"; } @@ -51,5 +51,5 @@ array(4) { ["EG(stack_limit)"]=> string(%d) "0x%x" } -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? Previous: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/Zend/tests/stack_limit/stack_limit_014.phpt b/Zend/tests/stack_limit/stack_limit_014.phpt index 144c64ad39ea..84e80d62a2fd 100644 --- a/Zend/tests/stack_limit/stack_limit_014.phpt +++ b/Zend/tests/stack_limit/stack_limit_014.phpt @@ -16,7 +16,7 @@ memory_limit=1G try { require __DIR__.'/stack_limit_014.inc'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/Zend/tests/static_method_non_existing_class.phpt b/Zend/tests/static_method_non_existing_class.phpt index 752655d22782..424549394039 100644 --- a/Zend/tests/static_method_non_existing_class.phpt +++ b/Zend/tests/static_method_non_existing_class.phpt @@ -7,9 +7,9 @@ $str = "foo"; try { Test::{$str . "bar"}(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class "Test" not found +Error: Class "Test" not found diff --git a/Zend/tests/static_variables/static_variables_destructor.phpt b/Zend/tests/static_variables/static_variables_destructor.phpt index 9128c86e6b1b..3d848f0bd5fb 100644 --- a/Zend/tests/static_variables/static_variables_destructor.phpt +++ b/Zend/tests/static_variables/static_variables_destructor.phpt @@ -25,12 +25,12 @@ function foo(bool $throw) { try { foo(true); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foo(false); ?> --EXPECT-- bar() called -__destruct() called +Exception: __destruct() called int(42) diff --git a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt index 9e4752c24f5c..192df8c9a3e6 100644 --- a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt +++ b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt @@ -11,11 +11,11 @@ function foo($throw) { try { var_dump(foo(true)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(foo(false)); ?> --EXPECT-- -Throwing from foo() +Exception: Throwing from foo() int(42) diff --git a/Zend/tests/str_or_obj_of_class_zpp.phpt b/Zend/tests/str_or_obj_of_class_zpp.phpt index dec9bee69d5c..bac57acdc3da 100644 --- a/Zend/tests/str_or_obj_of_class_zpp.phpt +++ b/Zend/tests/str_or_obj_of_class_zpp.phpt @@ -21,13 +21,13 @@ var_dump(zend_string_or_stdclass(new ToString())); try { zend_string_or_stdclass([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { zend_string_or_stdclass(new Foo()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(zend_string_or_stdclass_or_null("string")); @@ -39,13 +39,13 @@ var_dump(zend_string_or_stdclass_or_null(new ToString())); try { zend_string_or_stdclass_or_null([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { zend_string_or_stdclass_or_null(new Foo()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -58,13 +58,13 @@ string(0) "" object(stdClass)#1 (0) { } string(8) "ToString" -zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, array given -zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, Foo given +TypeError: zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, array given +TypeError: zend_string_or_stdclass(): Argument #1 ($param) must be of type stdClass|string, Foo given string(6) "string" string(1) "1" NULL object(stdClass)#1 (0) { } string(8) "ToString" -zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, array given -zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, Foo given +TypeError: zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, array given +TypeError: zend_string_or_stdclass_or_null(): Argument #1 ($param) must be of type stdClass|string|null, Foo given diff --git a/Zend/tests/str_or_obj_zpp.phpt b/Zend/tests/str_or_obj_zpp.phpt index 3c71bde5fd3a..18a69a53a7a9 100644 --- a/Zend/tests/str_or_obj_zpp.phpt +++ b/Zend/tests/str_or_obj_zpp.phpt @@ -16,7 +16,7 @@ var_dump(zend_string_or_object(new Foo())); try { zend_string_or_object([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(zend_string_or_object_or_null("string")); @@ -28,7 +28,7 @@ var_dump(zend_string_or_object_or_null(new Foo())); try { zend_string_or_object_or_null([]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -42,7 +42,7 @@ object(stdClass)#1 (0) { } object(Foo)#1 (0) { } -zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given +TypeError: zend_string_or_object(): Argument #1 ($param) must be of type object|string, array given string(6) "string" string(1) "1" NULL @@ -50,4 +50,4 @@ object(stdClass)#2 (0) { } object(Foo)#2 (0) { } -zend_string_or_object_or_null(): Argument #1 ($param) must be of type object|string|null, array given +TypeError: zend_string_or_object_or_null(): Argument #1 ($param) must be of type object|string|null, array given diff --git a/Zend/tests/string_offset_as_object.phpt b/Zend/tests/string_offset_as_object.phpt index 6fdebe936088..8631bd82fd5b 100644 --- a/Zend/tests/string_offset_as_object.phpt +++ b/Zend/tests/string_offset_as_object.phpt @@ -7,57 +7,57 @@ $str = "x"; try { $str[0]->bar = "xyz"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str[0]->bar[1] = "bang"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str[0]->bar += 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str[0]->bar = &$b; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ++$str[0]->bar; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { --$str[0]->bar; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str[0]->bar++; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str[0]->bar--; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($str[0]->bar); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object -Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object +Error: Cannot use string offset as an object diff --git a/Zend/tests/string_offset_errors.phpt b/Zend/tests/string_offset_errors.phpt index 726dc41f0653..cd1cc1fb4825 100644 --- a/Zend/tests/string_offset_errors.phpt +++ b/Zend/tests/string_offset_errors.phpt @@ -16,24 +16,24 @@ function &gen() { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $str = "foo"; $str[0] =& $str[1]; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { foreach (gen() as $v) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create references to/from string offsets -Cannot create references to/from string offsets -Cannot create references to/from string offsets +Error: Cannot create references to/from string offsets +Error: Cannot create references to/from string offsets +Error: Cannot create references to/from string offsets diff --git a/Zend/tests/strlen_deprecation_to_exception.phpt b/Zend/tests/strlen_deprecation_to_exception.phpt index 7b616f3b6432..7a6dcf3699d3 100644 --- a/Zend/tests/strlen_deprecation_to_exception.phpt +++ b/Zend/tests/strlen_deprecation_to_exception.phpt @@ -9,9 +9,9 @@ set_error_handler(function($_, $msg) { try { strlen(null); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -strlen(): Passing null to parameter #1 ($string) of type string is deprecated +Exception: strlen(): Passing null to parameter #1 ($string) of type string is deprecated diff --git a/Zend/tests/strncasecmp_basic.phpt b/Zend/tests/strncasecmp_basic.phpt index 54eb6fb5209b..9b41495752e6 100644 --- a/Zend/tests/strncasecmp_basic.phpt +++ b/Zend/tests/strncasecmp_basic.phpt @@ -6,7 +6,7 @@ strncasecmp() tests try { var_dump(strncasecmp("", "", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(strncasecmp("aef", "dfsgbdf", 0)); @@ -19,7 +19,7 @@ var_dump(strncasecmp("01", "01", 1000)); ?> --EXPECT-- -strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 int(0) int(-3) int(0) diff --git a/Zend/tests/strncmp_basic.phpt b/Zend/tests/strncmp_basic.phpt index bb40946f240a..a9d0ea6d257a 100644 --- a/Zend/tests/strncmp_basic.phpt +++ b/Zend/tests/strncmp_basic.phpt @@ -7,7 +7,7 @@ var_dump(strncmp("", "", 100)); try { var_dump(strncmp("aef", "dfsgbdf", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(strncmp("fghjkl", "qwer", 0)); var_dump(strncmp("qwerty", "qwerty123", 6)); @@ -16,7 +16,7 @@ var_dump(strncmp("qwerty", "qwerty123", 7)); ?> --EXPECT-- int(0) -strncmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0 int(0) int(0) int(-1) diff --git a/Zend/tests/sub_001.phpt b/Zend/tests/sub_001.phpt index 92e3ff0021f0..66e268d65b62 100644 --- a/Zend/tests/sub_001.phpt +++ b/Zend/tests/sub_001.phpt @@ -9,7 +9,7 @@ $b = array(1); try { var_dump($a - $b); } catch (Error $e) { - echo "\nException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = $a - $b; @@ -18,7 +18,7 @@ var_dump($c); echo "Done\n"; ?> --EXPECTF-- -Exception: Unsupported operand types: array - array +TypeError: Unsupported operand types: array - array Fatal error: Uncaught TypeError: Unsupported operand types: array - array in %s:%d Stack trace: diff --git a/Zend/tests/switch/bug80046.phpt b/Zend/tests/switch/bug80046.phpt index 87a493c20308..45adb6e9726f 100644 --- a/Zend/tests/switch/bug80046.phpt +++ b/Zend/tests/switch/bug80046.phpt @@ -14,9 +14,9 @@ function test($foo) { try { test('Foo'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Default +Exception: Default diff --git a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt index 95d2fc1233d4..d93dd64077da 100644 --- a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt +++ b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt @@ -12,9 +12,9 @@ class Foo { try { Foo::test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Access to undeclared static property Foo::$property +Error: Access to undeclared static property Foo::$property diff --git a/Zend/tests/this-reserved/this_in_extract.phpt b/Zend/tests/this-reserved/this_in_extract.phpt index 2e3f7b497fdb..3157f35ac4e1 100644 --- a/Zend/tests/this-reserved/this_in_extract.phpt +++ b/Zend/tests/this-reserved/this_in_extract.phpt @@ -6,14 +6,14 @@ function foo() { try { extract(["this"=>42, "a"=>24]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); } foo(); ?> --EXPECTF-- -Cannot re-assign $this +Error: Cannot re-assign $this Warning: Undefined variable $a in %s on line %d NULL diff --git a/Zend/tests/throw/001.phpt b/Zend/tests/throw/001.phpt index ba2406c6d388..91d30d717440 100644 --- a/Zend/tests/throw/001.phpt +++ b/Zend/tests/throw/001.phpt @@ -7,84 +7,84 @@ try { $result = true && throw new Exception("true && throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = false && throw new Exception("false && throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = true and throw new Exception("true and throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = false and throw new Exception("false and throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = true || throw new Exception("true || throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = false || throw new Exception("false || throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = true or throw new Exception("true or throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = false or throw new Exception("false or throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = null ?? throw new Exception("null ?? throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = "foo" ?? throw new Exception('"foo" ?? throw'); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = null ?: throw new Exception("null ?: throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = "foo" ?: throw new Exception('"foo" ?: throw'); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -92,7 +92,7 @@ try { var_dump("not yet"); $callable(); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } $result = "bar"; @@ -107,27 +107,27 @@ try { throw new Exception("exception 2") ); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = true ? true : throw new Exception("true ? true : throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $result = false ? true : throw new Exception("false ? true : throw"); var_dump($result); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw new Exception() + 1; } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -144,30 +144,30 @@ var_dump($exception->getMessage()); try { throw null ?? new Exception('throw null ?? new Exception();'); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(13) "true && throw" +Exception: true && throw bool(false) -string(14) "true and throw" +Exception: true and throw bool(false) bool(true) -string(14) "false || throw" +Exception: false || throw bool(true) -string(14) "false or throw" -string(13) "null ?? throw" +Exception: false or throw +Exception: null ?? throw string(3) "foo" -string(13) "null ?: throw" +Exception: null ?: throw string(3) "foo" string(7) "not yet" -string(13) "fn() => throw" +Exception: fn() => throw string(3) "bar" -string(11) "exception 1" +Exception: exception 1 bool(true) -string(20) "false ? true : throw" -string(42) "Unsupported operand types: Exception + int" +Exception: false ? true : throw +TypeError: Unsupported operand types: Exception + int string(35) "throw $exception = new Exception();" string(37) "throw $exception ??= new Exception();" -string(30) "throw null ?? new Exception();" +Exception: throw null ?? new Exception(); diff --git a/Zend/tests/throw/002.phpt b/Zend/tests/throw/002.phpt index e80dfbb7d14d..a904c09f6080 100644 --- a/Zend/tests/throw/002.phpt +++ b/Zend/tests/throw/002.phpt @@ -24,25 +24,25 @@ class Foo { try { (new Foo())->throwException(); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Foo::staticThrowException(); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw true ? new Exception('Ternary true 1') : new Exception('Ternary true 2'); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw false ? new Exception('Ternary false 1') : new Exception('Ternary false 2'); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -50,7 +50,7 @@ try { $exception2 = new Exception('Coalesce non-null 2'); throw $exception1 ?? $exception2; } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -58,27 +58,27 @@ try { $exception2 = new Exception('Coalesce null 2'); throw $exception1 ?? $exception2; } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { throw $exception = new Exception('Assignment'); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $exception = null; throw $exception ??= new Exception('Coalesce assignment null'); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $exception = new Exception('Coalesce assignment non-null 1'); throw $exception ??= new Exception('Coalesce assignment non-null 2'); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $andConditionalTest = function ($condition1, $condition2) { @@ -90,39 +90,39 @@ $andConditionalTest = function ($condition1, $condition2) { try { $andConditionalTest(false, false); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $andConditionalTest(false, true); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $andConditionalTest(true, false); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $andConditionalTest(true, true); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Not found -Static not found -Ternary true 1 -Ternary false 2 -Coalesce non-null 1 -Coalesce null 2 -Assignment -Coalesce assignment null -Coalesce assignment non-null 1 -And in conditional 2 -And in conditional 2 -And in conditional 2 -And in conditional 1 +Exception: Not found +Exception: Static not found +Exception: Ternary true 1 +Exception: Ternary false 2 +Exception: Coalesce non-null 1 +Exception: Coalesce null 2 +Exception: Assignment +Exception: Coalesce assignment null +Exception: Coalesce assignment non-null 1 +Exception: And in conditional 2 +Exception: And in conditional 2 +Exception: And in conditional 2 +Exception: And in conditional 1 diff --git a/Zend/tests/throwing_overloaded_compound_assign_op.phpt b/Zend/tests/throwing_overloaded_compound_assign_op.phpt index 39c38627076c..2f50984734b3 100644 --- a/Zend/tests/throwing_overloaded_compound_assign_op.phpt +++ b/Zend/tests/throwing_overloaded_compound_assign_op.phpt @@ -16,7 +16,7 @@ $test[0] = 42; try { $test[0] %= 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); @@ -24,13 +24,13 @@ $test2 = new Test; try { $test2->prop %= 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test2); ?> --EXPECT-- -Modulo by zero +DivisionByZeroError: Modulo by zero object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(1) { @@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) { int(42) } } -Modulo by zero +DivisionByZeroError: Modulo by zero object(Test)#3 (1) { ["prop"]=> int(42) diff --git a/Zend/tests/traits/gh_17728.phpt b/Zend/tests/traits/gh_17728.phpt index ef458a8e8d5e..69a3128fece1 100644 --- a/Zend/tests/traits/gh_17728.phpt +++ b/Zend/tests/traits/gh_17728.phpt @@ -16,9 +16,9 @@ trait Foo { try { Foo::bar(); } catch (ErrorException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait +ErrorException: Calling static trait method Foo::bar is deprecated, it should only be called on a class using the trait diff --git a/Zend/tests/traits/trait_type_errors.phpt b/Zend/tests/traits/trait_type_errors.phpt index d3c7c0582fb1..f9cf86305579 100644 --- a/Zend/tests/traits/trait_type_errors.phpt +++ b/Zend/tests/traits/trait_type_errors.phpt @@ -23,21 +23,21 @@ $c = new C; try { $c->test1("foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $c->test2("foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $c->test3("foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -C::test1(): Return value must be of type int, string returned -C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d -C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d +TypeError: C::test1(): Return value must be of type int, string returned +TypeError: C::test2(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d +TypeError: C::test3(): Argument #1 ($arg) must be of type int, string given, called in %s on line %d diff --git a/Zend/tests/trigger_error_basic.phpt b/Zend/tests/trigger_error_basic.phpt index d492590bcd92..f0beff31622c 100644 --- a/Zend/tests/trigger_error_basic.phpt +++ b/Zend/tests/trigger_error_basic.phpt @@ -8,12 +8,12 @@ var_dump(trigger_error("error")); try { var_dump(trigger_error("error", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(trigger_error("error", 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(trigger_error("error", E_USER_WARNING)); @@ -23,8 +23,8 @@ var_dump(trigger_error("error", E_USER_DEPRECATED)); --EXPECTF-- Notice: error in %s on line %d bool(true) -trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED -trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED +ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED +ValueError: trigger_error(): Argument #2 ($error_level) must be one of E_USER_ERROR, E_USER_WARNING, E_USER_NOTICE, or E_USER_DEPRECATED Warning: error in %s on line %d bool(true) diff --git a/Zend/tests/try/bug70228_3.phpt b/Zend/tests/try/bug70228_3.phpt index 55dbe4f8914a..0f02d2a6def7 100644 --- a/Zend/tests/try/bug70228_3.phpt +++ b/Zend/tests/try/bug70228_3.phpt @@ -21,11 +21,11 @@ try { var_dump(test()); } catch (Exception $e) { do { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; $e = $e->getPrevious(); } while ($e); } ?> --EXPECT-- -2 -1 +Exception: 2 +Exception: 1 diff --git a/Zend/tests/try/bug70228_4.phpt b/Zend/tests/try/bug70228_4.phpt index f0ab3b0c2c11..8d2e3e0717bd 100644 --- a/Zend/tests/try/bug70228_4.phpt +++ b/Zend/tests/try/bug70228_4.phpt @@ -23,10 +23,10 @@ try { var_dump(test()); } catch (Exception $e) { do { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; $e = $e->getPrevious(); } while ($e); } ?> --EXPECT-- -1 +Exception: 1 diff --git a/Zend/tests/try/bug70228_5.phpt b/Zend/tests/try/bug70228_5.phpt index 29cbf4910de1..e1bbf959d465 100644 --- a/Zend/tests/try/bug70228_5.phpt +++ b/Zend/tests/try/bug70228_5.phpt @@ -13,8 +13,8 @@ function test() { try { test(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ops +Exception: ops diff --git a/Zend/tests/try/bug72213.phpt b/Zend/tests/try/bug72213.phpt index 50555f53e419..493e9db15d59 100644 --- a/Zend/tests/try/bug72213.phpt +++ b/Zend/tests/try/bug72213.phpt @@ -16,10 +16,10 @@ function test() { try { test(); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; var_dump($e->getPrevious()->getMessage()); } ?> --EXPECT-- -string(1) "b" +Exception: b string(1) "a" diff --git a/Zend/tests/try/bug72213_2.phpt b/Zend/tests/try/bug72213_2.phpt index a9b5f1490b2d..eca2e5e8e135 100644 --- a/Zend/tests/try/bug72213_2.phpt +++ b/Zend/tests/try/bug72213_2.phpt @@ -19,8 +19,8 @@ function test() { try { test(); } catch (Exception $e) { - echo "caught {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -caught 1 +Exception: 1 diff --git a/Zend/tests/try/catch_finally_006.phpt b/Zend/tests/try/catch_finally_006.phpt index 216219b6a5b3..6f4027721bf8 100644 --- a/Zend/tests/try/catch_finally_006.phpt +++ b/Zend/tests/try/catch_finally_006.phpt @@ -19,7 +19,7 @@ try { var_dump(foo("para")); } catch (Exception $e) { "caught exception" . PHP_EOL; - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/Zend/tests/try/try_finally_002.phpt b/Zend/tests/try/try_finally_002.phpt index 99a34f62fbd7..3c595f7a11ac 100644 --- a/Zend/tests/try/try_finally_002.phpt +++ b/Zend/tests/try/try_finally_002.phpt @@ -14,10 +14,10 @@ try { foo(); } catch (Exception $e) { do { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } while ($e = $e->getPrevious()); } ?> --EXPECT-- -string(7) "finally" -string(3) "try" +Exception: finally +Exception: try diff --git a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt index 3f720ba2b47f..d63fff22ed68 100644 --- a/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt +++ b/Zend/tests/type_coercion/float_to_int/union_int_string_type_arg_promote_exception.phpt @@ -12,9 +12,9 @@ set_error_handler(function($_, $msg) { try { test(0.5); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Implicit conversion from float 0.5 to int loses precision +Exception: Implicit conversion from float 0.5 to int loses precision diff --git a/Zend/tests/type_coercion/gh22112.phpt b/Zend/tests/type_coercion/gh22112.phpt index 84fdc393a828..d7629960da5e 100644 --- a/Zend/tests/type_coercion/gh22112.phpt +++ b/Zend/tests/type_coercion/gh22112.phpt @@ -20,16 +20,16 @@ $nan = fdiv(0, 0); try { take_bool($nan); } catch (Exception $e) { - echo "bool: ", $e->getMessage(), "\n"; + echo 'bool: ', $e::class, ': ', $e->getMessage(), "\n"; } try { take_string($nan); } catch (Exception $e) { - echo "string: ", $e->getMessage(), "\n"; + echo 'string: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bool: unexpected NAN value was coerced to bool -string: unexpected NAN value was coerced to string +bool: Exception: unexpected NAN value was coerced to bool +string: Exception: unexpected NAN value was coerced to string diff --git a/Zend/tests/type_coercion/settype/settype_resource.phpt b/Zend/tests/type_coercion/settype/settype_resource.phpt index fa9ca739fa90..aeadc3d4c0f5 100644 --- a/Zend/tests/type_coercion/settype/settype_resource.phpt +++ b/Zend/tests/type_coercion/settype/settype_resource.phpt @@ -33,7 +33,7 @@ foreach ($vars as $var) { try { settype($var, "resource"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($var); } @@ -41,22 +41,22 @@ foreach ($vars as $var) { echo "Done\n"; ?> --EXPECTF-- -Cannot convert to resource type +ValueError: Cannot convert to resource type string(6) "string" -Cannot convert to resource type +ValueError: Cannot convert to resource type string(7) "8754456" -Cannot convert to resource type +ValueError: Cannot convert to resource type string(0) "" -Cannot convert to resource type +ValueError: Cannot convert to resource type string(1) "%0" -Cannot convert to resource type +ValueError: Cannot convert to resource type int(9876545) -Cannot convert to resource type +ValueError: Cannot convert to resource type float(0.1) -Cannot convert to resource type +ValueError: Cannot convert to resource type array(0) { } -Cannot convert to resource type +ValueError: Cannot convert to resource type array(3) { [0]=> int(1) @@ -65,15 +65,15 @@ array(3) { [2]=> int(3) } -Cannot convert to resource type +ValueError: Cannot convert to resource type bool(false) -Cannot convert to resource type +ValueError: Cannot convert to resource type bool(true) -Cannot convert to resource type +ValueError: Cannot convert to resource type NULL -Cannot convert to resource type +ValueError: Cannot convert to resource type resource(%d) of type (stream) -Cannot convert to resource type +ValueError: Cannot convert to resource type object(test)#%d (0) { } Done diff --git a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt index 17921e5ae530..73fea49fb208 100644 --- a/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt +++ b/Zend/tests/type_coercion/settype/settype_string_nan_with_error_handler2.phpt @@ -18,4 +18,4 @@ var_dump($nan); --EXPECT-- float(NAN) unexpected NAN value was coerced to string -string(3) "NAN" \ No newline at end of file +string(3) "NAN" diff --git a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt index 26911bddb7eb..24243badbcbf 100644 --- a/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt +++ b/Zend/tests/type_coercion/type_casts/cast_to_void_ast.phpt @@ -8,11 +8,11 @@ try { (void) somefunc(); }); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -assert(false && function () { +AssertionError: assert(false && function () { (void)somefunc(); }) diff --git a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt index 6375c60ab71b..c23541d9446b 100644 --- a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt +++ b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt @@ -41,12 +41,12 @@ var_dump($o); try { bar1(); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bar2(); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -59,5 +59,5 @@ object(B)#%d (0) { } object(B)#%d (0) { } -bar1(): Return value must be of type (X&Y)|(W&Z), C returned -bar2(): Return value must be of type (W&Z)|(X&Y), C returned +TypeError: bar1(): Return value must be of type (X&Y)|(W&Z), C returned +TypeError: bar2(): Return value must be of type (W&Z)|(X&Y), C returned diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt index e9089c130b49..cca12fb11e54 100644 --- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt +++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_null.phpt @@ -40,22 +40,22 @@ $c = new C(); try { $test->foo1($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->foo2($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop1 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop2 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -67,8 +67,8 @@ object(A)#2 (0) { } NULL NULL -Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d -Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d -Cannot assign C to property Test::$prop1 of type (X&Y)|null -Cannot assign C to property Test::$prop2 of type (X&Y)|null +TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d +TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|null, C given, called in %s on line %d +TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|null +TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|null ===DONE=== diff --git a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt index 4c9a5f95e30d..92f8ef2b3b89 100644 --- a/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt +++ b/Zend/tests/type_declarations/dnf_types/dnf_intersection_and_single.phpt @@ -61,42 +61,42 @@ $c = new C(); try { $test->foo1($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->foo2($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->bar1($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->bar2($c); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop1 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop2 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop3 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $test->prop4 = $c; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -116,12 +116,12 @@ object(B)#3 (0) { } object(B)#3 (0) { } -Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d -Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d -Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d -Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d -Cannot assign C to property Test::$prop1 of type (X&Y)|int -Cannot assign C to property Test::$prop2 of type (X&Y)|int -Cannot assign C to property Test::$prop3 of type (X&Y)|B -Cannot assign C to property Test::$prop4 of type B|(X&Y) +TypeError: Test::foo1(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d +TypeError: Test::foo2(): Argument #1 ($v) must be of type (X&Y)|int, C given, called in %s on line %d +TypeError: Test::bar1(): Argument #1 ($v) must be of type B|(X&Y), C given, called in %s on line %d +TypeError: Test::bar2(): Argument #1 ($v) must be of type (X&Y)|B, C given, called in %s on line %d +TypeError: Cannot assign C to property Test::$prop1 of type (X&Y)|int +TypeError: Cannot assign C to property Test::$prop2 of type (X&Y)|int +TypeError: Cannot assign C to property Test::$prop3 of type (X&Y)|B +TypeError: Cannot assign C to property Test::$prop4 of type B|(X&Y) ===DONE=== diff --git a/Zend/tests/type_declarations/dnf_types/gh9516.phpt b/Zend/tests/type_declarations/dnf_types/gh9516.phpt index 3d91932ebd45..7fed8eb8a71c 100644 --- a/Zend/tests/type_declarations/dnf_types/gh9516.phpt +++ b/Zend/tests/type_declarations/dnf_types/gh9516.phpt @@ -25,28 +25,28 @@ try { $t->method1(new A_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method1(new B_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method1(new AB_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method1(new D_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } // Lets try in reverse? @@ -54,28 +54,28 @@ try { $t->method2(new A_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method2(new B_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method2(new AB_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method2(new D_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } /* Single before intersection */ @@ -83,28 +83,28 @@ try { $t->method3(new A_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method3(new B_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method3(new AB_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method3(new D_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } // Lets try in reverse? @@ -112,46 +112,46 @@ try { $t->method4(new A_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method4(new B_); echo 'Fail', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method4(new AB_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } try { $t->method4(new D_); echo 'Pass', \PHP_EOL; } catch (\Throwable $throwable) { - echo $throwable->getMessage(), \PHP_EOL; + echo $throwable::class, ': ', $throwable->getMessage(), PHP_EOL; } ?> --EXPECTF-- -T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d -T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d +TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, A_ given, called in %s on line %d +TypeError: T::method1(): Argument #1 ($arg) must be of type (A&B)|D, B_ given, called in %s on line %d Pass Pass -T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d -T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d +TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, A_ given, called in %s on line %d +TypeError: T::method2(): Argument #1 ($arg) must be of type (B&A)|D, B_ given, called in %s on line %d Pass Pass -T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d -T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d +TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), A_ given, called in %s on line %d +TypeError: T::method3(): Argument #1 ($arg) must be of type D|(A&B), B_ given, called in %s on line %d Pass Pass -T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d -T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d +TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), A_ given, called in %s on line %d +TypeError: T::method4(): Argument #1 ($arg) must be of type D|(B&A), B_ given, called in %s on line %d Pass Pass diff --git a/Zend/tests/type_declarations/internal_function_strict_mode.phpt b/Zend/tests/type_declarations/internal_function_strict_mode.phpt index 5b2ad90abfea..90ce94953bfe 100644 --- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt +++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt @@ -8,28 +8,28 @@ echo "*** Trying Ord With Integer" . PHP_EOL; try { var_dump(ord(1)); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "*** Trying Array Map With Invalid Callback" . PHP_EOL; try { array_map([null, "bar"], []); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "*** Trying Strlen With Float" . PHP_EOL; try { var_dump(strlen(1.5)); } catch (TypeError $e) { - echo "*** Caught " . $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Trying Ord With Integer -*** Caught ord(): Argument #1 ($character) must be of type string, int given +TypeError: ord(): Argument #1 ($character) must be of type string, int given *** Trying Array Map With Invalid Callback -*** Caught array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object *** Trying Strlen With Float -*** Caught strlen(): Argument #1 ($string) must be of type string, float given +TypeError: strlen(): Argument #1 ($string) must be of type string, float given diff --git a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt index 568e6e25afad..8268731d743d 100644 --- a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt +++ b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt @@ -29,7 +29,7 @@ $o = new A(); try { $o->prop = $tp; } catch (TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $o->prop = $tc; @@ -46,7 +46,7 @@ var_dump($r); ?> --EXPECTF-- -Cannot assign TestParent to property A::$prop of type X&Y&Z +TypeError: Cannot assign TestParent to property A::$prop of type X&Y&Z object(TestChild)#%d (0) { } object(TestParent)#%d (0) { diff --git a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt index 83af5e96ccfa..bbeded80b56b 100644 --- a/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt +++ b/Zend/tests/type_declarations/intersection_types/implicit_nullable_intersection_type_error.phpt @@ -10,10 +10,10 @@ function foo(X&Y $foo = null) { try { foo(5); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: foo(): Implicitly marking parameter $foo as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d -foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d +TypeError: foo(): Argument #1 ($foo) must be of type (X&Y)|null, int given, called in %s on line %d diff --git a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt index e724e1b15f50..15bbc4a69d19 100644 --- a/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt +++ b/Zend/tests/type_declarations/intersection_types/missing_interface_intersection_type.phpt @@ -25,7 +25,7 @@ try { $o = foo(); var_dump($o); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $c = new Collection(); @@ -34,17 +34,17 @@ $a = new A(); try { $c->intersect = $a; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bar($a); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -foo(): Return value must be of type X&Y, A returned -Cannot assign A to property Collection::$intersect of type X&Y -bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d +TypeError: foo(): Return value must be of type X&Y, A returned +TypeError: Cannot assign A to property Collection::$intersect of type X&Y +TypeError: bar(): Argument #1 ($o) must be of type X&Y, A given, called in %s on line %d diff --git a/Zend/tests/type_declarations/intersection_types/parameter.phpt b/Zend/tests/type_declarations/intersection_types/parameter.phpt index d1c7de224365..1abf823d8410 100644 --- a/Zend/tests/type_declarations/intersection_types/parameter.phpt +++ b/Zend/tests/type_declarations/intersection_types/parameter.phpt @@ -18,11 +18,11 @@ foo(new Foo()); try { foo(new Bar()); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- object(Foo)#1 (0) { } -foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d +TypeError: foo(): Argument #1 ($bar) must be of type A&B, Bar given, called in %s on line %d diff --git a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt index 2ceb34f256ff..36e1ddf58dd0 100644 --- a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt +++ b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt @@ -22,9 +22,9 @@ $test->z =& $r; try { $r = new B; } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot assign B to reference held by property Test::$z of type X&Z +TypeError: Cannot assign B to reference held by property Test::$z of type X&Z diff --git a/Zend/tests/type_declarations/iterable/iterable_001.phpt b/Zend/tests/type_declarations/iterable/iterable_001.phpt index 7c127c8e1dfd..950afb253fd3 100644 --- a/Zend/tests/type_declarations/iterable/iterable_001.phpt +++ b/Zend/tests/type_declarations/iterable/iterable_001.phpt @@ -20,7 +20,7 @@ test(new ArrayIterator([1, 2, 3])); try { test(1); } catch (Throwable $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -47,4 +47,4 @@ object(ArrayIterator)#1 (1) { int(3) } } -test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d +TypeError: test(): Argument #1 ($iterable) must be of type Traversable|array, int given, called in %s on line %d diff --git a/Zend/tests/type_declarations/iterable/iterable_003.phpt b/Zend/tests/type_declarations/iterable/iterable_003.phpt index a2c96995da37..a88c820e9b29 100644 --- a/Zend/tests/type_declarations/iterable/iterable_003.phpt +++ b/Zend/tests/type_declarations/iterable/iterable_003.phpt @@ -20,7 +20,7 @@ var_dump(bar()); try { baz(); } catch (Throwable $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -31,4 +31,4 @@ object(Generator)#%d (1) { ["function"]=> string(17) "{closure:bar():7}" } -baz(): Return value must be of type Traversable|array, int returned +TypeError: baz(): Return value must be of type Traversable|array, int returned diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt index 61900f993c0e..34069507c9fd 100644 --- a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt +++ b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt @@ -8,21 +8,21 @@ function test(false $v) { var_dump($v); } try { test(0); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { test(''); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { test([]); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d -test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d -test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type false, int given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type false, string given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type false, array given, called in %s on line %d diff --git a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt index 726245705ffc..d584c5aaee0a 100644 --- a/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt +++ b/Zend/tests/type_declarations/literal_types/false_no_coercion_on_overload.phpt @@ -22,10 +22,10 @@ var_dump($p->foo(0)); try { var_dump($c->foo(0)); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(false) -C::foo(): Return value must be of type array|false, int returned +TypeError: C::foo(): Return value must be of type array|false, int returned diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt index 85d6c90cd057..ad52b605b72c 100644 --- a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt +++ b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt @@ -8,27 +8,27 @@ function test(true $v) { var_dump($v); } try { test(1); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { test('1'); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { test([1]); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { test(new stdClass()); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d -test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d -test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d -test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type true, int given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type true, string given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type true, array given, called in %s on line %d +TypeError: test(): Argument #1 ($v) must be of type true, stdClass given, called in %s on line %d diff --git a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt index 7eebe1e3571f..7090d72747e6 100644 --- a/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt +++ b/Zend/tests/type_declarations/literal_types/true_no_coercion_on_overload.phpt @@ -22,10 +22,10 @@ var_dump($p->foo(1)); try { var_dump($c->foo(1)); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -C::foo(): Return value must be of type array|true, int returned +TypeError: C::foo(): Return value must be of type array|true, int returned diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt index 8a2c60002054..b77d9ca8e168 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_strict_success.phpt @@ -28,9 +28,9 @@ $foo = new Foo(); try { $foo->property1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Typed property Foo::$property1 must not be accessed before initialization +Error: Typed property Foo::$property1 must not be accessed before initialization diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt index e83023d54cf2..b633cfb4a8cc 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_property_weak_success.phpt @@ -27,9 +27,9 @@ $foo = new Foo(); try { $foo->property1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Typed property Foo::$property1 must not be accessed before initialization +Error: Typed property Foo::$property1 must not be accessed before initialization diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt index 2bd775af0a47..52bbfc2d67e3 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_strict_error.phpt @@ -11,9 +11,9 @@ function foo(): mixed try { foo(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -foo(): Return value must be of type mixed, none returned +TypeError: foo(): Return value must be of type mixed, none returned diff --git a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt index 52bd99beb6cd..f1eb0a131852 100644 --- a/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt +++ b/Zend/tests/type_declarations/mixed/validation/mixed_return_weak_error.phpt @@ -10,9 +10,9 @@ function foo(): mixed try { foo(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -foo(): Return value must be of type mixed, none returned +TypeError: foo(): Return value must be of type mixed, none returned diff --git a/Zend/tests/type_declarations/scalar_basic.phpt b/Zend/tests/type_declarations/scalar_basic.phpt index 352c48f8a9e0..ab57111bfed3 100644 --- a/Zend/tests/type_declarations/scalar_basic.phpt +++ b/Zend/tests/type_declarations/scalar_basic.phpt @@ -53,7 +53,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(), PHP_EOL; } } } @@ -76,19 +76,19 @@ E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line int(1) *** 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(%d) int(%d) *** 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) int(1) @@ -97,22 +97,22 @@ int(1) int(0) *** 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)#%s (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)#%s (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: @@ -129,13 +129,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(%d) float(%s) @@ -150,22 +150,22 @@ float(1) float(0) *** 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)#%s (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)#%s (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: @@ -204,22 +204,22 @@ string(1) "1" string(0) "" *** 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)#%s (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)#%s (0) { } string(6) "foobar" *** 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: @@ -258,21 +258,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)#%s (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)#%s (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_constant_defaults.phpt b/Zend/tests/type_declarations/scalar_constant_defaults.phpt index 5e3826de7dcb..eed7ed58b228 100644 --- a/Zend/tests/type_declarations/scalar_constant_defaults.phpt +++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt @@ -65,14 +65,14 @@ echo "Testing int with default null constant" . PHP_EOL; try { var_dump(int_val_default_null()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Testing int with null null constant" . PHP_EOL; try { var_dump(int_val_default_null(null)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Testing nullable int with default null constant" . PHP_EOL; @@ -96,9 +96,9 @@ float(10.7) Testing string add val string(14) "this is a test" Testing int with default null constant -int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d +TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing int with null null constant -int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d +TypeError: int_val_default_null(): Argument #1 ($a) must be of type int, null given, called in %s on line %d Testing nullable int with default null constant NULL Testing nullable int with null null constant diff --git a/Zend/tests/type_declarations/scalar_none.phpt b/Zend/tests/type_declarations/scalar_none.phpt index 8316b51fa9ef..d92aad930295 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(), PHP_EOL; } } 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..34c304619d15 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(), PHP_EOL; } } @@ -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..655937065908 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(), PHP_EOL; } } } @@ -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..8bf86e34b985 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(), PHP_EOL; } } } @@ -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..d9235b54b270 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(), PHP_EOL; } } } @@ -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..49164c67679a 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(), PHP_EOL; } ?> --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..e80f6a25710c 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(), PHP_EOL; } ?> --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..db0a81d6c3e2 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(), PHP_EOL; } ?> --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 dde6f595264a..1ed6dabda0b2 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/ext/bcmath/tests/bcadd_error.phpt b/ext/bcmath/tests/bcadd_error.phpt index 320bf390680a..ffd3ba429b03 100644 --- a/ext/bcmath/tests/bcadd_error.phpt +++ b/ext/bcmath/tests/bcadd_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcadd('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcadd('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #2 ($num2) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcceil_error.phpt b/ext/bcmath/tests/bcceil_error.phpt index fd4c51ff6c58..58df0fdce601 100644 --- a/ext/bcmath/tests/bcceil_error.phpt +++ b/ext/bcmath/tests/bcceil_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcceil('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcceil('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcceil(): Argument #1 ($num) is not well-formed -bcceil(): Argument #1 ($num) is not well-formed +ValueError: bcceil(): Argument #1 ($num) is not well-formed +ValueError: bcceil(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bccomp_error.phpt b/ext/bcmath/tests/bccomp_error.phpt index 90645c52f7e5..5a48f4e0494d 100644 --- a/ext/bcmath/tests/bccomp_error.phpt +++ b/ext/bcmath/tests/bccomp_error.phpt @@ -8,16 +8,16 @@ bcmath try { bccomp('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bccomp('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #2 ($num2) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcdiv_error1.phpt b/ext/bcmath/tests/bcdiv_error1.phpt index b6af64d69af3..fbb37ad66931 100644 --- a/ext/bcmath/tests/bcdiv_error1.phpt +++ b/ext/bcmath/tests/bcdiv_error1.phpt @@ -11,22 +11,22 @@ bcmath try { bcdiv('10.99', '0'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcdiv('10.99', '0.00'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcdiv('10.99', '-0.00'); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Division by zero -Division by zero -Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/bcmath/tests/bcdiv_error2.phpt b/ext/bcmath/tests/bcdiv_error2.phpt index a4e1cae35354..fb21fca2eedd 100644 --- a/ext/bcmath/tests/bcdiv_error2.phpt +++ b/ext/bcmath/tests/bcdiv_error2.phpt @@ -8,16 +8,16 @@ bcmath try { bcdiv('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcdiv('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcdiv(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #2 ($num2) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcfloor_error.phpt b/ext/bcmath/tests/bcfloor_error.phpt index 7578a5afe3b8..28556b366aaa 100644 --- a/ext/bcmath/tests/bcfloor_error.phpt +++ b/ext/bcmath/tests/bcfloor_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcfloor('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcfloor('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcfloor(): Argument #1 ($num) is not well-formed -bcfloor(): Argument #1 ($num) is not well-formed +ValueError: bcfloor(): Argument #1 ($num) is not well-formed +ValueError: bcfloor(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcmod_error2.phpt b/ext/bcmath/tests/bcmod_error2.phpt index 37c433fbb89c..27e724282df2 100644 --- a/ext/bcmath/tests/bcmod_error2.phpt +++ b/ext/bcmath/tests/bcmod_error2.phpt @@ -9,20 +9,20 @@ bcmath.scale=0 try { bcmod("10", "0"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcmod("10", "0.000"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { bcmod("10", "-0.0"); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Modulo by zero -Modulo by zero -Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/bcmod_error3.phpt b/ext/bcmath/tests/bcmod_error3.phpt index 8df986fe7654..d15c91700578 100644 --- a/ext/bcmath/tests/bcmod_error3.phpt +++ b/ext/bcmath/tests/bcmod_error3.phpt @@ -8,16 +8,16 @@ bcmath try { bcmod('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmod('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcmod(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #2 ($num2) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcmul_error.phpt b/ext/bcmath/tests/bcmul_error.phpt index 361b46163ee6..5ba15027e44c 100644 --- a/ext/bcmath/tests/bcmul_error.phpt +++ b/ext/bcmath/tests/bcmul_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcmul('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmul('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcmul(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #2 ($num2) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bcpow_div_by_zero.phpt b/ext/bcmath/tests/bcpow_div_by_zero.phpt index ac1e8187450c..fa5d97698d99 100644 --- a/ext/bcmath/tests/bcpow_div_by_zero.phpt +++ b/ext/bcmath/tests/bcpow_div_by_zero.phpt @@ -14,16 +14,16 @@ foreach ($baseNumbers as $baseNumber) { try { echo bcpow($baseNumber, $exponent), "\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero -Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/bcpow_error1.phpt b/ext/bcmath/tests/bcpow_error1.phpt index fefdfc57a010..1f991deb4dfa 100644 --- a/ext/bcmath/tests/bcpow_error1.phpt +++ b/ext/bcmath/tests/bcpow_error1.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpow('1', '1.1', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpow('1', '0.1', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #2 ($exponent) cannot have a fractional part -bcpow(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpow(): Argument #2 ($exponent) cannot have a fractional part diff --git a/ext/bcmath/tests/bcpow_error2.phpt b/ext/bcmath/tests/bcpow_error2.phpt index f9b830ca7d5b..ac4b995201a9 100644 --- a/ext/bcmath/tests/bcpow_error2.phpt +++ b/ext/bcmath/tests/bcpow_error2.phpt @@ -7,15 +7,15 @@ bcmath try { var_dump(bcpow('0', '9223372036854775808', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpow('0', '-9223372036854775808', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #2 ($exponent) is too large -bcpow(): Argument #2 ($exponent) is too large +ValueError: bcpow(): Argument #2 ($exponent) is too large +ValueError: bcpow(): Argument #2 ($exponent) is too large diff --git a/ext/bcmath/tests/bcpow_error3.phpt b/ext/bcmath/tests/bcpow_error3.phpt index f47c85d4da86..941d2f7fae9f 100644 --- a/ext/bcmath/tests/bcpow_error3.phpt +++ b/ext/bcmath/tests/bcpow_error3.phpt @@ -8,16 +8,16 @@ bcmath try { bcpow('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpow('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpow(): Argument #1 ($num) is not well-formed -bcpow(): Argument #2 ($exponent) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bcpow(): Argument #2 ($exponent) is not well-formed diff --git a/ext/bcmath/tests/bcpowmod_error.phpt b/ext/bcmath/tests/bcpowmod_error.phpt index ff2862310cb2..9b9770a959d7 100644 --- a/ext/bcmath/tests/bcpowmod_error.phpt +++ b/ext/bcmath/tests/bcpowmod_error.phpt @@ -8,23 +8,23 @@ bcmath try { bcpowmod('a', '1', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', 'a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', '1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #1 ($num) is not well-formed -bcpowmod(): Argument #2 ($exponent) is not well-formed -bcpowmod(): Argument #3 ($modulus) is not well-formed +ValueError: bcpowmod(): Argument #1 ($num) is not well-formed +ValueError: bcpowmod(): Argument #2 ($exponent) is not well-formed +ValueError: bcpowmod(): Argument #3 ($modulus) is not well-formed diff --git a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt index 7814e2bd41d8..61b60ff60234 100644 --- a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt +++ b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt @@ -9,8 +9,8 @@ bcmath try { var_dump(bcpowmod('1', '-1', '2')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0 +ValueError: bcpowmod(): Argument #2 ($exponent) must be greater than or equal to 0 diff --git a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt index 8540a0d6df3c..833a55266e3e 100644 --- a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt +++ b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt @@ -9,8 +9,8 @@ bcmath try { var_dump(bcpowmod('1', '1', '0')); } catch (DivisionByZeroError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/bcround_error.phpt b/ext/bcmath/tests/bcround_error.phpt index 95579a4edf09..fe114cf8bba6 100644 --- a/ext/bcmath/tests/bcround_error.phpt +++ b/ext/bcmath/tests/bcround_error.phpt @@ -7,15 +7,15 @@ bcmath try { bcround('hoge'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { bcround('0.00.1'); } catch (Throwable $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bcround(): Argument #1 ($num) is not well-formed -bcround(): Argument #1 ($num) is not well-formed +ValueError: bcround(): Argument #1 ($num) is not well-formed +ValueError: bcround(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcround_precision_bounds.phpt b/ext/bcmath/tests/bcround_precision_bounds.phpt index 4c4f910476a7..fcfb2d2c3248 100644 --- a/ext/bcmath/tests/bcround_precision_bounds.phpt +++ b/ext/bcmath/tests/bcround_precision_bounds.phpt @@ -9,20 +9,20 @@ bcmath try { bcround('1', PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { (new BcMath\Number('1'))->round(PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { (new BcMath\Number('1'))->round(2147483648); // INT_MAX + 1 } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -bcround(): Argument #2 ($precision) must be between %i and %d -BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d -BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d +ValueError: bcround(): Argument #2 ($precision) must be between %i and %d +ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d +ValueError: BcMath\Number::round(): Argument #1 ($precision) must be between %i and %d diff --git a/ext/bcmath/tests/bcscale_variation001.phpt b/ext/bcmath/tests/bcscale_variation001.phpt index 8d9d32e064b8..ce51029e4b68 100644 --- a/ext/bcmath/tests/bcscale_variation001.phpt +++ b/ext/bcmath/tests/bcscale_variation001.phpt @@ -6,13 +6,13 @@ bcmath bcmath.scale=0 --FILE-- getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- 5 -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/bcsqrt_error1.phpt b/ext/bcmath/tests/bcsqrt_error1.phpt index 78923f4a9480..9d265d8c76c2 100644 --- a/ext/bcmath/tests/bcsqrt_error1.phpt +++ b/ext/bcmath/tests/bcsqrt_error1.phpt @@ -10,8 +10,8 @@ bcmath try { bcsqrt('-9'); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsqrt(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: bcsqrt(): Argument #1 ($num) must be greater than or equal to 0 diff --git a/ext/bcmath/tests/bcsqrt_error2.phpt b/ext/bcmath/tests/bcsqrt_error2.phpt index 1ef934d3bcf1..0e49714db29d 100644 --- a/ext/bcmath/tests/bcsqrt_error2.phpt +++ b/ext/bcmath/tests/bcsqrt_error2.phpt @@ -8,9 +8,9 @@ bcmath try { bcsqrt('a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/bcsub_error.phpt b/ext/bcmath/tests/bcsub_error.phpt index 4e1abd3fa950..0e04cffafde6 100644 --- a/ext/bcmath/tests/bcsub_error.phpt +++ b/ext/bcmath/tests/bcsub_error.phpt @@ -8,16 +8,16 @@ bcmath try { bcsub('a', '1'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsub('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcsub(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #2 ($num2) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/bug60377.phpt b/ext/bcmath/tests/bug60377.phpt index 16d058441a35..46aa59fdb265 100644 --- a/ext/bcmath/tests/bug60377.phpt +++ b/ext/bcmath/tests/bug60377.phpt @@ -10,10 +10,10 @@ if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?> try { $var48 = bcscale(634314234334311); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $var67 = bcsqrt(0); $var414 = bcadd(0,-1,10); ?> --EXPECT-- -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/bug72093.phpt b/ext/bcmath/tests/bug72093.phpt index a424a59e0470..c88afacedea4 100644 --- a/ext/bcmath/tests/bug72093.phpt +++ b/ext/bcmath/tests/bug72093.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpowmod(1, 0, 128, -200)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpowmod(1, 1.2, 1, 1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 -bcpowmod(): Argument #2 ($exponent) cannot have a fractional part +ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 +ValueError: bcpowmod(): Argument #2 ($exponent) cannot have a fractional part diff --git a/ext/bcmath/tests/bug75178.phpt b/ext/bcmath/tests/bug75178.phpt index 940a3567de16..14d627bada03 100644 --- a/ext/bcmath/tests/bug75178.phpt +++ b/ext/bcmath/tests/bug75178.phpt @@ -7,14 +7,14 @@ bcmath try { var_dump(bcpowmod('4.1', '4', '3', 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bcpowmod('4', '4', '3.1', 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #1 ($num) cannot have a fractional part -bcpowmod(): Argument #3 ($modulus) cannot have a fractional part +ValueError: bcpowmod(): Argument #1 ($num) cannot have a fractional part +ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part diff --git a/ext/bcmath/tests/bug78878.phpt b/ext/bcmath/tests/bug78878.phpt index 9d9d0db48cf4..1ba4376cd7dd 100644 --- a/ext/bcmath/tests/bug78878.phpt +++ b/ext/bcmath/tests/bug78878.phpt @@ -7,8 +7,8 @@ bcmath try { print bcmul("\xB26483605105519922841849335928742092", bcpowmod(2, 65535, -4e-4)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcpowmod(): Argument #3 ($modulus) cannot have a fractional part +ValueError: bcpowmod(): Argument #3 ($modulus) cannot have a fractional part diff --git a/ext/bcmath/tests/bug80545.phpt b/ext/bcmath/tests/bug80545.phpt index f1e256776d93..ca795e01d0dc 100644 --- a/ext/bcmath/tests/bug80545.phpt +++ b/ext/bcmath/tests/bug80545.phpt @@ -8,16 +8,16 @@ bcmath try { bcadd('a', 'a'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcadd('1', 'a'); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #2 ($num2) is not well-formed \ No newline at end of file +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #2 ($num2) is not well-formed diff --git a/ext/bcmath/tests/gh15968.phpt b/ext/bcmath/tests/gh15968.phpt index aa91534e7738..ddf112412785 100644 --- a/ext/bcmath/tests/gh15968.phpt +++ b/ext/bcmath/tests/gh15968.phpt @@ -15,8 +15,8 @@ $b = new MyString(); try { var_dump($a + $b); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + MyString +TypeError: Unsupported operand types: BcMath\Number + MyString diff --git a/ext/bcmath/tests/negative_scale.phpt b/ext/bcmath/tests/negative_scale.phpt index 3b9377559098..ed3d726f6ec3 100644 --- a/ext/bcmath/tests/negative_scale.phpt +++ b/ext/bcmath/tests/negative_scale.phpt @@ -9,62 +9,62 @@ bcmath.scale=0 try { bcadd('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsub('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmul('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcdiv('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcmod('1','2',-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpowmod('1', '2', '3', -9); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcpow('1', '2', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcsqrt('9', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bccomp('1', '2', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bcscale(-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bcadd(): Argument #3 ($scale) must be between 0 and 2147483647 -bcsub(): Argument #3 ($scale) must be between 0 and 2147483647 -bcmul(): Argument #3 ($scale) must be between 0 and 2147483647 -bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647 -bcmod(): Argument #3 ($scale) must be between 0 and 2147483647 -bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 -bcpow(): Argument #3 ($scale) must be between 0 and 2147483647 -bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647 -bccomp(): Argument #3 ($scale) must be between 0 and 2147483647 -bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 +ValueError: bcadd(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcsub(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcmul(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcdiv(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcmod(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcpowmod(): Argument #4 ($scale) must be between 0 and 2147483647 +ValueError: bcpow(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcsqrt(): Argument #2 ($scale) must be between 0 and 2147483647 +ValueError: bccomp(): Argument #3 ($scale) must be between 0 and 2147483647 +ValueError: bcscale(): Argument #1 ($scale) must be between 0 and 2147483647 diff --git a/ext/bcmath/tests/number/construct_error.phpt b/ext/bcmath/tests/number/construct_error.phpt index 0b49e871cea9..f2113f1c44a2 100644 --- a/ext/bcmath/tests/number/construct_error.phpt +++ b/ext/bcmath/tests/number/construct_error.phpt @@ -8,16 +8,16 @@ try { $num = new BcMath\Number('1'); $num->__construct(5); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num = new BcMath\Number('a'); var_dump($num); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value -BcMath\Number::__construct(): Argument #1 ($num) is not well-formed +Error: Cannot modify readonly property BcMath\Number::$value +ValueError: BcMath\Number::__construct(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt index 7f64f3101139..f4935762383c 100644 --- a/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/calc_methods_num_arg_error.phpt @@ -29,7 +29,7 @@ foreach ($methods as $method) { try { $num->$method($val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "\n"; @@ -38,11 +38,11 @@ foreach ($methods as $method) { --EXPECTF-- ========== add ========== non number str: -BcMath\Number::add(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::add(): Argument #1 ($num) is not well-formed array: -BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::add(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -52,11 +52,11 @@ Deprecated: BcMath\Number::add(): Passing null to parameter #1 ($num) of type Bc ========== sub ========== non number str: -BcMath\Number::sub(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::sub(): Argument #1 ($num) is not well-formed array: -BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::sub(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -66,11 +66,11 @@ Deprecated: BcMath\Number::sub(): Passing null to parameter #1 ($num) of type Bc ========== mul ========== non number str: -BcMath\Number::mul(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::mul(): Argument #1 ($num) is not well-formed array: -BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::mul(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -80,43 +80,43 @@ Deprecated: BcMath\Number::mul(): Passing null to parameter #1 ($num) of type Bc ========== div ========== non number str: -BcMath\Number::div(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::div(): Argument #1 ($num) is not well-formed array: -BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::div(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Division by zero +DivisionByZeroError: Division by zero null: Deprecated: BcMath\Number::div(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s -Division by zero +DivisionByZeroError: Division by zero ========== mod ========== non number str: -BcMath\Number::mod(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::mod(): Argument #1 ($num) is not well-formed array: -BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::mod(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Modulo by zero +DivisionByZeroError: Modulo by zero null: Deprecated: BcMath\Number::mod(): Passing null to parameter #1 ($num) of type BcMath\Number|string|int is deprecated in %s -Modulo by zero +DivisionByZeroError: Modulo by zero ========== pow ========== non number str: -BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed +ValueError: BcMath\Number::pow(): Argument #1 ($exponent) is not well-formed array: -BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::pow(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s diff --git a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt index 35e789f9c103..bce9ecebdf99 100644 --- a/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/calc_methods_scale_arg_error.phpt @@ -27,7 +27,7 @@ foreach ($methods as $method) { try { $num->$method(1, $val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "\n"; @@ -36,54 +36,54 @@ foreach ($methods as $method) { --EXPECTF-- ========== add ========== array: -BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::add(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== sub ========== array: -BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::sub(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== mul ========== array: -BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::mul(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== div ========== array: -BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::div(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== mod ========== array: -BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::mod(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s ========== pow ========== array: -BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given +TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, array given other object: -BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given +TypeError: BcMath\Number::pow(): Argument #2 ($scale) must be of type ?int, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s diff --git a/ext/bcmath/tests/number/methods/compare_arg_error.phpt b/ext/bcmath/tests/number/methods/compare_arg_error.phpt index bf714304d7fd..ff752d3d36e5 100644 --- a/ext/bcmath/tests/number/methods/compare_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/compare_arg_error.phpt @@ -18,20 +18,20 @@ foreach ($args as [$val, $type]) { try { $num->compare($val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } ?> --EXPECTF-- non number str: -BcMath\Number::compare(): Argument #1 ($num) is not well-formed +ValueError: BcMath\Number::compare(): Argument #1 ($num) is not well-formed array: -BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::compare(): Argument #1 ($num) must be of type int, string, or BcMath\Number, stdClass given float: diff --git a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt index 6a7099b1c30e..565fd65bf136 100644 --- a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt +++ b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt @@ -21,21 +21,21 @@ foreach ($values as $value) { try { $num->pow($exponent); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt index 796769e1e6c4..923bd9968b61 100644 --- a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt +++ b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt @@ -20,7 +20,7 @@ foreach ($args as [$val, $type]) { try { $num->powmod($val, 1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -32,18 +32,18 @@ foreach ($args as [$val, $type]) { try { $num->powmod(1, $val); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- ========== check 1st arg ========== non number str: -BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed +ValueError: BcMath\Number::powmod(): Argument #1 ($exponent) is not well-formed array: -BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::powmod(): Argument #1 ($exponent) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s @@ -53,16 +53,16 @@ Deprecated: BcMath\Number::powmod(): Passing null to parameter #1 ($exponent) of ========== check 2nd arg ========== non number str: -BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed +ValueError: BcMath\Number::powmod(): Argument #2 ($modulus) is not well-formed array: -BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given +TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, array given other object: -BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given +TypeError: BcMath\Number::powmod(): Argument #2 ($modulus) must be of type int, string, or BcMath\Number, stdClass given float: Deprecated: Implicit conversion from float 0.1 to int loses precision in %s -Modulo by zero +DivisionByZeroError: Modulo by zero null: Deprecated: BcMath\Number::powmod(): Passing null to parameter #2 ($modulus) of type BcMath\Number|string|int is deprecated in %s -Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/number/operators/calc_array.phpt b/ext/bcmath/tests/number/operators/calc_array.phpt index 31acfb3ad118..b1322de040d0 100644 --- a/ext/bcmath/tests/number/operators/calc_array.phpt +++ b/ext/bcmath/tests/number/operators/calc_array.phpt @@ -10,43 +10,43 @@ $array = [1]; try { $num + $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $array; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + array -Unsupported operand types: BcMath\Number - array -Unsupported operand types: BcMath\Number * array -Unsupported operand types: BcMath\Number / array -Unsupported operand types: BcMath\Number % array -Unsupported operand types: BcMath\Number ** array +TypeError: Unsupported operand types: BcMath\Number + array +TypeError: Unsupported operand types: BcMath\Number - array +TypeError: Unsupported operand types: BcMath\Number * array +TypeError: Unsupported operand types: BcMath\Number / array +TypeError: Unsupported operand types: BcMath\Number % array +TypeError: Unsupported operand types: BcMath\Number ** array diff --git a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt index d9fe499d921d..05720638f7eb 100644 --- a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt +++ b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt @@ -9,43 +9,43 @@ $num = new BcMath\Number(100); try { $num + 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** 'a'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number -Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number +ValueError: Right string operand cannot be converted to BcMath\Number diff --git a/ext/bcmath/tests/number/operators/calc_null.phpt b/ext/bcmath/tests/number/operators/calc_null.phpt index a5745dc5e762..301ec7c70dce 100644 --- a/ext/bcmath/tests/number/operators/calc_null.phpt +++ b/ext/bcmath/tests/number/operators/calc_null.phpt @@ -9,43 +9,43 @@ $num = new BcMath\Number(100); try { $num + null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** null; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + null -Unsupported operand types: BcMath\Number - null -Unsupported operand types: BcMath\Number * null -Unsupported operand types: BcMath\Number / null -Unsupported operand types: BcMath\Number % null -Unsupported operand types: BcMath\Number ** null +TypeError: Unsupported operand types: BcMath\Number + null +TypeError: Unsupported operand types: BcMath\Number - null +TypeError: Unsupported operand types: BcMath\Number * null +TypeError: Unsupported operand types: BcMath\Number / null +TypeError: Unsupported operand types: BcMath\Number % null +TypeError: Unsupported operand types: BcMath\Number ** null diff --git a/ext/bcmath/tests/number/operators/calc_other_class.phpt b/ext/bcmath/tests/number/operators/calc_other_class.phpt index 5c6a11747def..2c43340feac7 100644 --- a/ext/bcmath/tests/number/operators/calc_other_class.phpt +++ b/ext/bcmath/tests/number/operators/calc_other_class.phpt @@ -10,43 +10,43 @@ $other = new stdClass(); try { $num + $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $other; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: BcMath\Number + stdClass -Unsupported operand types: BcMath\Number - stdClass -Unsupported operand types: BcMath\Number * stdClass -Unsupported operand types: BcMath\Number / stdClass -Unsupported operand types: BcMath\Number % stdClass -Unsupported operand types: BcMath\Number ** stdClass +TypeError: Unsupported operand types: BcMath\Number + stdClass +TypeError: Unsupported operand types: BcMath\Number - stdClass +TypeError: Unsupported operand types: BcMath\Number * stdClass +TypeError: Unsupported operand types: BcMath\Number / stdClass +TypeError: Unsupported operand types: BcMath\Number % stdClass +TypeError: Unsupported operand types: BcMath\Number ** stdClass diff --git a/ext/bcmath/tests/number/operators/calc_undef.phpt b/ext/bcmath/tests/number/operators/calc_undef.phpt index f7b188a8d211..fdde7613cdd0 100644 --- a/ext/bcmath/tests/number/operators/calc_undef.phpt +++ b/ext/bcmath/tests/number/operators/calc_undef.phpt @@ -9,54 +9,54 @@ $num = new BcMath\Number(100); try { $num + $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num - $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num * $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num ** $undef; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number + null +TypeError: Unsupported operand types: BcMath\Number + null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number - null +TypeError: Unsupported operand types: BcMath\Number - null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number * null +TypeError: Unsupported operand types: BcMath\Number * null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number / null +TypeError: Unsupported operand types: BcMath\Number / null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number % null +TypeError: Unsupported operand types: BcMath\Number % null Warning: Undefined variable $undef in %s -Unsupported operand types: BcMath\Number ** null +TypeError: Unsupported operand types: BcMath\Number ** null diff --git a/ext/bcmath/tests/number/operators/div_by_zero.phpt b/ext/bcmath/tests/number/operators/div_by_zero.phpt index cadac7361a2f..684cc133fa28 100644 --- a/ext/bcmath/tests/number/operators/div_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/div_by_zero.phpt @@ -9,19 +9,19 @@ $num = new BcMath\Number(100); try { $num / 0; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / '0'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / (new BcMath\Number(0)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $zero = new BcMath\Number(0); @@ -29,25 +29,25 @@ $zero = new BcMath\Number(0); try { 100 / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { '100' / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num / $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Division by zero -Division by zero -Division by zero -Division by zero -Division by zero -Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/bcmath/tests/number/operators/mod_by_zero.phpt b/ext/bcmath/tests/number/operators/mod_by_zero.phpt index 9c1e08f6a4dc..56382255e0f7 100644 --- a/ext/bcmath/tests/number/operators/mod_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/mod_by_zero.phpt @@ -9,19 +9,19 @@ $num = new BcMath\Number(100); try { $num % 0; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % '0'; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % (new BcMath\Number(0)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $zero = new BcMath\Number(0); @@ -29,25 +29,25 @@ $zero = new BcMath\Number(0); try { 100 % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { '100' % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num % $zero; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero -Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt index ff03626fca60..aa0f32de49f8 100644 --- a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt +++ b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt @@ -21,21 +21,21 @@ foreach ($values as $value) { try { $num ** $exponent; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -3: int -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: string -Negative power of zero +DivisionByZeroError: Negative power of zero 0 ** -2: object -Negative power of zero +DivisionByZeroError: Negative power of zero diff --git a/ext/bcmath/tests/number/properties_unknown.phpt b/ext/bcmath/tests/number/properties_unknown.phpt index cd1c13eb0c74..9a9bc6c461a9 100644 --- a/ext/bcmath/tests/number/properties_unknown.phpt +++ b/ext/bcmath/tests/number/properties_unknown.phpt @@ -12,7 +12,7 @@ var_dump($num->foo); try { $num->foo = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($num->foo); @@ -20,7 +20,7 @@ var_dump($num->foo); try { $num->bar = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($num->foo)); @@ -28,9 +28,9 @@ var_dump(isset($num->foo)); --EXPECTF-- Warning: Undefined property: BcMath\Number::$foo in %s NULL -Cannot create dynamic property BcMath\Number::$foo +Error: Cannot create dynamic property BcMath\Number::$foo Warning: Undefined property: BcMath\Number::$foo in %s NULL -Cannot create dynamic property BcMath\Number::$bar +Error: Cannot create dynamic property BcMath\Number::$bar bool(false) diff --git a/ext/bcmath/tests/number/properties_unset.phpt b/ext/bcmath/tests/number/properties_unset.phpt index ce21350240bb..052764b10d38 100644 --- a/ext/bcmath/tests/number/properties_unset.phpt +++ b/ext/bcmath/tests/number/properties_unset.phpt @@ -9,15 +9,15 @@ $num = new BcMath\Number(1); try { unset($num->value); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($num->scale); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot unset readonly property BcMath\Number::$value -Cannot unset readonly property BcMath\Number::$scale +Error: Cannot unset readonly property BcMath\Number::$value +Error: Cannot unset readonly property BcMath\Number::$scale diff --git a/ext/bcmath/tests/number/properties_write_error.phpt b/ext/bcmath/tests/number/properties_write_error.phpt index 03683c4c0926..673bddd8c6ac 100644 --- a/ext/bcmath/tests/number/properties_write_error.phpt +++ b/ext/bcmath/tests/number/properties_write_error.phpt @@ -9,15 +9,15 @@ $num = new BcMath\Number(1); try { $num->value = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $num->scale = 1; } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value -Cannot modify readonly property BcMath\Number::$scale +Error: Cannot modify readonly property BcMath\Number::$value +Error: Cannot modify readonly property BcMath\Number::$scale diff --git a/ext/bcmath/tests/number/unserialize_error.phpt b/ext/bcmath/tests/number/unserialize_error.phpt index 030ba1232d06..f0338f62fb64 100644 --- a/ext/bcmath/tests/number/unserialize_error.phpt +++ b/ext/bcmath/tests/number/unserialize_error.phpt @@ -8,7 +8,7 @@ try { $num = new BcMath\Number(1); $num->__unserialize(['value' => '5']); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -23,14 +23,14 @@ foreach ($cases as $case) { try { unserialize($case); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Cannot modify readonly property BcMath\Number::$value +Error: Cannot modify readonly property BcMath\Number::$value -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object -Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object +Exception: Invalid serialization data for BcMath\Number object diff --git a/ext/bcmath/tests/sec_embedded_null_truncation.phpt b/ext/bcmath/tests/sec_embedded_null_truncation.phpt index 157810ecbb3a..8606abd6aa3a 100644 --- a/ext/bcmath/tests/sec_embedded_null_truncation.phpt +++ b/ext/bcmath/tests/sec_embedded_null_truncation.phpt @@ -27,33 +27,33 @@ foreach ($cases as $s) { $fn($s); echo "FAIL: accepted\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } ?> --EXPECT-- -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcsub(): Argument #1 ($num1) is not well-formed -bcmul(): Argument #1 ($num1) is not well-formed -bcdiv(): Argument #1 ($num1) is not well-formed -bcmod(): Argument #1 ($num1) is not well-formed -bcpow(): Argument #1 ($num) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcsub(): Argument #1 ($num1) is not well-formed +ValueError: bcmul(): Argument #1 ($num1) is not well-formed +ValueError: bcdiv(): Argument #1 ($num1) is not well-formed +ValueError: bcmod(): Argument #1 ($num1) is not well-formed +ValueError: bcpow(): Argument #1 ($num) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bcsqrt(): Argument #1 ($num) is not well-formed diff --git a/ext/bcmath/tests/str2num_formatting.phpt b/ext/bcmath/tests/str2num_formatting.phpt index 4b77381de868..61c81b17ca6b 100644 --- a/ext/bcmath/tests/str2num_formatting.phpt +++ b/ext/bcmath/tests/str2num_formatting.phpt @@ -19,37 +19,37 @@ echo "\n"; try { echo bcadd(" 0", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1e1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1,1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("Hello", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1 1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bcadd("1.a", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n"; @@ -65,31 +65,31 @@ echo "\n"; try { echo bccomp(" 0", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1e1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1,1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("Hello", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo bccomp("1 1", "2"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -100,12 +100,12 @@ try { 2 2 -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed -bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed +ValueError: bcadd(): Argument #1 ($num1) is not well-formed -1 -1 @@ -113,8 +113,8 @@ bcadd(): Argument #1 ($num1) is not well-formed -1 -1 -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed -bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed +ValueError: bccomp(): Argument #1 ($num1) is not well-formed diff --git a/ext/bz2/tests/001.phpt b/ext/bz2/tests/001.phpt index 6323a224c3ac..31a8c1ea8bce 100644 --- a/ext/bz2/tests/001.phpt +++ b/ext/bz2/tests/001.phpt @@ -8,31 +8,31 @@ bz2 try { var_dump(bzopen("", "r")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bzopen("", "w")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bzopen("no_such_file", "")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bzopen("no_such_file", "x")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bzopen("no_such_file", "rw")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(bzopen("no_such_file", "r")); @@ -42,11 +42,11 @@ var_dump(bzopen($fp, "r")); ?> --EXPECTF-- -bzopen(): Argument #1 ($file) must not be empty -bzopen(): Argument #1 ($file) must not be empty -bzopen(): Argument #2 ($mode) must be either "r" or "w" -bzopen(): Argument #2 ($mode) must be either "r" or "w" -bzopen(): Argument #2 ($mode) must be either "r" or "w" +ValueError: bzopen(): Argument #1 ($file) must not be empty +ValueError: bzopen(): Argument #1 ($file) must not be empty +ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w" +ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w" +ValueError: bzopen(): Argument #2 ($mode) must be either "r" or "w" Warning: bzopen(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/bz2/tests/002.phpt b/ext/bz2/tests/002.phpt index 7210f90a4d92..105fa0b4f57e 100644 --- a/ext/bz2/tests/002.phpt +++ b/ext/bz2/tests/002.phpt @@ -31,14 +31,14 @@ $fp = fopen("bz_open_002.txt", "br"); try { var_dump(bzopen($fp, "r")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $fp = fopen("bz_open_002.txt", "br"); try { var_dump(bzopen($fp, "w")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $fp = fopen("bz_open_002.txt", "r"); @@ -91,10 +91,10 @@ resource(%d) of type (stream) resource(%d) of type (stream) Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d -bzopen(): Argument #1 ($file) must be of type string or file-resource, false given +TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given Warning: fopen(): Failed to open stream: `br' is not a valid mode for fopen in %s on line %d -bzopen(): Argument #1 ($file) must be of type string or file-resource, false given +TypeError: bzopen(): Argument #1 ($file) must be of type string or file-resource, false given Warning: bzopen(): cannot write to a stream opened in read only mode in %s on line %d bool(false) diff --git a/ext/bz2/tests/003-mb.phpt b/ext/bz2/tests/003-mb.phpt index 3189b473a4ac..805cc150e1ed 100644 --- a/ext/bz2/tests/003-mb.phpt +++ b/ext/bz2/tests/003-mb.phpt @@ -11,7 +11,7 @@ var_dump(bzread($fd, 0)); try { var_dump(bzread($fd, -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(bzread($fd, 1)); @@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000)); ?> --EXPECT-- string(0) "" -bzread(): Argument #2 ($length) must be greater than or equal to 0 +ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0 string(1) "R" string(2) "is" string(251) "ing up from the heart of the desert diff --git a/ext/bz2/tests/003.phpt b/ext/bz2/tests/003.phpt index 4b6ee820dd56..f737422a074c 100644 --- a/ext/bz2/tests/003.phpt +++ b/ext/bz2/tests/003.phpt @@ -11,7 +11,7 @@ var_dump(bzread($fd, 0)); try { var_dump(bzread($fd, -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(bzread($fd, 1)); @@ -21,7 +21,7 @@ var_dump(bzread($fd, 100000)); ?> --EXPECT-- string(0) "" -bzread(): Argument #2 ($length) must be greater than or equal to 0 +ValueError: bzread(): Argument #2 ($length) must be greater than or equal to 0 string(1) "R" string(2) "is" string(251) "ing up from the heart of the desert diff --git a/ext/bz2/tests/004.phpt b/ext/bz2/tests/004.phpt index 240cef37a17a..910aa067f6b4 100644 --- a/ext/bz2/tests/004.phpt +++ b/ext/bz2/tests/004.phpt @@ -39,22 +39,22 @@ bzclose($fd2); try { var_dump(bzread($fd2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(bzerror($fd2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(bzerrstr($fd2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(bzerrno($fd2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -112,8 +112,8 @@ array(2) { } string(10) "DATA_ERROR" int(-4) -bzread(): Argument #1 ($bz) must be an open stream resource -bzerror(): Argument #1 ($bz) must be an open stream resource -bzerrstr(): Argument #1 ($bz) must be an open stream resource -bzerrno(): Argument #1 ($bz) must be an open stream resource +TypeError: bzread(): Argument #1 ($bz) must be an open stream resource +TypeError: bzerror(): Argument #1 ($bz) must be an open stream resource +TypeError: bzerrstr(): Argument #1 ($bz) must be an open stream resource +TypeError: bzerrno(): Argument #1 ($bz) must be an open stream resource Done diff --git a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt index a9fd3a211869..03b8e09c6547 100644 --- a/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt +++ b/ext/bz2/tests/bzerr_functions_on_invalid_stream.phpt @@ -8,20 +8,20 @@ $f = fopen(__FILE__, 'r'); try { var_dump(bzerrno($f)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(bzerrstr($f)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(bzerror($f)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -bzerrno(): Argument #1 ($bz) must be a bz2 stream -bzerrstr(): Argument #1 ($bz) must be a bz2 stream -bzerror(): Argument #1 ($bz) must be a bz2 stream +TypeError: bzerrno(): Argument #1 ($bz) must be a bz2 stream +TypeError: bzerrstr(): Argument #1 ($bz) must be a bz2 stream +TypeError: bzerror(): Argument #1 ($bz) must be a bz2 stream diff --git a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt index b76515a178d9..6f47c2fa237c 100644 --- a/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt +++ b/ext/bz2/tests/bzopen_string_filename_with_null_bytes.phpt @@ -8,16 +8,16 @@ bz2 try { bzopen("file\0", "w"); } catch (TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bzopen("file\0", "r"); } catch (TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bzopen(): Argument #1 ($file) must not contain null bytes -bzopen(): Argument #1 ($file) must not contain null bytes +TypeError: bzopen(): Argument #1 ($file) must not contain null bytes +TypeError: bzopen(): Argument #1 ($file) must not contain null bytes diff --git a/ext/calendar/tests/bug80185.phpt b/ext/calendar/tests/bug80185.phpt index d52f9696a173..44b9df86ac0c 100644 --- a/ext/calendar/tests/bug80185.phpt +++ b/ext/calendar/tests/bug80185.phpt @@ -13,10 +13,10 @@ var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440588))); try { var_dump(jdtounix((int)(PHP_INT_MAX / 86400 + 2440589))); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- int(2170713600) int(9223372036854720000) -jday must be between 2440588 and 106751993607888 +ValueError: jday must be between 2440588 and 106751993607888 diff --git a/ext/calendar/tests/cal_days_in_month_error1.phpt b/ext/calendar/tests/cal_days_in_month_error1.phpt index e110c13cc2a7..dcf7db51ec0b 100644 --- a/ext/calendar/tests/cal_days_in_month_error1.phpt +++ b/ext/calendar/tests/cal_days_in_month_error1.phpt @@ -9,14 +9,14 @@ calendar try { cal_days_in_month(-1, 4, 2017); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try{ cal_days_in_month(CAL_GREGORIAN,20, 2009); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID -Invalid date +ValueError: cal_days_in_month(): Argument #1 ($calendar) must be a valid calendar ID +ValueError: Invalid date diff --git a/ext/calendar/tests/cal_from_jd_error1.phpt b/ext/calendar/tests/cal_from_jd_error1.phpt index 3b4e11b8350d..80731b867647 100644 --- a/ext/calendar/tests/cal_from_jd_error1.phpt +++ b/ext/calendar/tests/cal_from_jd_error1.phpt @@ -9,8 +9,8 @@ calendar try { cal_from_jd(1748326, -1); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID +ValueError: cal_from_jd(): Argument #2 ($calendar) must be a valid calendar ID diff --git a/ext/calendar/tests/cal_info.phpt b/ext/calendar/tests/cal_info.phpt index 18884917e534..1990c1ccbd6d 100644 --- a/ext/calendar/tests/cal_info.phpt +++ b/ext/calendar/tests/cal_info.phpt @@ -11,7 +11,7 @@ calendar try { cal_info(99999); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- @@ -216,4 +216,4 @@ Array [calname] => Julian [calsymbol] => CAL_JULIAN ) -cal_info(): Argument #1 ($calendar) must be a valid calendar ID +ValueError: cal_info(): Argument #1 ($calendar) must be a valid calendar ID diff --git a/ext/calendar/tests/cal_to_jd_error1.phpt b/ext/calendar/tests/cal_to_jd_error1.phpt index 1cef36af69fe..18ab699de1d7 100644 --- a/ext/calendar/tests/cal_to_jd_error1.phpt +++ b/ext/calendar/tests/cal_to_jd_error1.phpt @@ -9,8 +9,8 @@ calendar try { cal_to_jd(-1, 8, 26, 74); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID +ValueError: cal_to_jd(): Argument #1 ($calendar) must be a valid calendar ID diff --git a/ext/calendar/tests/easter_date_64bit.phpt b/ext/calendar/tests/easter_date_64bit.phpt index 3939b7e4a4d4..f6d97ba9f20f 100644 --- a/ext/calendar/tests/easter_date_64bit.phpt +++ b/ext/calendar/tests/easter_date_64bit.phpt @@ -20,14 +20,14 @@ echo date("Y-m-d", easter_date(2047))."\n"; try { easter_date(1492); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -2000-04-23 -2001-04-15 -2002-03-31 -2045-04-09 -2046-03-25 -2047-04-14 -easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive) +2000-04-23 +2001-04-15 +2002-03-31 +2045-04-09 +2046-03-25 +2047-04-14 +ValueError: easter_date(): Argument #1 ($year) must be a year after 1970 (inclusive) diff --git a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt index 2c7afbdfa2d9..c2177673ffee 100644 --- a/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt +++ b/ext/calendar/tests/easter_date_checks_upper_bound_64bit.phpt @@ -14,8 +14,8 @@ putenv('TZ=UTC'); try { easter_date(293274701009); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive) +ValueError: easter_date(): Argument #1 ($year) must be a year before 2.000.000.000 (inclusive) diff --git a/ext/calendar/tests/gh16228.phpt b/ext/calendar/tests/gh16228.phpt index 9ce80688195b..0699152566fe 100644 --- a/ext/calendar/tests/gh16228.phpt +++ b/ext/calendar/tests/gh16228.phpt @@ -7,20 +7,20 @@ calendar try { easter_days(PHP_INT_MAX, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { easter_days(-1, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { easter_date(PHP_INT_MAX, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -easter_days(): Argument #1 ($year) must be between 1 and %d -easter_days(): Argument #1 ($year) must be between 1 and %d -easter_date(): Argument #1 ($year) must be between 1 and %d +ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d +ValueError: easter_days(): Argument #1 ($year) must be between 1 and %d +ValueError: easter_date(): Argument #1 ($year) must be between 1 and %d diff --git a/ext/calendar/tests/gh16231.phpt b/ext/calendar/tests/gh16231.phpt index 89b09dd3f63a..d003f38b1f06 100644 --- a/ext/calendar/tests/gh16231.phpt +++ b/ext/calendar/tests/gh16231.phpt @@ -7,15 +7,15 @@ calendar try { jdtounix(PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { jdtounix(240587); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -jday must be between 2440588 and %d -jday must be between 2440588 and %d +ValueError: jday must be between 2440588 and %d +ValueError: jday must be between 2440588 and %d diff --git a/ext/calendar/tests/gh16234_2_64.phpt b/ext/calendar/tests/gh16234_2_64.phpt index 7da254609650..166e67a0efaf 100644 --- a/ext/calendar/tests/gh16234_2_64.phpt +++ b/ext/calendar/tests/gh16234_2_64.phpt @@ -13,9 +13,8 @@ if (PHP_INT_SIZE == 4) { try { jewishtojd(10, 6, PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -jewishtojd(): Argument #3 ($year) must be between %i and %d - +ValueError: jewishtojd(): Argument #3 ($year) must be between %i and %d diff --git a/ext/calendar/tests/gh19371.phpt b/ext/calendar/tests/gh19371.phpt index 1d807a983886..b2b4837851cb 100644 --- a/ext/calendar/tests/gh19371.phpt +++ b/ext/calendar/tests/gh19371.phpt @@ -10,52 +10,52 @@ calendar try { echo cal_days_in_month(CAL_GREGORIAN, 12, PHP_INT_MAX); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MIN, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_days_in_month(CAL_GREGORIAN, PHP_INT_MAX, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MIN, 1, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_to_jd(CAL_GREGORIAN, PHP_INT_MAX, 1, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MIN, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_to_jd(CAL_GREGORIAN, 1, PHP_INT_MAX, 1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo cal_to_jd(CAL_GREGORIAN, 1, 1, PHP_INT_MAX); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -cal_days_in_month(): Argument #3 ($year) must be less than 2147483646 -cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646 -cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646 -cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646 -cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646 -cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647 -cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647 -cal_to_jd(): Argument #4 ($year) must be less than 2147483646 +ValueError: cal_days_in_month(): Argument #3 ($year) must be less than 2147483646 +ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646 +ValueError: cal_days_in_month(): Argument #2 ($month) must be between 1 and 2147483646 +ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646 +ValueError: cal_to_jd(): Argument #2 ($month) must be between 1 and 2147483646 +ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647 +ValueError: cal_to_jd(): Argument #3 ($day) must be between -2147483648 and 2147483647 +ValueError: cal_to_jd(): Argument #4 ($year) must be less than 2147483646 diff --git a/ext/calendar/tests/jdtojewish.phpt b/ext/calendar/tests/jdtojewish.phpt index 6b1c2e3f7756..ba40a2056da5 100644 --- a/ext/calendar/tests/jdtojewish.phpt +++ b/ext/calendar/tests/jdtojewish.phpt @@ -23,7 +23,7 @@ echo jdtojewish(gregoriantojd(1,1,9998)) . "\n"; try { jdtojewish(gregoriantojd(1,1,9998),true); } catch (ValueError $ex) { - echo "{$ex->getMessage()}\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- @@ -42,4 +42,4 @@ string(%d) "2/22/5763 2/30/5763 3/16/5765 3/8/13758 -Year out of range (0-9999) +ValueError: Year out of range (0-9999) diff --git a/ext/calendar/tests/jdtojewish_hebrew.phpt b/ext/calendar/tests/jdtojewish_hebrew.phpt index ceb53c219e71..3909162e1bf4 100644 --- a/ext/calendar/tests/jdtojewish_hebrew.phpt +++ b/ext/calendar/tests/jdtojewish_hebrew.phpt @@ -46,4 +46,3 @@ e020f1e9e5ef20e4e0 e020faeee5e620e4e0 e020e0e120e4e0 e020e0ece5ec20e4e0 - diff --git a/ext/calendar/tests/jdtounix_error1.phpt b/ext/calendar/tests/jdtounix_error1.phpt index 0032e376db3c..adad98947dcd 100644 --- a/ext/calendar/tests/jdtounix_error1.phpt +++ b/ext/calendar/tests/jdtounix_error1.phpt @@ -11,8 +11,8 @@ calendar try { jdtounix(2440579); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECTF-- -jday must be between 2440588 and %d +ValueError: jday must be between 2440588 and %d diff --git a/ext/calendar/tests/unixtojd_error1.phpt b/ext/calendar/tests/unixtojd_error1.phpt index 171d400b99e7..a17a5b291a05 100644 --- a/ext/calendar/tests/unixtojd_error1.phpt +++ b/ext/calendar/tests/unixtojd_error1.phpt @@ -13,12 +13,12 @@ putenv('TZ=UTC'); try { unixtojd(-1); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } var_dump(unixtojd(null)) . PHP_EOL; var_dump(unixtojd(time())) . PHP_EOL; ?> --EXPECTF-- -unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0 +ValueError: unixtojd(): Argument #1 ($timestamp) must be greater than or equal to 0 int(%d) int(%d) diff --git a/ext/curl/tests/bug48207.phpt b/ext/curl/tests/bug48207.phpt index 086f949ff63d..e312a09b6198 100644 --- a/ext/curl/tests/bug48207.phpt +++ b/ext/curl/tests/bug48207.phpt @@ -39,7 +39,7 @@ $ch = curl_init($url); try { curl_setopt($ch, CURLOPT_FILE, $fp); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } curl_exec($ch); @@ -47,6 +47,6 @@ is_file($tempfile) and @unlink($tempfile); isset($tempname) and is_file($tempname) and @unlink($tempname); ?> --EXPECT-- -curl_setopt(): The provided file handle must be writable +ValueError: curl_setopt(): The provided file handle must be writable Hello World! Hello World! diff --git a/ext/curl/tests/bug68089.phpt b/ext/curl/tests/bug68089.phpt index b8733c5066b8..b869745e1add 100644 --- a/ext/curl/tests/bug68089.phpt +++ b/ext/curl/tests/bug68089.phpt @@ -10,11 +10,11 @@ $ch = curl_init(); try { curl_setopt($ch, CURLOPT_URL, $url); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> Done --EXPECT-- -curl_setopt(): cURL option must not contain any null bytes +ValueError: curl_setopt(): cURL option must not contain any null bytes Done diff --git a/ext/curl/tests/bug73147.phpt b/ext/curl/tests/bug73147.phpt index b0f01e64e31d..4561785cb999 100644 --- a/ext/curl/tests/bug73147.phpt +++ b/ext/curl/tests/bug73147.phpt @@ -8,8 +8,8 @@ $poc = 'a:1:{i:0;O:8:"CURLFile":1:{s:4:"name";R:1;}}'; try { var_dump(unserialize($poc)); } catch(Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Unserialization of 'CURLFile' is not allowed +Exception: Unserialization of 'CURLFile' is not allowed diff --git a/ext/curl/tests/bug80121.phpt b/ext/curl/tests/bug80121.phpt index a7bf6385367d..d750856f06ec 100644 --- a/ext/curl/tests/bug80121.phpt +++ b/ext/curl/tests/bug80121.phpt @@ -8,21 +8,21 @@ curl try { new CurlHandle; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new CurlMultiHandle; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new CurlShareHandle; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot directly construct CurlHandle, use curl_init() instead -Cannot directly construct CurlMultiHandle, use curl_multi_init() instead -Cannot directly construct CurlShareHandle, use curl_share_init() instead +Error: Cannot directly construct CurlHandle, use curl_init() instead +Error: Cannot directly construct CurlMultiHandle, use curl_multi_init() instead +Error: Cannot directly construct CurlShareHandle, use curl_share_init() instead diff --git a/ext/curl/tests/curl_file_upload.phpt b/ext/curl/tests/curl_file_upload.phpt index 8b85190ff41e..732d626c664b 100644 --- a/ext/curl/tests/curl_file_upload.phpt +++ b/ext/curl/tests/curl_file_upload.phpt @@ -45,7 +45,7 @@ var_dump(curl_exec($ch)); try { curl_setopt($ch, CURLOPT_SAFE_UPLOAD, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $params = array('file' => '@' . __DIR__ . '/curl_testdata1.txt'); @@ -72,7 +72,7 @@ string(%d) "%s/curl_testdata1.txt" string(%d) "curl_testdata1.txt|text/plain|6" string(%d) "foo.txt" string(%d) "foo.txt|application/octet-stream|6" -curl_setopt(): Disabling safe uploads is no longer supported +ValueError: curl_setopt(): Disabling safe uploads is no longer supported string(0) "" string(0) "" string(%d) "array(1) { diff --git a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt index 4a90b0a3c52e..be671e73ef3c 100644 --- a/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt +++ b/ext/curl/tests/curl_getinfo_CURLINFO_CONN_ID.phpt @@ -143,4 +143,3 @@ bool(true) bool(true) bool(true) bool(true) - diff --git a/ext/curl/tests/curl_multi_errno_strerror_001.phpt b/ext/curl/tests/curl_multi_errno_strerror_001.phpt index 80ec44c4c247..9bb9b168f828 100644 --- a/ext/curl/tests/curl_multi_errno_strerror_001.phpt +++ b/ext/curl/tests/curl_multi_errno_strerror_001.phpt @@ -13,7 +13,7 @@ echo curl_multi_strerror($errno) . PHP_EOL; try { curl_multi_setopt($mh, -1, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $errno = curl_multi_errno($mh); @@ -23,6 +23,6 @@ echo curl_multi_strerror($errno) . PHP_EOL; --EXPECT-- 0 No error -curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option +ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option 6 Unknown option diff --git a/ext/curl/tests/curl_multi_setopt_basic001.phpt b/ext/curl/tests/curl_multi_setopt_basic001.phpt index 71d176c0a109..479ae758e0c2 100644 --- a/ext/curl/tests/curl_multi_setopt_basic001.phpt +++ b/ext/curl/tests/curl_multi_setopt_basic001.phpt @@ -11,10 +11,10 @@ var_dump(curl_multi_setopt($mh, CURLMOPT_PIPELINING, 0)); try { curl_multi_setopt($mh, -1, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option +ValueError: curl_multi_setopt(): Argument #2 ($option) is not a valid cURL multi option diff --git a/ext/curl/tests/curl_persistent_share_003.phpt b/ext/curl/tests/curl_persistent_share_003.phpt index 60a30de4d464..0ed7dfd22e97 100644 --- a/ext/curl/tests/curl_persistent_share_003.phpt +++ b/ext/curl/tests/curl_persistent_share_003.phpt @@ -8,9 +8,9 @@ curl try { $sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_CONNECT, 30]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants +ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must contain only CURL_LOCK_DATA_* constants diff --git a/ext/curl/tests/curl_persistent_share_004.phpt b/ext/curl/tests/curl_persistent_share_004.phpt index fe0e7ec2cf0e..ffd58abc0172 100644 --- a/ext/curl/tests/curl_persistent_share_004.phpt +++ b/ext/curl/tests/curl_persistent_share_004.phpt @@ -8,9 +8,9 @@ curl try { $sh = curl_share_init_persistent([CURL_LOCK_DATA_COOKIE]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe +ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not contain CURL_LOCK_DATA_COOKIE because sharing cookies across PHP requests is unsafe diff --git a/ext/curl/tests/curl_persistent_share_005.phpt b/ext/curl/tests/curl_persistent_share_005.phpt index 8737ba6c39a4..7b7403a76f3b 100644 --- a/ext/curl/tests/curl_persistent_share_005.phpt +++ b/ext/curl/tests/curl_persistent_share_005.phpt @@ -10,9 +10,9 @@ $sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS]); try { curl_share_setopt($sh, CURLOPT_SHARE, CURL_LOCK_DATA_CONNECT); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given +TypeError: curl_share_setopt(): Argument #1 ($share_handle) must be of type CurlShareHandle, CurlSharePersistentHandle given diff --git a/ext/curl/tests/curl_persistent_share_006.phpt b/ext/curl/tests/curl_persistent_share_006.phpt index ffca764757fb..8921ddba8903 100644 --- a/ext/curl/tests/curl_persistent_share_006.phpt +++ b/ext/curl/tests/curl_persistent_share_006.phpt @@ -8,9 +8,9 @@ curl try { $sh = curl_share_init_persistent([]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -curl_share_init_persistent(): Argument #1 ($share_options) must not be empty +ValueError: curl_share_init_persistent(): Argument #1 ($share_options) must not be empty diff --git a/ext/curl/tests/curl_seekfunction_error.phpt b/ext/curl/tests/curl_seekfunction_error.phpt index 134e8115dc5f..31808d78a3c8 100644 --- a/ext/curl/tests/curl_seekfunction_error.phpt +++ b/ext/curl/tests/curl_seekfunction_error.phpt @@ -31,14 +31,14 @@ echo "Returning a non-int:\n"; try { run_upload($host, fn($ch, $offset, $origin) => 'not an int'); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nReturning an out-of-range int:\n"; try { run_upload($host, fn($ch, $offset, $origin) => 42); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nThrowing from the callback:\n"; @@ -47,7 +47,7 @@ try { throw new \RuntimeException('boom from seek'); }); } catch (\RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nSetting the callback to null:\n"; @@ -57,21 +57,21 @@ echo "\nSetting a non-callable scalar:\n"; try { curl_setopt(curl_init(), CURLOPT_SEEKFUNCTION, 42); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Returning a non-int: -The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK +TypeError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK Returning an out-of-range int: -The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK +ValueError: The CURLOPT_SEEKFUNCTION callback must return one of CURL_SEEKFUNC_OK, CURL_SEEKFUNC_FAIL or CURL_SEEKFUNC_CANTSEEK Throwing from the callback: -boom from seek +RuntimeException: boom from seek Setting the callback to null: bool(true) Setting a non-callable scalar: -curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given +TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_SEEKFUNCTION, no array or string given diff --git a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt index 7193642dcab0..b523acc1648b 100644 --- a/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt +++ b/ext/curl/tests/curl_setopt_CURLOPT_DEBUGFUNCTION.phpt @@ -87,14 +87,14 @@ try { var_dump(curl_setopt($ch, CURLINFO_HEADER_OUT, true)); } catch (\ValueError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } $chCopy = curl_copy_handle($ch); try { var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true)); } catch (\ValueError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(curl_setopt($chCopy, CURLOPT_DEBUGFUNCTION, null)); var_dump(curl_setopt($chCopy, CURLINFO_HEADER_OUT, true)); @@ -138,7 +138,7 @@ try { var_dump($result = curl_exec($ch)); } catch (\RuntimeException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(curl_getinfo($ch, CURLINFO_HEADER_OUT)); @@ -183,8 +183,8 @@ bool(true) bool(true) bool(true) bool(true) -string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set" -string(87) "CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set" +ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set +ValueError: CURLINFO_HEADER_OUT option must not be set when the CURLOPT_DEBUGFUNCTION option is set bool(true) bool(true) @@ -216,7 +216,7 @@ Accept: */* ===Test CURLOPT_DEBUGFUNCTION can throw within callback=== bool(true) -string(41) "This should get caught after verbose=true" +RuntimeException: This should get caught after verbose=true string(%d) "GET /get.inc?test=file HTTP/%s Host: %s:%d Accept: */* diff --git a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt index 39a1d1e3caa8..8f507a6c8fd9 100644 --- a/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt +++ b/ext/curl/tests/curl_setopt_CURLOPT_PREREQFUNCTION.phpt @@ -73,7 +73,7 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) { try { curl_exec($ch); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\nTesting with invalid type\n"; @@ -83,7 +83,7 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) { try { curl_exec($ch); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\nTesting with invalid value\n"; @@ -93,21 +93,21 @@ curl_setopt($ch, CURLOPT_PREREQFUNCTION, function() use ($port) { try { curl_exec($ch); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\nTesting with invalid option value\n"; try { curl_setopt($ch, CURLOPT_PREREQFUNCTION, 42); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\nTesting with invalid option callback\n"; try { curl_setopt($ch, CURLOPT_PREREQFUNCTION, 'function_does_not_exist'); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\nTesting with null as the callback\n"; @@ -161,19 +161,19 @@ string(0) "" int(0) Testing with no return type -The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT +TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT Testing with invalid type -The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT +TypeError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT Testing with invalid value -The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT +ValueError: The CURLOPT_PREREQFUNCTION callback must return either CURL_PREREQFUNC_OK or CURL_PREREQFUNC_ABORT Testing with invalid option value -curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given +TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, no array or string given Testing with invalid option callback -curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name +TypeError: curl_setopt(): Argument #3 ($value) must be a valid callback for option CURLOPT_PREREQFUNCTION, function "function_does_not_exist" not found or invalid function name Testing with null as the callback bool(true) diff --git a/ext/curl/tests/curl_setopt_basic003.phpt b/ext/curl/tests/curl_setopt_basic003.phpt index 008162c9b474..daeac6b07c14 100644 --- a/ext/curl/tests/curl_setopt_basic003.phpt +++ b/ext/curl/tests/curl_setopt_basic003.phpt @@ -20,7 +20,7 @@ $ch = curl_init(); try { curl_setopt($ch, CURLOPT_HTTPHEADER, 1); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $curl_content = curl_exec($ch); @@ -42,6 +42,6 @@ var_dump( $curl_content ); ?> --EXPECT-- *** curl_setopt() call with CURLOPT_HTTPHEADER -curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value +TypeError: curl_setopt(): The CURLOPT_HTTPHEADER option must have an array value bool(false) bool(true) diff --git a/ext/curl/tests/curl_setopt_error.phpt b/ext/curl/tests/curl_setopt_error.phpt index 0979cec0816d..0495d2e56dab 100644 --- a/ext/curl/tests/curl_setopt_error.phpt +++ b/ext/curl/tests/curl_setopt_error.phpt @@ -13,24 +13,24 @@ $ch = curl_init(); try { curl_setopt($ch, '', false); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { curl_setopt($ch, -10, 0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { curl_setopt($ch, 1000, 0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** curl_setopt() call with incorrect parameters -curl_setopt(): Argument #2 ($option) must be of type int, string given -curl_setopt(): Argument #2 ($option) is not a valid cURL option -curl_setopt(): Argument #2 ($option) is not a valid cURL option +TypeError: curl_setopt(): Argument #2 ($option) must be of type int, string given +ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option +ValueError: curl_setopt(): Argument #2 ($option) is not a valid cURL option diff --git a/ext/curl/tests/curl_setopt_error_nul_byte.phpt b/ext/curl/tests/curl_setopt_error_nul_byte.phpt index 23be973b82c2..8eae484b51d9 100644 --- a/ext/curl/tests/curl_setopt_error_nul_byte.phpt +++ b/ext/curl/tests/curl_setopt_error_nul_byte.phpt @@ -24,29 +24,20 @@ foreach ($list_options as $option) { try { curl_setopt($ch, constant($option), ["Something: foo\0bar"]); } catch (ValueError $exception) { - echo $option . ": " . $exception->getMessage() . "\n\n"; + echo $option, ': ', $exception::class, ': ', $exception->getMessage(), "\n"; } } $ch = null; ?> --EXPECT-- -CURLOPT_HTTP200ALIASES: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes - -CURLOPT_HTTPHEADER: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes - -CURLOPT_POSTQUOTE: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes - -CURLOPT_PREQUOTE: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes - -CURLOPT_QUOTE: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes - -CURLOPT_TELNETOPTIONS: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes - -CURLOPT_MAIL_RCPT: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes - -CURLOPT_RESOLVE: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes - -CURLOPT_PROXYHEADER: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes - -CURLOPT_CONNECT_TO: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes +CURLOPT_HTTP200ALIASES: ValueError: curl_setopt(): cURL option CURLOPT_HTTP200ALIASES must not contain any null bytes +CURLOPT_HTTPHEADER: ValueError: curl_setopt(): cURL option CURLOPT_HTTPHEADER must not contain any null bytes +CURLOPT_POSTQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_POSTQUOTE must not contain any null bytes +CURLOPT_PREQUOTE: ValueError: curl_setopt(): cURL option CURLOPT_PREQUOTE must not contain any null bytes +CURLOPT_QUOTE: ValueError: curl_setopt(): cURL option CURLOPT_QUOTE must not contain any null bytes +CURLOPT_TELNETOPTIONS: ValueError: curl_setopt(): cURL option CURLOPT_TELNETOPTIONS must not contain any null bytes +CURLOPT_MAIL_RCPT: ValueError: curl_setopt(): cURL option CURLOPT_MAIL_RCPT must not contain any null bytes +CURLOPT_RESOLVE: ValueError: curl_setopt(): cURL option CURLOPT_RESOLVE must not contain any null bytes +CURLOPT_PROXYHEADER: ValueError: curl_setopt(): cURL option CURLOPT_PROXYHEADER must not contain any null bytes +CURLOPT_CONNECT_TO: ValueError: curl_setopt(): cURL option CURLOPT_CONNECT_TO must not contain any null bytes diff --git a/ext/curl/tests/curl_share_errno_strerror_001.phpt b/ext/curl/tests/curl_share_errno_strerror_001.phpt index 6a69a3a48773..835b8a8afef2 100644 --- a/ext/curl/tests/curl_share_errno_strerror_001.phpt +++ b/ext/curl/tests/curl_share_errno_strerror_001.phpt @@ -13,7 +13,7 @@ echo curl_share_strerror($errno) . PHP_EOL; try { curl_share_setopt($sh, -1, -1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $errno = curl_share_errno($sh); @@ -23,6 +23,6 @@ echo curl_share_strerror($errno) . PHP_EOL; --EXPECT-- 0 No error -curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option +ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option 1 Unknown share option diff --git a/ext/curl/tests/curl_share_setopt_basic001.phpt b/ext/curl/tests/curl_share_setopt_basic001.phpt index d9a9c1788e88..11a5e4d1dc87 100644 --- a/ext/curl/tests/curl_share_setopt_basic001.phpt +++ b/ext/curl/tests/curl_share_setopt_basic001.phpt @@ -12,11 +12,11 @@ var_dump(curl_share_setopt($sh, CURLSHOPT_UNSHARE, CURL_LOCK_DATA_DNS)); try { curl_share_setopt($sh, -1, 0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(true) bool(true) -curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option +ValueError: curl_share_setopt(): Argument #2 ($option) is not a valid cURL share option diff --git a/ext/curl/tests/gh15547.phpt b/ext/curl/tests/gh15547.phpt index 489fdd0b999a..6b2b0521a1c6 100644 --- a/ext/curl/tests/gh15547.phpt +++ b/ext/curl/tests/gh15547.phpt @@ -10,20 +10,20 @@ $mh = curl_multi_init(); try { curl_multi_select($mh, -2500000); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } curl_multi_close($mh); $mh = curl_multi_init(); try { curl_multi_select($mh, 2500000); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } curl_multi_close($mh); $mh = curl_multi_init(); var_dump(curl_multi_select($mh, 1000000)); ?> --EXPECTF-- -curl_multi_select(): Argument #2 ($timeout) must be between %d and %f -curl_multi_select(): Argument #2 ($timeout) must be between %d and %f +ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f +ValueError: curl_multi_select(): Argument #2 ($timeout) must be between %d and %f int(0) diff --git a/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt b/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt index f8b1e1cffe43..a5ae7e11b29f 100644 --- a/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt +++ b/ext/date/tests/DatePeriod_createFromISO8601String_static_return.phpt @@ -10,13 +10,13 @@ var_dump(MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:00:00Z/P7D")); try { MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:/P7D"); } catch (DateMalformedPeriodStringException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDatePeriod::createFromISO8601String("R4/2012-07-01T00:00:00Z"); } catch (DateMalformedPeriodStringException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -65,5 +65,5 @@ object(MyDatePeriod)#1 (7) { ["include_end_date"]=> bool(false) } -Unknown or bad format (R4/2012-07-01T00:/P7D) -DatePeriod::createFromISO8601String(): ISO interval must contain an interval, "R4/2012-07-01T00:00:00Z" given +DateMalformedPeriodStringException: Unknown or bad format (R4/2012-07-01T00:/P7D) +DateMalformedPeriodStringException: DatePeriod::createFromISO8601String(): ISO interval must contain an interval, "R4/2012-07-01T00:00:00Z" given diff --git a/ext/date/tests/DatePeriod_wrong_constructor.phpt b/ext/date/tests/DatePeriod_wrong_constructor.phpt index 45f99bdb7270..eaf326f842ef 100644 --- a/ext/date/tests/DatePeriod_wrong_constructor.phpt +++ b/ext/date/tests/DatePeriod_wrong_constructor.phpt @@ -11,8 +11,8 @@ date.timezone=UTC try { new DatePeriod(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments +TypeError: DatePeriod::__construct() accepts (DateTimeInterface, DateInterval, int [, int]), or (DateTimeInterface, DateInterval, DateTime [, int]), or (string [, int]) as arguments diff --git a/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt b/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt index 31c6868d67fb..8e7a57fefe03 100644 --- a/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt +++ b/ext/date/tests/DatePeriod_wrong_recurrence_on_constructor.phpt @@ -5,16 +5,16 @@ DatePeriod: Test wrong recurrence parameter on __construct try { new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), 0); } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { new DatePeriod(new DateTime('yesterday'), new DateInterval('P1D'), -1); } catch (Exception $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- -DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d -DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d +DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d +DateMalformedPeriodStringException: DatePeriod::__construct(): Recurrence count must be greater or equal to 1 and lower than %d diff --git a/ext/date/tests/bug-gh11416.phpt b/ext/date/tests/bug-gh11416.phpt index 546867924cb4..ab8452d5897f 100644 --- a/ext/date/tests/bug-gh11416.phpt +++ b/ext/date/tests/bug-gh11416.phpt @@ -11,14 +11,14 @@ $date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); try { new DatePeriod($date, new DateInterval('P1D'), 2); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); try { new DatePeriod($now, new DateInterval('P1D'), $date); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $date = (new ReflectionClass(DateTime::class))->newInstanceWithoutConstructor(); @@ -27,25 +27,25 @@ $dateinterval = (new ReflectionClass(DateInterval::class))->newInstanceWithoutCo try { $dateperiod->__unserialize(['start' => $date]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dateperiod->__unserialize(['start' => $now, 'end' => $date]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $date]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dateperiod->__unserialize(['start' => $now, 'end' => $now, 'current' => $now, 'interval' => $dateinterval]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -55,7 +55,7 @@ try { ]); echo "DatePeriod::__unserialize: SUCCESS\n"; } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "OK\n"; ?> diff --git a/ext/date/tests/bug-gh15582.phpt b/ext/date/tests/bug-gh15582.phpt index ab03e190e4bc..2dd6ec59b8f2 100644 --- a/ext/date/tests/bug-gh15582.phpt +++ b/ext/date/tests/bug-gh15582.phpt @@ -14,7 +14,7 @@ $fusion = $mdtz; try { date_create("2005-07-14 22:30:41", $fusion); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/date/tests/bug-gh8471.phpt b/ext/date/tests/bug-gh8471.phpt index 2f6656849f6c..0c1c69418692 100644 --- a/ext/date/tests/bug-gh8471.phpt +++ b/ext/date/tests/bug-gh8471.phpt @@ -8,7 +8,7 @@ $mutable = $reflection->newInstanceWithoutConstructor(); try { $immutable = \DateTimeImmutable::createFromMutable($mutable); } catch (Throwable $t) { - echo $t->getMessage(), "\n"; + echo $t::class, ': ', $t->getMessage(), "\n"; } @@ -18,7 +18,7 @@ $mutable = $reflection->newInstanceWithoutConstructor(); try { $immutable = \DateTimeImmutable::createFromInterface($mutable); } catch (Throwable $t) { - echo $t->getMessage(), "\n"; + echo $t::class, ': ', $t->getMessage(), "\n"; } @@ -28,7 +28,7 @@ $immutable = $reflection->newInstanceWithoutConstructor(); try { $mutable = \DateTime::createFromImmutable($immutable); } catch (Throwable $t) { - echo $t->getMessage(), "\n"; + echo $t::class, ': ', $t->getMessage(), "\n"; } @@ -38,13 +38,13 @@ $immutable = $reflection->newInstanceWithoutConstructor(); try { $mutable = \DateTime::createFromInterface($immutable); } catch (Throwable $t) { - echo $t->getMessage(), "\n"; + echo $t::class, ': ', $t->getMessage(), "\n"; } ?> --EXPECTF-- -Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor -Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor -Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor -Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor +DateObjectError: Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor +DateObjectError: Object of type DateTime has not been correctly initialized by calling parent::__construct() in its constructor +DateObjectError: Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor +DateObjectError: Object of type DateTimeImmutable has not been correctly initialized by calling parent::__construct() in its constructor diff --git a/ext/date/tests/bug51819.phpt b/ext/date/tests/bug51819.phpt index a5f21abf859e..21db1e774542 100644 --- a/ext/date/tests/bug51819.phpt +++ b/ext/date/tests/bug51819.phpt @@ -23,7 +23,7 @@ foreach ($aTz as $sTz) { try { $oDateTime = new DateTime($sDate); } catch (Exception $oException) { - var_dump($oException->getMessage()); + echo $oException::class, ': ', $oException->getMessage(), "\n"; print_r(DateTime::getLastErrors()); } } diff --git a/ext/date/tests/bug54283.phpt b/ext/date/tests/bug54283.phpt index 6acf6e5c8806..c6c303a4d0cc 100644 --- a/ext/date/tests/bug54283.phpt +++ b/ext/date/tests/bug54283.phpt @@ -6,7 +6,7 @@ Bug #54283 (new DatePeriod(NULL) causes crash) try { var_dump(new DatePeriod(NULL)); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -14,4 +14,4 @@ try { Deprecated: DatePeriod::__construct(): Passing null to parameter #1 ($start) of type string is deprecated in %s on line %d Deprecated: Calling DatePeriod::__construct(string $isostr, int $options = 0) is deprecated, use DatePeriod::createFromISO8601String() instead in %s on line %d -string(24) "Unknown or bad format ()" +DateMalformedPeriodStringException: Unknown or bad format () diff --git a/ext/date/tests/bug62500.phpt b/ext/date/tests/bug62500.phpt index e3a133fb63f5..39ea74cf86c9 100644 --- a/ext/date/tests/bug62500.phpt +++ b/ext/date/tests/bug62500.phpt @@ -17,7 +17,7 @@ class Crasher extends DateInterval { try { $c = new Crasher('blah'); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -26,4 +26,4 @@ int(3) Warning: Undefined property: Crasher::$2 in %s on line %d NULL -string(28) "Unknown or bad format (blah)" +DateMalformedIntervalStringException: Unknown or bad format (blah) diff --git a/ext/date/tests/bug71826.phpt b/ext/date/tests/bug71826.phpt index 1a4d8ff49f7e..42b0cbf346d3 100644 --- a/ext/date/tests/bug71826.phpt +++ b/ext/date/tests/bug71826.phpt @@ -29,4 +29,3 @@ int(28) c(Asia/Tokyo): 2015-4-1 <--> 2015-4-29 int(0) int(28) - diff --git a/ext/date/tests/bug72963.phpt b/ext/date/tests/bug72963.phpt index 0fd01808a844..53327f367003 100644 --- a/ext/date/tests/bug72963.phpt +++ b/ext/date/tests/bug72963.phpt @@ -16,19 +16,19 @@ foreach ($strings as $string) { try { $d1 = DateTime::createFromFormat('!m/d/Y', $string); } catch (ValueError $v) { - echo $v->getMessage(), "\n"; + echo $v::class, ': ', $v->getMessage(), "\n"; } try { $d2 = DateTimeImmutable::createFromFormat('!m/d/Y', $string); } catch (ValueError $v) { - echo $v->getMessage(), "\n"; + echo $v::class, ': ', $v->getMessage(), "\n"; } try { $d3 = date_parse_from_format('m/d/Y', $string); } catch (ValueError $v) { - echo $v->getMessage(), "\n"; + echo $v::class, ': ', $v->getMessage(), "\n"; } var_dump($d1, $d2, $d3); @@ -84,9 +84,9 @@ array(12) { Covering string: 8/8/2016\0asf -DateTime::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes -DateTimeImmutable::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes -date_parse_from_format(): Argument #2 ($datetime) must not contain any null bytes +ValueError: DateTime::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes +ValueError: DateTimeImmutable::createFromFormat(): Argument #2 ($datetime) must not contain any null bytes +ValueError: date_parse_from_format(): Argument #2 ($datetime) must not contain any null bytes NULL NULL NULL diff --git a/ext/date/tests/bug77097.phpt b/ext/date/tests/bug77097.phpt index 080982d68169..c92fc5d01725 100644 --- a/ext/date/tests/bug77097.phpt +++ b/ext/date/tests/bug77097.phpt @@ -30,4 +30,3 @@ float(0.781751) int(0) int(0) float(0.781751) - diff --git a/ext/date/tests/bug78139.phpt b/ext/date/tests/bug78139.phpt index 47e5536cbaad..bd5d07066e5f 100644 --- a/ext/date/tests/bug78139.phpt +++ b/ext/date/tests/bug78139.phpt @@ -70,4 +70,3 @@ Parsing 'UTC xx': Warning: timezone_open(): Unknown or bad timezone (UTC xx) in %sbug78139.php on line %d bool(false) DateInvalidTimeZoneException: DateTimeZone::__construct(): Unknown or bad timezone (UTC xx) - diff --git a/ext/date/tests/createFromTimestamp.phpt b/ext/date/tests/createFromTimestamp.phpt index f31aeae11854..cf6c753110b8 100644 --- a/ext/date/tests/createFromTimestamp.phpt +++ b/ext/date/tests/createFromTimestamp.phpt @@ -32,14 +32,14 @@ foreach ($timestamps as $ts) { try { var_dump(DateTime::createFromTimestamp($ts)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'DateTimeImmutable::createFromTimestamp(' . var_export($ts, true) . '): '; try { var_dump(DateTimeImmutable::createFromTimestamp($ts)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -47,14 +47,14 @@ echo 'MyDateTime::createFromTimestamp(' . var_export(0, true) . '): '; try { var_dump(MyDateTime::createFromTimestamp(0)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'MyDateTimeImmutable::createFromTimestamp(' . var_export(0, true) . '): '; try { var_dump(MyDateTimeImmutable::createFromTimestamp(0)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/date/tests/date_interval_set_state_error1.phpt b/ext/date/tests/date_interval_set_state_error1.phpt index ee68de8db466..4bb71320997f 100644 --- a/ext/date/tests/date_interval_set_state_error1.phpt +++ b/ext/date/tests/date_interval_set_state_error1.phpt @@ -14,7 +14,7 @@ try { ] ); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($interval); @@ -43,7 +43,7 @@ object(DateInterval)#%d (%d) { ["from_string"]=> bool(false) } -Unknown or bad format (wrong) at position 0 (w) while unserializing: The timezone could not be found in the database +Error: Unknown or bad format (wrong) at position 0 (w) while unserializing: The timezone could not be found in the database object(DateInterval)#%d (%d) { ["y"]=> int(1) diff --git a/ext/date/tests/date_period_exclude_start_and_include_end.phpt b/ext/date/tests/date_period_exclude_start_and_include_end.phpt index 6238f6707351..bcfd89eb5c18 100644 --- a/ext/date/tests/date_period_exclude_start_and_include_end.phpt +++ b/ext/date/tests/date_period_exclude_start_and_include_end.phpt @@ -16,4 +16,3 @@ foreach ($dp as $day) { 2010-06-08 2010-06-09 2010-06-10 - diff --git a/ext/date/tests/date_period_unset_property.phpt b/ext/date/tests/date_period_unset_property.phpt index 7948d61d268d..ced092c768bc 100644 --- a/ext/date/tests/date_period_unset_property.phpt +++ b/ext/date/tests/date_period_unset_property.phpt @@ -14,58 +14,58 @@ unset($period->prop); try { $period->prop; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->start); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->current); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->end); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->interval); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->recurrences); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->include_start_date); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($period->include_end_date); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property MyDatePeriod::$prop must not be accessed before initialization -Cannot unset MyDatePeriod::$start -Cannot unset MyDatePeriod::$current -Cannot unset MyDatePeriod::$end -Cannot unset MyDatePeriod::$interval -Cannot unset MyDatePeriod::$recurrences -Cannot unset MyDatePeriod::$include_start_date -Cannot unset MyDatePeriod::$include_end_date +Error: Typed property MyDatePeriod::$prop must not be accessed before initialization +Error: Cannot unset MyDatePeriod::$start +Error: Cannot unset MyDatePeriod::$current +Error: Cannot unset MyDatePeriod::$end +Error: Cannot unset MyDatePeriod::$interval +Error: Cannot unset MyDatePeriod::$recurrences +Error: Cannot unset MyDatePeriod::$include_start_date +Error: Cannot unset MyDatePeriod::$include_end_date diff --git a/ext/date/tests/date_sunrise_and_sunset_error.phpt b/ext/date/tests/date_sunrise_and_sunset_error.phpt index 01212992d8fb..0e756f505497 100644 --- a/ext/date/tests/date_sunrise_and_sunset_error.phpt +++ b/ext/date/tests/date_sunrise_and_sunset_error.phpt @@ -6,19 +6,19 @@ Test error condition of date_sunrise() and date_sunset() try { date_sunrise(time(), 3); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { date_sunset(time(), 4); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Function date_sunrise() is deprecated since 8.1, use date_sun_info() instead in %s on line %d -date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE +ValueError: date_sunrise(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in %s on line %d -date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE +ValueError: date_sunset(): Argument #2 ($returnFormat) must be one of SUNFUNCS_RET_TIMESTAMP, SUNFUNCS_RET_STRING, or SUNFUNCS_RET_DOUBLE diff --git a/ext/date/tests/getSetMicroseconds.phpt b/ext/date/tests/getSetMicroseconds.phpt index debb5459633a..8f4aa864756c 100644 --- a/ext/date/tests/getSetMicroseconds.phpt +++ b/ext/date/tests/getSetMicroseconds.phpt @@ -37,7 +37,7 @@ foreach ($microsecondList as $microsecond) { try { var_dump($dt->setMicrosecond($microsecond)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'DateTime::getMicrosecond(): ' . var_export($dt->getMicrosecond(), true) . "\n"; @@ -45,7 +45,7 @@ foreach ($microsecondList as $microsecond) { try { var_dump($dti->setMicrosecond($microsecond)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'DateTimeImmutable::getMicrosecond(): ' . var_export($dti->getMicrosecond(), true) . "\n"; @@ -53,7 +53,7 @@ foreach ($microsecondList as $microsecond) { try { var_dump($myDt->setMicrosecond($microsecond)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'MyDateTime::getMicrosecond(): ' . var_export($myDt->getMicrosecond(), true) . "\n"; @@ -61,7 +61,7 @@ foreach ($microsecondList as $microsecond) { try { var_dump($myDti->setMicrosecond($microsecond)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'MyDateTimeImmutable::getMicrosecond(): ' . var_export($myDti->getMicrosecond(), true) . "\n"; } diff --git a/ext/date/tests/gh14732.phpt b/ext/date/tests/gh14732.phpt index 19b5f3b481f4..39f3116379e9 100644 --- a/ext/date/tests/gh14732.phpt +++ b/ext/date/tests/gh14732.phpt @@ -5,31 +5,31 @@ GH-14732 (date_sun_info() fails for non-finite values) try { date_sun_info(1, NAN, 1); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { date_sun_info(1, -INF, 1); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { date_sun_info(1, 1, NAN); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { date_sun_info(1, 1, INF); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } var_dump(date_sunset(1, SUNFUNCS_RET_STRING, NAN, 1)); var_dump(date_sunrise(1, SUNFUNCS_RET_STRING, 1, NAN)); ?> --EXPECTF-- -date_sun_info(): Argument #2 ($latitude) must be finite -date_sun_info(): Argument #2 ($latitude) must be finite -date_sun_info(): Argument #3 ($longitude) must be finite -date_sun_info(): Argument #3 ($longitude) must be finite +ValueError: date_sun_info(): Argument #2 ($latitude) must be finite +ValueError: date_sun_info(): Argument #2 ($latitude) must be finite +ValueError: date_sun_info(): Argument #3 ($longitude) must be finite +ValueError: date_sun_info(): Argument #3 ($longitude) must be finite Deprecated: Constant SUNFUNCS_RET_STRING is deprecated since 8.4, as date_sunrise() and date_sunset() were deprecated in 8.1 in %s on line %d diff --git a/ext/date/tests/gh20936.phpt b/ext/date/tests/gh20936.phpt index e6a525dd4583..10ad79a9d25d 100644 --- a/ext/date/tests/gh20936.phpt +++ b/ext/date/tests/gh20936.phpt @@ -7,7 +7,7 @@ $interval = new DateInterval('P2D'); try { DatePeriod::__set_state(['start' => null, 'end' => $end, 'current' => null, 'interval' => $interval, 'recurrences' => 2, 'include_start_date' => false, 'include_end_date' => true]); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/date/tests/instantiate_uninstantiable_classes.phpt b/ext/date/tests/instantiate_uninstantiable_classes.phpt index 634ed635b2d2..b14be57ec404 100644 --- a/ext/date/tests/instantiate_uninstantiable_classes.phpt +++ b/ext/date/tests/instantiate_uninstantiable_classes.phpt @@ -18,65 +18,65 @@ abstract class MyDateTimeImmutable extends DateTimeImmutable { try { MyDatePeriod::createFromISO8601String('R5'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTime::createFromFormat('Y-m-d', '2025-01-01'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTime::createFromImmutable(new DateTimeImmutable()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTime::createFromInterface(new DateTimeImmutable()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTime::createFromTimestamp(0); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTimeImmutable::createFromFormat('Y-m-d', '2025-01-01'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTimeImmutable::createFromMutable(new DateTime()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTimeImmutable::createFromInterface(new DateTime()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { MyDateTimeImmutable::createFromTimestamp(0); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate abstract class MyDatePeriod -Cannot instantiate abstract class MyDateTime -Cannot instantiate abstract class MyDateTime -Cannot instantiate abstract class MyDateTime -Cannot instantiate abstract class MyDateTime -Cannot instantiate abstract class MyDateTimeImmutable -Cannot instantiate abstract class MyDateTimeImmutable -Cannot instantiate abstract class MyDateTimeImmutable -Cannot instantiate abstract class MyDateTimeImmutable +Error: Cannot instantiate abstract class MyDatePeriod +Error: Cannot instantiate abstract class MyDateTime +Error: Cannot instantiate abstract class MyDateTime +Error: Cannot instantiate abstract class MyDateTime +Error: Cannot instantiate abstract class MyDateTime +Error: Cannot instantiate abstract class MyDateTimeImmutable +Error: Cannot instantiate abstract class MyDateTimeImmutable +Error: Cannot instantiate abstract class MyDateTimeImmutable +Error: Cannot instantiate abstract class MyDateTimeImmutable diff --git a/ext/date/tests/timezone_offset_get_error.phpt b/ext/date/tests/timezone_offset_get_error.phpt index 4b5cda104ef6..efa5f353ba38 100644 --- a/ext/date/tests/timezone_offset_get_error.phpt +++ b/ext/date/tests/timezone_offset_get_error.phpt @@ -14,22 +14,19 @@ $invalid_obj = new stdClass(); try { var_dump( timezone_offset_get($invalid_obj, $date) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $invalid_obj = 10; try { var_dump( timezone_offset_get($invalid_obj, $date) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $invalid_obj = null; try { var_dump( timezone_offset_get($invalid_obj, $date) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } echo "\n-- Testing timezone_offset_get() function with an invalid values for \$datetime argument --\n"; @@ -37,38 +34,30 @@ $invalid_obj = new stdClass(); try { var_dump( timezone_offset_get($tz, $invalid_obj) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $invalid_obj = 10; try { var_dump( timezone_offset_get($tz, $invalid_obj) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } $invalid_obj = null; try { var_dump( timezone_offset_get($tz, $invalid_obj) ); } catch (Error $ex) { - var_dump($ex->getMessage()); - echo "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- *** Testing timezone_offset_get() : error conditions *** -- Testing timezone_offset_get() function with an invalid values for $object argument -- -string(89) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, stdClass given" - -string(84) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, int given" - -string(85) "timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, null given" - +TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, stdClass given +TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, int given +TypeError: timezone_offset_get(): Argument #1 ($object) must be of type DateTimeZone, null given -- Testing timezone_offset_get() function with an invalid values for $datetime argument -- -string(96) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, stdClass given" - -string(91) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, int given" - -string(92) "timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, null given" +TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, stdClass given +TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, int given +TypeError: timezone_offset_get(): Argument #2 ($datetime) must be of type DateTimeInterface, null given diff --git a/ext/date/tests/unserialize-test.phpt b/ext/date/tests/unserialize-test.phpt index aaff75db6b77..bf3bd117c0cc 100644 --- a/ext/date/tests/unserialize-test.phpt +++ b/ext/date/tests/unserialize-test.phpt @@ -17,7 +17,7 @@ foreach ($files as $file) { try { $x = unserialize(substr($s, strpos($s, "|") + 1)); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($x); echo "\n\n"; diff --git a/ext/dba/tests/dba015.phpt b/ext/dba/tests/dba015.phpt index a2fa60eb6028..b8979f962df4 100644 --- a/ext/dba/tests/dba015.phpt +++ b/ext/dba/tests/dba015.phpt @@ -48,7 +48,7 @@ var_dump($db_file1); try { dba_exists("key1", $db_file2); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Test 6 - query after closing 2nd object\n"; @@ -75,7 +75,7 @@ This is a test insert 2 Test 5 - close 2nd object object(Dba\Connection)#%d (%d) { } -DBA connection has already been closed +Error: DBA connection has already been closed Test 6 - query after closing 2nd object This is a test insert 1 This is a test insert 2 diff --git a/ext/dba/tests/dba_array_keys_errors.phpt b/ext/dba/tests/dba_array_keys_errors.phpt index d80915c7c318..e9544c8d7176 100644 --- a/ext/dba/tests/dba_array_keys_errors.phpt +++ b/ext/dba/tests/dba_array_keys_errors.phpt @@ -17,12 +17,12 @@ $db = get_any_db($name); try { dba_insert([], "Content String 1", $db); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { dba_insert(["a", "b", "c"], "Content String 2", $db); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* Use an object */ @@ -30,12 +30,12 @@ $o = new stdClass(); try { var_dump(dba_insert([$o, 'obj'], 'Test', $db)); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_insert(['group', $o], 'Test', $db)); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } dba_close($db); diff --git a/ext/dba/tests/dba_fetch_legacy_signature.phpt b/ext/dba/tests/dba_fetch_legacy_signature.phpt index 40933f4c76b1..be5f78dd0326 100644 --- a/ext/dba/tests/dba_fetch_legacy_signature.phpt +++ b/ext/dba/tests/dba_fetch_legacy_signature.phpt @@ -24,7 +24,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { dba_fetch("key1", 0, $db); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } dba_close($db); @@ -41,4 +41,4 @@ Using handler: "%s" Deprecated: Calling dba_fetch() with $dba at the 3rd parameter is deprecated in %s on line %d This is a test insert This is a test insert -Calling dba_fetch() with $dba at the 3rd parameter is deprecated +Exception: Calling dba_fetch() with $dba at the 3rd parameter is deprecated diff --git a/ext/dba/tests/dba_flags_arg.phpt b/ext/dba/tests/dba_flags_arg.phpt index 6a387b51822b..6815f3dec213 100644 --- a/ext/dba/tests/dba_flags_arg.phpt +++ b/ext/dba/tests/dba_flags_arg.phpt @@ -7,8 +7,8 @@ dba try { dba_open('irrelevant', 'c', 'handler', flags: -1); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -dba_open(): Argument #6 ($flags) must be greater than or equal to 0 +ValueError: dba_open(): Argument #6 ($flags) must be greater than or equal to 0 diff --git a/ext/dba/tests/gh19885.phpt b/ext/dba/tests/gh19885.phpt index 987aea4f175a..e6358b3c59b0 100644 --- a/ext/dba/tests/gh19885.phpt +++ b/ext/dba/tests/gh19885.phpt @@ -16,20 +16,20 @@ $db =dba_open($db_file, "r", $handler); try { dba_fetch("1", $db, PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { dba_fetch("1", $db, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // negative skip needs to remain acceptable albeit corrected down the line var_dump(dba_fetch("1", $db, -1000000)); ?> --EXPECTF-- -dba_fetch(): Argument #3 ($skip) must be between -%d and %d -dba_fetch(): Argument #3 ($skip) must be between -%d and %d +ValueError: dba_fetch(): Argument #3 ($skip) must be between -%d and %d +ValueError: dba_fetch(): Argument #3 ($skip) must be between -%d and %d Notice: dba_fetch(): Handler cdb accepts only skip values greater than or equal to zero, using skip=0 in %s on line %d string(1) "1" diff --git a/ext/dba/tests/value_errors_open.phpt b/ext/dba/tests/value_errors_open.phpt index ee995fe5b8d6..b5472a23d695 100644 --- a/ext/dba/tests/value_errors_open.phpt +++ b/ext/dba/tests/value_errors_open.phpt @@ -21,45 +21,45 @@ var_dump(dba_open($db_file, 'n', 'bogus')); try { var_dump(dba_open('', 'nq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, '')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'nq', '')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'q')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'nq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'rdq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'n-t')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_open($db_file, 'r', $handler, 0o644, -10)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo '=== Invalid arguments dba_popen() ===', \PHP_EOL; @@ -68,45 +68,45 @@ var_dump(dba_popen($db_file, 'n', 'bogus')); try { var_dump(dba_popen('', 'nq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, '')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'nq', '')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'q')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'nq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'rdq')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'n-t')); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(dba_popen($db_file, 'r', $handler, 0o644, -10)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- @@ -121,23 +121,23 @@ object(Dba\Connection)#%d (%d) { Warning: dba_open(): Handler "bogus" is not available in %s on line %d bool(false) -dba_open(): Argument #1 ($path) must not be empty -dba_open(): Argument #2 ($mode) must not be empty -dba_open(): Argument #3 ($handler) must not be empty -dba_open(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n" -dba_open(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t" -dba_open(): Argument #2 ($mode) third character must be "t" -dba_open(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock) -dba_open(): Argument #5 ($map_size) must be greater than or equal to 0 +ValueError: dba_open(): Argument #1 ($path) must not be empty +ValueError: dba_open(): Argument #2 ($mode) must not be empty +ValueError: dba_open(): Argument #3 ($handler) must not be empty +ValueError: dba_open(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n" +ValueError: dba_open(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t" +ValueError: dba_open(): Argument #2 ($mode) third character must be "t" +ValueError: dba_open(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock) +ValueError: dba_open(): Argument #5 ($map_size) must be greater than or equal to 0 === Invalid arguments dba_popen() === Warning: dba_popen(): Handler "bogus" is not available in %s on line %d bool(false) -dba_popen(): Argument #1 ($path) must not be empty -dba_popen(): Argument #2 ($mode) must not be empty -dba_popen(): Argument #3 ($handler) must not be empty -dba_popen(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n" -dba_popen(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t" -dba_popen(): Argument #2 ($mode) third character must be "t" -dba_popen(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock) -dba_popen(): Argument #5 ($map_size) must be greater than or equal to 0 +ValueError: dba_popen(): Argument #1 ($path) must not be empty +ValueError: dba_popen(): Argument #2 ($mode) must not be empty +ValueError: dba_popen(): Argument #3 ($handler) must not be empty +ValueError: dba_popen(): Argument #2 ($mode) first character must be one of "r", "w", "c", or "n" +ValueError: dba_popen(): Argument #2 ($mode) second character must be one of "d", "l", "-", or "t" +ValueError: dba_popen(): Argument #2 ($mode) third character must be "t" +ValueError: dba_popen(): Argument #2 ($mode) cannot combine mode "-" (no lock) and "t" (test lock) +ValueError: dba_popen(): Argument #5 ($map_size) must be greater than or equal to 0 diff --git a/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt index cf51c3581a34..56a5d3f24cf4 100644 --- a/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt +++ b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt @@ -19,7 +19,7 @@ function test($method) { $element->$method($dom2->documentElement->firstChild); echo "FAIL"; } catch (DOMException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -29,6 +29,6 @@ test("replaceWith"); ?> --EXPECT-- -Wrong Document Error -Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error +DOMException: Wrong Document Error +DOMException: Wrong Document Error diff --git a/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt b/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt index 3890ef08d5b7..2d12af639419 100644 --- a/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt +++ b/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt @@ -12,8 +12,8 @@ $element = $dom->createElement('test'); try { $element->remove(); } catch (DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt b/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt index 9a823e370a6e..ada2ee8cbc67 100644 --- a/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt +++ b/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt @@ -12,8 +12,8 @@ $dom->loadXML(''); try { $dom->documentElement->append(array()); } catch(TypeError $e) { - echo "OK! {$e->getMessage()}"; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -OK! DOMElement::append(): Argument #1 must be of type DOMNode|string, array given +TypeError: DOMElement::append(): Argument #1 must be of type DOMNode|string, array given diff --git a/ext/dom/tests/DOM4_ParentNode_append_with_attributes.phpt b/ext/dom/tests/DOM4_ParentNode_append_with_attributes.phpt index 701dc1d0944b..0f8057b06ca6 100644 --- a/ext/dom/tests/DOM4_ParentNode_append_with_attributes.phpt +++ b/ext/dom/tests/DOM4_ParentNode_append_with_attributes.phpt @@ -19,12 +19,12 @@ $element = $dom->documentElement; try { $element->append($replacement, $addition); } catch (DOMException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/DOM4_ParentNode_append_wrong_document.phpt b/ext/dom/tests/DOM4_ParentNode_append_wrong_document.phpt index 9df1603cab0c..c3c2565b6cd3 100644 --- a/ext/dom/tests/DOM4_ParentNode_append_wrong_document.phpt +++ b/ext/dom/tests/DOM4_ParentNode_append_wrong_document.phpt @@ -19,7 +19,7 @@ function test($method) { $element->$method($dom2->documentElement->firstChild); echo "FAIL"; } catch (DOMException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -27,5 +27,5 @@ test("append"); test("prepend"); ?> --EXPECT-- -Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error +DOMException: Wrong Document Error diff --git a/ext/dom/tests/DOMAttr_construct_error_001.phpt b/ext/dom/tests/DOMAttr_construct_error_001.phpt index 0839587caf46..6e556f28be07 100644 --- a/ext/dom/tests/DOMAttr_construct_error_001.phpt +++ b/ext/dom/tests/DOMAttr_construct_error_001.phpt @@ -10,8 +10,8 @@ dom try { $attr = new DOMAttr(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMAttr::__construct() expects at least 1 argument, 0 given +ArgumentCountError: DOMAttr::__construct() expects at least 1 argument, 0 given diff --git a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt index 50aacf05b9bd..90d5dd474be1 100644 --- a/ext/dom/tests/DOMCDATASection_construct_error_001.phpt +++ b/ext/dom/tests/DOMCDATASection_construct_error_001.phpt @@ -10,8 +10,8 @@ dom try { $section = new DOMCDataSection(); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -DOMCdataSection::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: DOMCdataSection::__construct() expects exactly 1 argument, 0 given diff --git a/ext/dom/tests/DOMCharacterData_data_error_002.phpt b/ext/dom/tests/DOMCharacterData_data_error_002.phpt index 71ef411a5cf8..1794e208fe1c 100644 --- a/ext/dom/tests/DOMCharacterData_data_error_002.phpt +++ b/ext/dom/tests/DOMCharacterData_data_error_002.phpt @@ -11,8 +11,8 @@ $character_data = new DOMCharacterData(); try { print $character_data->data; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt b/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt index 071ac52abf2b..a8f879963fc7 100644 --- a/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt +++ b/ext/dom/tests/DOMCharacterData_deleteData_error_002.phpt @@ -16,8 +16,8 @@ $root->appendChild($cdata); try { $cdata->deleteData(5, 1); } catch (DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/DOMCharacterData_length_error_001.phpt b/ext/dom/tests/DOMCharacterData_length_error_001.phpt index 8f0c66a12e72..b2ef2d4617b6 100644 --- a/ext/dom/tests/DOMCharacterData_length_error_001.phpt +++ b/ext/dom/tests/DOMCharacterData_length_error_001.phpt @@ -11,8 +11,8 @@ $character_data = new DOMCharacterData(); try { print $character_data->length; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMComment_construct_error_001.phpt b/ext/dom/tests/DOMComment_construct_error_001.phpt index 573a493827eb..fb73f5d078c7 100644 --- a/ext/dom/tests/DOMComment_construct_error_001.phpt +++ b/ext/dom/tests/DOMComment_construct_error_001.phpt @@ -10,8 +10,8 @@ dom try { $comment = new DOMComment("comment1", "comment2"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMComment::__construct() expects at most 1 argument, 2 given +ArgumentCountError: DOMComment::__construct() expects at most 1 argument, 2 given diff --git a/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt b/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt index 85ff6b7667d3..db37f5ebd3a4 100644 --- a/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt +++ b/ext/dom/tests/DOMDocumentFragment_appendXML_error_002.phpt @@ -11,8 +11,8 @@ $fragment = new DOMDocumentFragment(); try { $fragment->appendXML('crankbait'); } catch (DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -No Modification Allowed Error +DOMException: No Modification Allowed Error diff --git a/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt b/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt index b05e1efc5f07..844d2f6196c3 100644 --- a/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt +++ b/ext/dom/tests/DOMDocumentFragment_construct_error_001.phpt @@ -10,8 +10,8 @@ dom try { $fragment = new DOMDocumentFragment("root"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocumentFragment::__construct() expects exactly 0 arguments, 1 given +ArgumentCountError: DOMDocumentFragment::__construct() expects exactly 0 arguments, 1 given diff --git a/ext/dom/tests/DOMDocumentType_entities_error_001.phpt b/ext/dom/tests/DOMDocumentType_entities_error_001.phpt index 3385a2f4e092..d8e442439ffa 100644 --- a/ext/dom/tests/DOMDocumentType_entities_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_entities_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $doctype->entities; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocumentType_internalSubset_error_001.phpt b/ext/dom/tests/DOMDocumentType_internalSubset_error_001.phpt index efd00bc3bb1e..b1836dee8fc7 100644 --- a/ext/dom/tests/DOMDocumentType_internalSubset_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_internalSubset_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $doctype->internalSubset; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocumentType_name_error_001.phpt b/ext/dom/tests/DOMDocumentType_name_error_001.phpt index 7714613a0eff..57a4d4a161b6 100644 --- a/ext/dom/tests/DOMDocumentType_name_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_name_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $doctype->name; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocumentType_notations_error_001.phpt b/ext/dom/tests/DOMDocumentType_notations_error_001.phpt index 9fa1c7510a6e..d1dd22b007c6 100644 --- a/ext/dom/tests/DOMDocumentType_notations_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_notations_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $notations = $doctype->notations; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocumentType_publicId_error_001.phpt b/ext/dom/tests/DOMDocumentType_publicId_error_001.phpt index 1a7fcd3feb42..b3e2f4bc7354 100644 --- a/ext/dom/tests/DOMDocumentType_publicId_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_publicId_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $publicId = $doctype->publicId; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocumentType_systemId_error_001.phpt b/ext/dom/tests/DOMDocumentType_systemId_error_001.phpt index 3d5f7827eaad..0c6af6b3dbf2 100644 --- a/ext/dom/tests/DOMDocumentType_systemId_error_001.phpt +++ b/ext/dom/tests/DOMDocumentType_systemId_error_001.phpt @@ -11,8 +11,8 @@ $doctype = new DOMDocumentType(); try { $systemId = $doctype->systemId; } catch (DOMException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMDocument_adoptNode.phpt b/ext/dom/tests/DOMDocument_adoptNode.phpt index 2382cabd5136..16539fc9bb0f 100644 --- a/ext/dom/tests/DOMDocument_adoptNode.phpt +++ b/ext/dom/tests/DOMDocument_adoptNode.phpt @@ -21,7 +21,7 @@ echo "-- Trying to append child from other document --\n"; try { $doc2->firstChild->appendChild($b_tag_element); // Should fail because it's another document } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Adopting --\n"; @@ -48,7 +48,7 @@ echo "-- Adopt a document (strict error on) --\n"; try { $doc1->adoptNode($doc1); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Adopt a document (strict error off) --\n"; @@ -57,7 +57,7 @@ $doc1->strictErrorChecking = false; try { $doc1->adoptNode($doc1); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $doc1->strictErrorChecking = true; @@ -117,7 +117,7 @@ var_dump($child->nodeName); bool(true) bool(false) -- Trying to append child from other document -- -Wrong Document Error +DOMException: Wrong Document Error -- Adopting -- string(3) "hix" string(35) " @@ -138,7 +138,7 @@ string(27) "

" -- Adopt a document (strict error on) -- -Not Supported Error +DOMException: Not Supported Error -- Adopt a document (strict error off) -- Warning: DOMDocument::adoptNode(): Not Supported Error in %s on line %d diff --git a/ext/dom/tests/DOMDocument_createEntityReference_error1.phpt b/ext/dom/tests/DOMDocument_createEntityReference_error1.phpt index 381dd3d5557f..376687f4846a 100644 --- a/ext/dom/tests/DOMDocument_createEntityReference_error1.phpt +++ b/ext/dom/tests/DOMDocument_createEntityReference_error1.phpt @@ -10,9 +10,9 @@ try { $objDoc->createEntityReference('!'); } catch (DOMException $e) { var_dump($e->getCode() === DOM_INVALID_CHARACTER_ERR); - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -Invalid Character Error +DOMException: Invalid Character Error diff --git a/ext/dom/tests/DOMDocument_encoding_basic.phpt b/ext/dom/tests/DOMDocument_encoding_basic.phpt index 8d7f11e1cc2a..42aa4f975e63 100644 --- a/ext/dom/tests/DOMDocument_encoding_basic.phpt +++ b/ext/dom/tests/DOMDocument_encoding_basic.phpt @@ -25,7 +25,7 @@ try { $ret = $dom->encoding = 'NYPHP DOMinatrix'; echo "Adding invalid encoding: $ret\n"; } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $ret = $dom->encoding = 'ISO-8859-1'; @@ -44,7 +44,7 @@ echo "UTF-16 Encoding Read: {$dom->encoding}\n"; ?> --EXPECT-- Empty Encoding Read: '' -Invalid document encoding +ValueError: Invalid document encoding Adding ISO-8859-1 encoding: ISO-8859-1 ISO-8859-1 Encoding Read: ISO-8859-1 Adding UTF-8 encoding: UTF-8 diff --git a/ext/dom/tests/DOMDocument_loadHTML_error2.phpt b/ext/dom/tests/DOMDocument_loadHTML_error2.phpt index 6886240e595b..b11d3ea0a2fc 100644 --- a/ext/dom/tests/DOMDocument_loadHTML_error2.phpt +++ b/ext/dom/tests/DOMDocument_loadHTML_error2.phpt @@ -10,8 +10,8 @@ $doc = new DOMDocument(); try { $doc->loadHTML(''); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::loadHTML(): Argument #1 ($source) must not be empty +ValueError: DOMDocument::loadHTML(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt index a5ef58a65656..9db9be91c246 100644 --- a/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt +++ b/ext/dom/tests/DOMDocument_loadHTMLfile_error2.phpt @@ -12,16 +12,16 @@ $doc = new DOMDocument(); try { $result = $doc->loadHTMLFile(""); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $doc = new DOMDocument(); try { $result = $doc->loadHTMLFile("text.html\0something"); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not be empty -DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not contain any null bytes +ValueError: DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not be empty +ValueError: DOMDocument::loadHTMLFile(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/dom/tests/DOMDocument_loadXML_error6.phpt b/ext/dom/tests/DOMDocument_loadXML_error6.phpt index 748a8eb5dc1d..caac2fcedbb2 100644 --- a/ext/dom/tests/DOMDocument_loadXML_error6.phpt +++ b/ext/dom/tests/DOMDocument_loadXML_error6.phpt @@ -9,8 +9,8 @@ $dom = new DOMDocument(); try { $dom->loadXML(""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::loadXML(): Argument #1 ($source) must not be empty +ValueError: DOMDocument::loadXML(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_load_error6.phpt b/ext/dom/tests/DOMDocument_load_error6.phpt index a4f9bc4a02a8..23606a37599c 100644 --- a/ext/dom/tests/DOMDocument_load_error6.phpt +++ b/ext/dom/tests/DOMDocument_load_error6.phpt @@ -9,19 +9,19 @@ $dom = new DOMDocument(); try { $dom->load(""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $dom->load("/path/with/\0/byte"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Path is too long var_dump($dom->load(str_repeat(" ", PHP_MAXPATHLEN + 1))); ?> --EXPECT-- -DOMDocument::load(): Argument #1 ($filename) must not be empty -DOMDocument::load(): Argument #1 ($filename) must not contain any null bytes +ValueError: DOMDocument::load(): Argument #1 ($filename) must not be empty +ValueError: DOMDocument::load(): Argument #1 ($filename) must not contain any null bytes bool(false) diff --git a/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt b/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt index 248ed48345ad..080c03b6d57b 100644 --- a/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt +++ b/ext/dom/tests/DOMDocument_saveHTMLFile_error2.phpt @@ -10,8 +10,8 @@ dom try { DOMDocument::saveHTMLFile(); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Non-static method DOMDocument::saveHTMLFile() cannot be called statically +Error: Non-static method DOMDocument::saveHTMLFile() cannot be called statically diff --git a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt index 8dc89f253012..e915ff1b1a36 100644 --- a/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt +++ b/ext/dom/tests/DOMDocument_saveHTMLFile_invalid_filename.phpt @@ -20,8 +20,8 @@ $text = $title->appendChild($text); try { $doc->saveHTMLFile($filename); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::saveHTMLFile(): Argument #1 ($filename) must not be empty +ValueError: DOMDocument::saveHTMLFile(): Argument #1 ($filename) must not be empty diff --git a/ext/dom/tests/DOMDocument_saveHTML_error2.phpt b/ext/dom/tests/DOMDocument_saveHTML_error2.phpt index 5e6fd0987108..2b8b37ddbbde 100644 --- a/ext/dom/tests/DOMDocument_saveHTML_error2.phpt +++ b/ext/dom/tests/DOMDocument_saveHTML_error2.phpt @@ -10,8 +10,8 @@ dom try { DOMDocument::saveHTML(true); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Non-static method DOMDocument::saveHTML() cannot be called statically +Error: Non-static method DOMDocument::saveHTML() cannot be called statically diff --git a/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt b/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt index ec295a55e339..ee0fce546444 100644 --- a/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidateSource_error3.phpt @@ -15,9 +15,9 @@ $doc->load(__DIR__."/book.xml"); try { $doc->schemaValidateSource(''); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::schemaValidateSource(): Argument #1 ($source) must not be empty +ValueError: DOMDocument::schemaValidateSource(): Argument #1 ($source) must not be empty diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt index 274463e62e13..eb920a8674bc 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error3.phpt @@ -15,9 +15,9 @@ $doc->load(__DIR__."/book.xml"); try { $doc->schemaValidate(''); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMDocument::schemaValidate(): Argument #1 ($filename) must not be empty +ValueError: DOMDocument::schemaValidate(): Argument #1 ($filename) must not be empty diff --git a/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt b/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt index c5d99b20a3fe..bddf14bad3ec 100644 --- a/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt +++ b/ext/dom/tests/DOMDocument_schemaValidate_error6.phpt @@ -12,14 +12,14 @@ $doc->load(__DIR__."/book.xml"); try { $doc->schemaValidate("/path/with/\0/byte"); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($doc->schemaValidate(str_repeat(" ", PHP_MAXPATHLEN + 1))); ?> --EXPECTF-- -DOMDocument::schemaValidate(): Argument #1 ($filename) must not contain any null bytes +ValueError: DOMDocument::schemaValidate(): Argument #1 ($filename) must not contain any null bytes Warning: DOMDocument::schemaValidate(): Invalid Schema file source in %s on line %d bool(false) diff --git a/ext/dom/tests/DOMDocument_strictErrorChecking_variation.phpt b/ext/dom/tests/DOMDocument_strictErrorChecking_variation.phpt index b44d6395c309..bdcfc7f11f57 100644 --- a/ext/dom/tests/DOMDocument_strictErrorChecking_variation.phpt +++ b/ext/dom/tests/DOMDocument_strictErrorChecking_variation.phpt @@ -21,7 +21,7 @@ try { $attr = $doc->createAttribute(0); } catch (DOMException $e) { echo "GOOD. DOMException thrown\n"; - echo $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (Exception $e) { echo "OOPS. Other exception thrown\n"; } @@ -38,7 +38,7 @@ try { $attr = $doc->createAttribute(0); } catch (DOMException $e) { echo "OOPS. DOMException thrown\n"; - echo $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (Exception $e) { echo "OOPS. Other exception thrown\n"; } @@ -50,7 +50,7 @@ See if strictErrorChecking is on bool(true) Should throw DOMException when strictErrorChecking is on GOOD. DOMException thrown -Invalid Character Error +DOMException: Invalid Character Error Turn strictErrorChecking off See if strictErrorChecking is off bool(false) diff --git a/ext/dom/tests/DOMDocument_validate_error2.phpt b/ext/dom/tests/DOMDocument_validate_error2.phpt index ccf59ddaebea..1e508253574b 100644 --- a/ext/dom/tests/DOMDocument_validate_error2.phpt +++ b/ext/dom/tests/DOMDocument_validate_error2.phpt @@ -10,8 +10,8 @@ dom try { DOMDocument::validate(); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Non-static method DOMDocument::validate() cannot be called statically +Error: Non-static method DOMDocument::validate() cannot be called statically diff --git a/ext/dom/tests/DOMDocument_version_write.phpt b/ext/dom/tests/DOMDocument_version_write.phpt index 3f594cb7e4b8..72cf26cb3c9d 100644 --- a/ext/dom/tests/DOMDocument_version_write.phpt +++ b/ext/dom/tests/DOMDocument_version_write.phpt @@ -19,7 +19,7 @@ echo $dom->saveXML(); try { $dom->version = new MyThrowingStringable; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->version); echo $dom->saveXML(); @@ -28,6 +28,6 @@ echo $dom->saveXML(); string(3) "1.0" string(6) "foobar" -An exception was thrown +Exception: An exception was thrown string(6) "foobar" diff --git a/ext/dom/tests/DOMElement_append_hierarchy_test.phpt b/ext/dom/tests/DOMElement_append_hierarchy_test.phpt index 63583c05bf53..f24d88cdfb84 100644 --- a/ext/dom/tests/DOMElement_append_hierarchy_test.phpt +++ b/ext/dom/tests/DOMElement_append_hierarchy_test.phpt @@ -42,7 +42,7 @@ $b_hello = $dom->firstChild->firstChild; try { $b_hello->append($b_hello); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -52,7 +52,7 @@ $b_hello = $dom->firstChild->firstChild; try { $b_hello->append($b_hello, "foo"); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -63,7 +63,7 @@ $b_world = $b_hello->nextSibling; try { $b_world->firstChild->append($b_world); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -74,7 +74,7 @@ $dom2->loadXML('

other

'); try { $dom->firstChild->firstChild->prepend($dom2->firstChild); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom2->saveHTML()); var_dump($dom->saveHTML()); @@ -94,19 +94,19 @@ string(42) "

helloworldfoo

string(39) "

worldhello

" -- Append hello with itself -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "

helloworld

" -- Append hello with itself and text -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(27) "

world

" -- Append world's i tag with the parent -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "

helloworld

" -- Append from another document -- -Wrong Document Error +DOMException: Wrong Document Error string(13) "

other

" string(39) "

helloworld

diff --git a/ext/dom/tests/DOMElement_className.phpt b/ext/dom/tests/DOMElement_className.phpt index fb19f0e23021..184726e1f4ed 100644 --- a/ext/dom/tests/DOMElement_className.phpt +++ b/ext/dom/tests/DOMElement_className.phpt @@ -28,7 +28,7 @@ var_dump($dom->documentElement->className); try { $dom->documentElement->className = new MyStringable(); } catch (Throwable $e) { - echo "Error: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->documentElement->className); echo $dom->saveXML(); @@ -41,7 +41,7 @@ string(0) "" string(2) "é" string(0) "" string(5) "12345" -Error: foo +Exception: foo string(5) "12345" diff --git a/ext/dom/tests/DOMElement_id.phpt b/ext/dom/tests/DOMElement_id.phpt index b406e3b43231..b810ba0fdb78 100644 --- a/ext/dom/tests/DOMElement_id.phpt +++ b/ext/dom/tests/DOMElement_id.phpt @@ -29,7 +29,7 @@ var_dump($div->id); try { $div->id = new MyStringable(); } catch (Throwable $e) { - echo "Error: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($div->id); echo $dom->saveXML(); @@ -44,7 +44,7 @@ string(0) "" string(2) "é" string(0) "" string(5) "12345" -Error: foo +Exception: foo string(5) "12345"
diff --git a/ext/dom/tests/DOMElement_insertAdjacentElement.phpt b/ext/dom/tests/DOMElement_insertAdjacentElement.phpt index 1e1eb1efecec..951dbfd945e2 100644 --- a/ext/dom/tests/DOMElement_insertAdjacentElement.phpt +++ b/ext/dom/tests/DOMElement_insertAdjacentElement.phpt @@ -18,7 +18,7 @@ var_dump($dom->createElement('free')->insertAdjacentElement("afterend", $dom->cr try { var_dump($dom->createElement('free')->insertAdjacentElement("bogus", $dom->createElement('element'))); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Hierarchy test ---\n"; @@ -29,7 +29,7 @@ foreach (['beforebegin', 'afterbegin', 'beforeend', 'afterend'] as $where) { try { var_dump($child->insertAdjacentElement($where, $element)->tagName); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -84,12 +84,12 @@ echo $dom2->saveXML(); --- Edge cases --- NULL NULL -Syntax Error +DOMException: Syntax Error --- Hierarchy test --- -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error --- Normal cases uppercase --- string(1) "A" diff --git a/ext/dom/tests/DOMElement_insertAdjacentText.phpt b/ext/dom/tests/DOMElement_insertAdjacentText.phpt index 937f35f47acb..683df4f0b4ac 100644 --- a/ext/dom/tests/DOMElement_insertAdjacentText.phpt +++ b/ext/dom/tests/DOMElement_insertAdjacentText.phpt @@ -13,7 +13,7 @@ echo "--- Edge cases ---\n"; try { $dom->createElement('free')->insertAdjacentText("bogus", "bogus"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function testNormalCases($dom, $uppercase) { @@ -56,7 +56,7 @@ var_dump($AText->textContent); ?> --EXPECT-- --- Edge cases --- -Syntax Error +DOMException: Syntax Error --- Normal cases uppercase --- A

foo

diff --git a/ext/dom/tests/DOMElement_prefix_empty.phpt b/ext/dom/tests/DOMElement_prefix_empty.phpt index 8cd3515889e9..c62146fc723f 100644 --- a/ext/dom/tests/DOMElement_prefix_empty.phpt +++ b/ext/dom/tests/DOMElement_prefix_empty.phpt @@ -30,7 +30,7 @@ echo "--- Changing the prefix to that of a conflicting namespace (\"conflict\") try { $container->prefix = "conflict"; } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(); @@ -46,6 +46,6 @@ echo $dom->saveXML(); --- Changing the prefix to that of a conflicting namespace ("conflict") --- -Namespace Error +DOMException: Namespace Error diff --git a/ext/dom/tests/DOMElement_prepend_hierarchy_test.phpt b/ext/dom/tests/DOMElement_prepend_hierarchy_test.phpt index b1a9910e0ee1..17010f3f8c85 100644 --- a/ext/dom/tests/DOMElement_prepend_hierarchy_test.phpt +++ b/ext/dom/tests/DOMElement_prepend_hierarchy_test.phpt @@ -49,7 +49,7 @@ $b_hello = $dom->firstChild->firstChild; try { $b_hello->prepend($b_hello); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -59,7 +59,7 @@ $b_hello = $dom->firstChild->firstChild; try { $b_hello->prepend($b_hello, "foo"); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -70,7 +70,7 @@ $b_world = $b_hello->nextSibling; try { $b_world->firstChild->prepend($b_world); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHTML()); @@ -81,7 +81,7 @@ $dom2->loadXML('

other

'); try { $dom->firstChild->firstChild->prepend($dom2->firstChild); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom2->saveHTML()); var_dump($dom->saveHTML()); @@ -104,19 +104,19 @@ string(39) "

helloworld

string(42) "

hellofooworld

" -- Prepend hello with itself -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "

helloworld

" -- Prepend hello with itself and text -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(27) "

world

" -- Prepend world's i tag with the parent -- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(39) "

helloworld

" -- Append from another document -- -Wrong Document Error +DOMException: Wrong Document Error string(13) "

other

" string(39) "

helloworld

diff --git a/ext/dom/tests/DOMElement_replaceChildren.phpt b/ext/dom/tests/DOMElement_replaceChildren.phpt index a28d99934183..ab3b578666ff 100644 --- a/ext/dom/tests/DOMElement_replaceChildren.phpt +++ b/ext/dom/tests/DOMElement_replaceChildren.phpt @@ -13,13 +13,13 @@ echo "--- Edge cases ---\n"; try { $dom->documentElement->replaceChildren($dom->documentElement); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->documentElement->firstElementChild->replaceChildren($dom->documentElement); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Normal cases ---\n"; @@ -60,8 +60,8 @@ echo $dom->saveXML(); ?> --EXPECT-- --- Edge cases --- -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error --- Normal cases --- diff --git a/ext/dom/tests/DOMElement_toggleAttribute.phpt b/ext/dom/tests/DOMElement_toggleAttribute.phpt index b9e9989e1fe0..8a1c593066a9 100644 --- a/ext/dom/tests/DOMElement_toggleAttribute.phpt +++ b/ext/dom/tests/DOMElement_toggleAttribute.phpt @@ -13,7 +13,7 @@ $xml->loadXML(''); try { var_dump($html->documentElement->toggleAttribute("\0")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Selected attribute tests (HTML) ---\n"; @@ -88,7 +88,7 @@ var_dump($dom->documentElement->getAttribute('xmlns:anotheron')); ?> --EXPECTF-- -Invalid Character Error +DOMException: Invalid Character Error --- Selected attribute tests (HTML) --- bool(false) diff --git a/ext/dom/tests/DOMEntityReference_error1.phpt b/ext/dom/tests/DOMEntityReference_error1.phpt index 1f805c1dbc80..e955ba179a83 100644 --- a/ext/dom/tests/DOMEntityReference_error1.phpt +++ b/ext/dom/tests/DOMEntityReference_error1.phpt @@ -8,9 +8,9 @@ try { new DOMEntityReference('!'); } catch (DOMException $e) { var_dump($e->getCode() === DOM_INVALID_CHARACTER_ERR); - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -Invalid Character Error +DOMException: Invalid Character Error diff --git a/ext/dom/tests/DOMNamedNodeMap_edge_case_offset.phpt b/ext/dom/tests/DOMNamedNodeMap_edge_case_offset.phpt index 30a961143c77..65067d191564 100644 --- a/ext/dom/tests/DOMNamedNodeMap_edge_case_offset.phpt +++ b/ext/dom/tests/DOMNamedNodeMap_edge_case_offset.phpt @@ -14,16 +14,16 @@ var_dump($root->attributes->length); try { var_dump($root->attributes[-1]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->attributes[][] = null; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(1) -must be between 0 and 2147483647 -Cannot access DOMNamedNodeMap without offset +ValueError: must be between 0 and 2147483647 +Error: Cannot access DOMNamedNodeMap without offset diff --git a/ext/dom/tests/DOMNode_C14NFile_basic.phpt b/ext/dom/tests/DOMNode_C14NFile_basic.phpt index fea039d3ca94..26161815d1fb 100644 --- a/ext/dom/tests/DOMNode_C14NFile_basic.phpt +++ b/ext/dom/tests/DOMNode_C14NFile_basic.phpt @@ -28,12 +28,12 @@ var_dump($content); try { var_dump($node->C14NFile($output, false, false, [])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($node->C14NFile($output, false, false, ['query' => []])); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- @@ -44,5 +44,5 @@ unlink($output); --EXPECT-- int(34) string(34) "The Grapes of Wrath" -DOMNode::C14NFile(): Argument #4 ($xpath) must have a "query" key -DOMNode::C14NFile(): Argument #4 ($xpath) "query" option must be a string, array given +ValueError: DOMNode::C14NFile(): Argument #4 ($xpath) must have a "query" key +TypeError: DOMNode::C14NFile(): Argument #4 ($xpath) "query" option must be a string, array given diff --git a/ext/dom/tests/DOMNode_C14N_basic.phpt b/ext/dom/tests/DOMNode_C14N_basic.phpt index f936f9faa9a6..94488bf8a4dc 100644 --- a/ext/dom/tests/DOMNode_C14N_basic.phpt +++ b/ext/dom/tests/DOMNode_C14N_basic.phpt @@ -26,15 +26,15 @@ var_dump($node->C14N()); try { var_dump($node->C14N(false, false, [])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($node->C14N(false, false, ['query' => []])); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- string(34) "The Grapes of Wrath" -DOMNode::C14N(): Argument #3 ($xpath) must have a "query" key -DOMNode::C14N(): Argument #3 ($xpath) "query" option must be a string, array given +ValueError: DOMNode::C14N(): Argument #3 ($xpath) must have a "query" key +TypeError: DOMNode::C14N(): Argument #3 ($xpath) "query" option must be a string, array given diff --git a/ext/dom/tests/DOMNode_contains.phpt b/ext/dom/tests/DOMNode_contains.phpt index 5c18963804cf..dcefe06e85db 100644 --- a/ext/dom/tests/DOMNode_contains.phpt +++ b/ext/dom/tests/DOMNode_contains.phpt @@ -35,7 +35,7 @@ var_dump($dom->documentElement->contains(null)); try { var_dump($dom->contains(new stdClass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- True cases ---\n"; @@ -78,7 +78,7 @@ var_dump($dom->contains($main)); --EXPECT-- --- False edge cases --- bool(false) -DOMNode::contains(): Argument #1 ($other) must be of type DOMNode|DOMNameSpaceNode|null, stdClass given +TypeError: DOMNode::contains(): Argument #1 ($other) must be of type DOMNode|DOMNameSpaceNode|null, stdClass given --- True cases --- bool(true) bool(true) diff --git a/ext/dom/tests/DOMNode_insertBefore_error1.phpt b/ext/dom/tests/DOMNode_insertBefore_error1.phpt index 9b42ef46c9ef..df194bf1fb2e 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error1.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error1.phpt @@ -16,9 +16,9 @@ $node_in_doc2 = $doc2->createElement("bar"); try { $node_in_doc2->insertBefore($node_in_doc1); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Wrong Document Error +DOMException: Wrong Document Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error2.phpt b/ext/dom/tests/DOMNode_insertBefore_error2.phpt index 317eb897919e..d74f4b09bc33 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error2.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error2.phpt @@ -28,9 +28,9 @@ $ref_node = $dom->getElementsByTagName("book")->item(1); try { $parent_node->insertBefore($new_node, $ref_node); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error3.phpt b/ext/dom/tests/DOMNode_insertBefore_error3.phpt index 9fa25e3b2acd..1ff00f0d86ae 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error3.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error3.phpt @@ -29,9 +29,9 @@ assert(!is_null($ref_node)); try { $parent_node->insertBefore($new_node, $ref_node); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error4.phpt b/ext/dom/tests/DOMNode_insertBefore_error4.phpt index 41838bb78a1e..d6a21b29cce5 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error4.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error4.phpt @@ -28,9 +28,9 @@ $ref_node = $dom->createElement('newnode2'); try { $parent_node->insertBefore($new_node, $ref_node); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error5.phpt b/ext/dom/tests/DOMNode_insertBefore_error5.phpt index 17ac53820662..95e95808890a 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error5.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error5.phpt @@ -30,9 +30,9 @@ $dom->saveXML(); try { $parent_node->insertBefore($new_node, $ref_node); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOMNode_insertBefore_error6.phpt b/ext/dom/tests/DOMNode_insertBefore_error6.phpt index a8348791f175..81ddd7202a13 100644 --- a/ext/dom/tests/DOMNode_insertBefore_error6.phpt +++ b/ext/dom/tests/DOMNode_insertBefore_error6.phpt @@ -25,9 +25,9 @@ assert($new_node !== false); try { $parent_node->insertBefore($new_node, $ref_node); } catch(DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/DOMNode_removeChild_error1.phpt b/ext/dom/tests/DOMNode_removeChild_error1.phpt index 05d3c31624f9..401d87f5c299 100644 --- a/ext/dom/tests/DOMNode_removeChild_error1.phpt +++ b/ext/dom/tests/DOMNode_removeChild_error1.phpt @@ -14,7 +14,7 @@ $parent->appendChild($child2); try { $parent->removeChild($child1); } catch (DOMException $e) { - echo "DOMException: " . $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/dom/tests/DOMNode_replaceChild_error1.phpt b/ext/dom/tests/DOMNode_replaceChild_error1.phpt index f276fc8d207e..be7d72066d0b 100644 --- a/ext/dom/tests/DOMNode_replaceChild_error1.phpt +++ b/ext/dom/tests/DOMNode_replaceChild_error1.phpt @@ -15,7 +15,7 @@ $parent->appendChild($child2); try { $parent->replaceChild($child3, $child1); } catch (DOMException $e) { - echo "DOMException: " . $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/dom/tests/DOMNode_replaceChild_error2.phpt b/ext/dom/tests/DOMNode_replaceChild_error2.phpt index 160838a537d1..07450944f4a0 100644 --- a/ext/dom/tests/DOMNode_replaceChild_error2.phpt +++ b/ext/dom/tests/DOMNode_replaceChild_error2.phpt @@ -13,7 +13,7 @@ $b->appendChild($c); try { $b->replaceChild($a, $c); } catch (DOMException $e) { - echo "DOMException: " . $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/dom/tests/DOMProcessingInstruction.phpt b/ext/dom/tests/DOMProcessingInstruction.phpt index ca79e31966ef..a884ecbbcfb3 100644 --- a/ext/dom/tests/DOMProcessingInstruction.phpt +++ b/ext/dom/tests/DOMProcessingInstruction.phpt @@ -16,7 +16,7 @@ echo "--- Test construction ---\n"; try { $pi = new DOMProcessingInstruction("\0"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $pi = new DOMProcessingInstruction("test"); @@ -30,7 +30,7 @@ var_dump($pi->data); try { $pi->data = new FailingStringable; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($pi->data); $pi->data = 12345; @@ -53,28 +53,28 @@ $instance = $class->newInstanceWithoutConstructor(); try { var_dump($instance->target); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($instance->data); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $instance->data = "hello"; } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- --- Test construction --- -Invalid Character Error +DOMException: Invalid Character Error --- Test fields --- string(4) "test" string(0) "" string(2) "ok" -failed in __toString +Exception: failed in __toString string(2) "ok" string(5) "12345" string(10) "my data <>" @@ -82,6 +82,6 @@ string(10) "my data <>" ?> --- Test construction with __construct by reflection and fields --- -Invalid State Error -Invalid State Error -Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/DOMXPath_callables.phpt b/ext/dom/tests/DOMXPath_callables.phpt index 3d20527475da..6cb156a1e273 100644 --- a/ext/dom/tests/DOMXPath_callables.phpt +++ b/ext/dom/tests/DOMXPath_callables.phpt @@ -31,7 +31,7 @@ $xpath->registerNamespace("php", "http://php.net/xpath"); try { $xpath->evaluate("//a[php:function('var_dump', string(@href))]"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Legit cases: all ---\n"; @@ -55,7 +55,7 @@ $xpath->evaluate("//a[php:function('var_dump', string(@href))]"); try { $xpath->evaluate("//a[php:function('notinset', string(@href))]"); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Legit cases: set with cycle ---\n"; @@ -73,7 +73,7 @@ $xpath->evaluate("//a[php:function('var_dump', string(@href))]"); ?> --EXPECT-- --- Legit cases: none --- -No callbacks were registered +Error: No callbacks were registered --- Legit cases: all --- string(15) "https://php.net" string(15) "https://php.net" @@ -81,7 +81,7 @@ string(15) "https://php.net" string(15) "https://php.net" string(15) "https://php.net" string(15) "https://php.net" -No callback handler "notinset" registered +Error: No callback handler "notinset" registered --- Legit cases: set with cycle --- dummy: https://php.net --- Legit cases: reset to null --- diff --git a/ext/dom/tests/DOMXPath_callables_errors.phpt b/ext/dom/tests/DOMXPath_callables_errors.phpt index 10019474e7e7..ef2a26c4802d 100644 --- a/ext/dom/tests/DOMXPath_callables_errors.phpt +++ b/ext/dom/tests/DOMXPath_callables_errors.phpt @@ -12,49 +12,49 @@ $xpath = new DOMXPath($doc); try { $xpath->registerPhpFunctions("nonexistent"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions(function () {}); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions([function () {}]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions([var_dump(...)]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions(["nonexistent"]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions(["" => var_dump(...)]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions(["\0" => var_dump(...)]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctions(""); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = new class { @@ -67,17 +67,17 @@ try { $str = str_repeat($classes[count($classes) - 1] . '::dump', random_int(1, 1)); $xpath->registerPhpFunctions([$str]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a callable, function "nonexistent" not found or invalid function name -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be of type array|string|null, Closure given -Object of class Closure could not be converted to string -Object of class Closure could not be converted to string -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array with valid callbacks as values, function "nonexistent" not found or invalid function name -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a valid callback name -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names +TypeError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a callable, function "nonexistent" not found or invalid function name +TypeError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be of type array|string|null, Closure given +Error: Object of class Closure could not be converted to string +Error: Object of class Closure could not be converted to string +TypeError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array with valid callbacks as values, function "nonexistent" not found or invalid function name +ValueError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names +ValueError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names +ValueError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a valid callback name +ValueError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array containing valid callback names diff --git a/ext/dom/tests/DOMXPath_clone.phpt b/ext/dom/tests/DOMXPath_clone.phpt index 99cf1d4e08ca..f4cb7c0e5d75 100644 --- a/ext/dom/tests/DOMXPath_clone.phpt +++ b/ext/dom/tests/DOMXPath_clone.phpt @@ -14,9 +14,9 @@ $xpath = new DOMXPath($dom); try { clone $xpath; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class DOMXPath +Error: Trying to clone an uncloneable object of class DOMXPath diff --git a/ext/dom/tests/bug44648.phpt b/ext/dom/tests/bug44648.phpt index 9dca0c9d70fb..86bee20eba2b 100644 --- a/ext/dom/tests/bug44648.phpt +++ b/ext/dom/tests/bug44648.phpt @@ -14,32 +14,32 @@ try { $attr = new DOMAttr('@acb', '123'); $root->setAttributeNode($attr); } catch (DOMException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->setAttribute('@def', '456'); } catch (DOMException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->setAttributeNS(NULL, '@ghi', '789'); } catch (DOMException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->setAttributeNS('urn::test', 'a:g@hi', '789'); } catch (DOMException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML($root); ?> --EXPECT-- -Invalid Character Error -Invalid Character Error -Invalid Character Error -Namespace Error +DOMException: Invalid Character Error +DOMException: Invalid Character Error +DOMException: Invalid Character Error +DOMException: Namespace Error diff --git a/ext/dom/tests/bug47430.phpt b/ext/dom/tests/bug47430.phpt index f2428f73d3d5..a692c76b8c81 100644 --- a/ext/dom/tests/bug47430.phpt +++ b/ext/dom/tests/bug47430.phpt @@ -14,7 +14,7 @@ foreach ($elements as $i) { try { $i->previousSibling->nodeValue = ''; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -25,8 +25,8 @@ print_r($arr); ?> --EXPECT-- -Attempt to assign property "nodeValue" on null -Attempt to assign property "nodeValue" on null +Error: Attempt to assign property "nodeValue" on null +Error: Attempt to assign property "nodeValue" on null Array ( [0] => Value diff --git a/ext/dom/tests/bug66783.phpt b/ext/dom/tests/bug66783.phpt index a9feba9529a3..c760846f5389 100644 --- a/ext/dom/tests/bug66783.phpt +++ b/ext/dom/tests/bug66783.phpt @@ -10,8 +10,8 @@ $e = $doc->createElement('e'); try { $e->appendChild($doc); } catch (DOMException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/bug67949.phpt b/ext/dom/tests/bug67949.phpt index f087633bdfe6..4dd70608ad37 100644 --- a/ext/dom/tests/bug67949.phpt +++ b/ext/dom/tests/bug67949.phpt @@ -46,7 +46,7 @@ echo "--- testing read_dimension with null offset ---\n"; try { var_dump($nodes[][] = 1); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- testing attribute access ---\n"; @@ -87,7 +87,7 @@ Warning: Attempt to read property "textContent" on null in %s on line %d bool(false) NULL --- testing read_dimension with null offset --- -Cannot access DOMNodeList without offset +Error: Cannot access DOMNodeList without offset --- testing attribute access --- string(4) "href" ==DONE== diff --git a/ext/dom/tests/bug77569.phpt b/ext/dom/tests/bug77569.phpt index 68e6e87a04d4..9580fe79745d 100644 --- a/ext/dom/tests/bug77569.phpt +++ b/ext/dom/tests/bug77569.phpt @@ -9,8 +9,8 @@ $dom = $imp->createDocument("", ""); try { $dom->encoding = null; } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Invalid document encoding +ValueError: Invalid document encoding diff --git a/ext/dom/tests/c14n_no_nodeset_returned.phpt b/ext/dom/tests/c14n_no_nodeset_returned.phpt index 66efd8ba2b46..0643416d1ccc 100644 --- a/ext/dom/tests/c14n_no_nodeset_returned.phpt +++ b/ext/dom/tests/c14n_no_nodeset_returned.phpt @@ -9,8 +9,8 @@ $dom->loadXML('test'); try { $dom->documentElement->C14N(true, false, ['query' => 'string(./root/text())']); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -XPath query did not return a nodeset +Error: XPath query did not return a nodeset diff --git a/ext/dom/tests/clone_list_map_collection.phpt b/ext/dom/tests/clone_list_map_collection.phpt index 1eb91c46069b..a3b82705dea1 100644 --- a/ext/dom/tests/clone_list_map_collection.phpt +++ b/ext/dom/tests/clone_list_map_collection.phpt @@ -10,41 +10,41 @@ $dom->loadXML(''); try { clone $dom->documentElement->attributes; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone $dom->documentElement->childNodes; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom = Dom\XMLDocument::createFromString(']>'); try { clone $dom->documentElement->attributes; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone $dom->documentElement->childNodes; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone $dom->documentElement->children; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { clone $dom->doctype->entities; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class DOMNamedNodeMap -Trying to clone an uncloneable object of class DOMNodeList -Trying to clone an uncloneable object of class Dom\NamedNodeMap -Trying to clone an uncloneable object of class Dom\NodeList -Trying to clone an uncloneable object of class Dom\HTMLCollection -Trying to clone an uncloneable object of class Dom\DtdNamedNodeMap +Error: Trying to clone an uncloneable object of class DOMNamedNodeMap +Error: Trying to clone an uncloneable object of class DOMNodeList +Error: Trying to clone an uncloneable object of class Dom\NamedNodeMap +Error: Trying to clone an uncloneable object of class Dom\NodeList +Error: Trying to clone an uncloneable object of class Dom\HTMLCollection +Error: Trying to clone an uncloneable object of class Dom\DtdNamedNodeMap diff --git a/ext/dom/tests/delayed_freeing/direct_construction.phpt b/ext/dom/tests/delayed_freeing/direct_construction.phpt index 5162d6740177..6ec7bd72d7ec 100644 --- a/ext/dom/tests/delayed_freeing/direct_construction.phpt +++ b/ext/dom/tests/delayed_freeing/direct_construction.phpt @@ -9,12 +9,12 @@ function node_alike_test($test) { var_dump($test->parentNode); var_dump($test->nodeValue); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->appendChild($test)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -23,12 +23,12 @@ $test = new DOMCharacterData("test"); try { var_dump($test->textContent); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->appendData('test')); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Test DOMCdataSection --\n"; @@ -42,12 +42,12 @@ try { var_dump($test->wholeText); var_dump($test->parentNode); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->isWhitespaceInElementContent()); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Test DOMComment --\n"; @@ -63,7 +63,7 @@ var_dump($test->parentNode); try { var_dump($test->appendChild($test)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Test DOMNode --\n"; @@ -81,12 +81,12 @@ try { var_dump($test->nodeValue); var_dump($test->parentNode); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($test->appendChild($test)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Test DOMAttr --\n"; @@ -96,13 +96,13 @@ var_dump($test->parentNode); try { var_dump($test->appendChild($test)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -- Test DOMCharacterData -- -Invalid State Error -Couldn't fetch DOMCharacterData +DOMException: Invalid State Error +Error: Couldn't fetch DOMCharacterData -- Test DOMCdataSection -- string(4) "test" bool(true) @@ -117,21 +117,21 @@ int(0) -- Test DOMElement -- string(4) "test" NULL -No Modification Allowed Error +DOMException: No Modification Allowed Error -- Test DOMNode -- -Invalid State Error -Couldn't fetch DOMNode +DOMException: Invalid State Error +Error: Couldn't fetch DOMNode -- Test DOMNotation -- -Invalid State Error -Couldn't fetch DOMNotation +DOMException: Invalid State Error +Error: Couldn't fetch DOMNotation -- Test DOMProcessingInstruction -- NULL string(5) "value" bool(false) -- Test DOMEntity -- -Invalid State Error -Couldn't fetch DOMEntity +DOMException: Invalid State Error +Error: Couldn't fetch DOMEntity -- Test DOMAttr -- string(5) "value" NULL -No Modification Allowed Error +DOMException: No Modification Allowed Error diff --git a/ext/dom/tests/delayed_freeing/without_contructor.phpt b/ext/dom/tests/delayed_freeing/without_contructor.phpt index 4a5f63ed9acc..22b1c6cd556c 100644 --- a/ext/dom/tests/delayed_freeing/without_contructor.phpt +++ b/ext/dom/tests/delayed_freeing/without_contructor.phpt @@ -11,14 +11,14 @@ $node = $rc->newInstanceWithoutConstructor(); try { var_dump($node); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Call test try { $node->removeChild($node); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Import test @@ -26,13 +26,13 @@ $doc = new DOMDocument; try { $doc->appendChild($doc->importNode($node)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- object(DOMNode)#2 (0) { } -Invalid State Error -Couldn't fetch DOMNode -Couldn't fetch DOMNode +DOMException: Invalid State Error +Error: Couldn't fetch DOMNode +Error: Couldn't fetch DOMNode diff --git a/ext/dom/tests/dom_import_simplexml.phpt b/ext/dom/tests/dom_import_simplexml.phpt index e761bfa66d85..4a1818541305 100644 --- a/ext/dom/tests/dom_import_simplexml.phpt +++ b/ext/dom/tests/dom_import_simplexml.phpt @@ -17,7 +17,7 @@ print $dom->ownerDocument->saveXML(); try { Dom\import_simplexml($s); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -32,4 +32,4 @@ try { John Steinbeck -Dom\import_simplexml(): Argument #1 ($node) must not be already imported as a DOMNode +TypeError: Dom\import_simplexml(): Argument #1 ($node) must not be already imported as a DOMNode diff --git a/ext/dom/tests/dom_xinclude_errors.phpt b/ext/dom/tests/dom_xinclude_errors.phpt index fe3addf85916..8df006f630c7 100644 --- a/ext/dom/tests/dom_xinclude_errors.phpt +++ b/ext/dom/tests/dom_xinclude_errors.phpt @@ -15,9 +15,9 @@ $dom = Dom\XMLDocument::createEmpty(); try { $dom->xinclude(PHP_INT_MAX); } catch (ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Warning: DOMDocument::xinclude(): Invalid flags in %s on line %d -Dom\XMLDocument::xinclude(): Argument #1 ($options) is too large +ValueError: Dom\XMLDocument::xinclude(): Argument #1 ($options) is too large diff --git a/ext/dom/tests/domxpath.phpt b/ext/dom/tests/domxpath.phpt index cead1f8d5b7c..863978fb932c 100644 --- a/ext/dom/tests/domxpath.phpt +++ b/ext/dom/tests/domxpath.phpt @@ -55,13 +55,13 @@ try { $xpath->registerPHPFunctions('non_existent'); $avg = $xpath->evaluate('number(php:function("non_existent", //def:testnode))'); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $xpath->registerPhpFunctions(['non_existant']); $avg = $xpath->evaluate('number(php:function("non_existent", //def:testnode))'); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -69,5 +69,5 @@ myval float(1) bool(true) float(4) -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a callable, function "non_existent" not found or invalid function name -DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array with valid callbacks as values, function "non_existant" not found or invalid function name +TypeError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be a callable, function "non_existent" not found or invalid function name +TypeError: DOMXPath::registerPhpFunctions(): Argument #1 ($restrict) must be an array with valid callbacks as values, function "non_existant" not found or invalid function name diff --git a/ext/dom/tests/entity_reference_stale_02.phpt b/ext/dom/tests/entity_reference_stale_02.phpt index 9e25a2c0e94a..3127d543e8ac 100644 --- a/ext/dom/tests/entity_reference_stale_02.phpt +++ b/ext/dom/tests/entity_reference_stale_02.phpt @@ -27,7 +27,7 @@ unset($decl); try { var_dump($iter->current()->publicId); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/dom/tests/gh11830/attribute_variation.phpt b/ext/dom/tests/gh11830/attribute_variation.phpt index 34a6f094f58f..30716d67f8bc 100644 --- a/ext/dom/tests/gh11830/attribute_variation.phpt +++ b/ext/dom/tests/gh11830/attribute_variation.phpt @@ -15,41 +15,41 @@ XML); try { $doc->documentElement->firstElementChild->prepend($doc->documentElement->attributes[0]); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->append($doc->documentElement->attributes[0]); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->before($doc->documentElement->attributes[0]); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->after($doc->documentElement->attributes[0]); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->replaceWith($doc->documentElement->attributes[0]); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML(); ?> --EXPECT-- -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/gh11830/document_variation.phpt b/ext/dom/tests/gh11830/document_variation.phpt index 1f291b946878..94f054b59287 100644 --- a/ext/dom/tests/gh11830/document_variation.phpt +++ b/ext/dom/tests/gh11830/document_variation.phpt @@ -27,7 +27,7 @@ function test($method) { try { $doc->documentElement->firstElementChild->$method($testElement, $otherElement); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $otherDoc->saveXML(); @@ -41,7 +41,7 @@ test("after"); test("replaceWith"); ?> --EXPECT-- -Wrong Document Error +DOMException: Wrong Document Error @@ -49,7 +49,7 @@ Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error @@ -57,7 +57,7 @@ Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error @@ -65,7 +65,7 @@ Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error @@ -73,7 +73,7 @@ Wrong Document Error -Wrong Document Error +DOMException: Wrong Document Error diff --git a/ext/dom/tests/gh11830/hierarchy_variation.phpt b/ext/dom/tests/gh11830/hierarchy_variation.phpt index 443068461874..94dacc69d90e 100644 --- a/ext/dom/tests/gh11830/hierarchy_variation.phpt +++ b/ext/dom/tests/gh11830/hierarchy_variation.phpt @@ -21,7 +21,7 @@ function test($method) { try { $testElement->$method($alone, $container); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML(); @@ -34,13 +34,13 @@ test("after"); test("replaceWith"); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/gh11830/type_variation.phpt b/ext/dom/tests/gh11830/type_variation.phpt index 76732775e6db..f00bd96e7aad 100644 --- a/ext/dom/tests/gh11830/type_variation.phpt +++ b/ext/dom/tests/gh11830/type_variation.phpt @@ -18,41 +18,41 @@ $testElement = $doc->documentElement->firstElementChild->nextElementSibling->fir try { $doc->documentElement->firstElementChild->prepend($testElement, 0); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->append($testElement, true); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->before($testElement, null); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->after($testElement, new stdClass); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->firstElementChild->replaceWith($testElement, []); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML(); ?> --EXPECT-- -DOMElement::prepend(): Argument #2 must be of type DOMNode|string, int given -DOMElement::append(): Argument #2 must be of type DOMNode|string, bool given -DOMElement::before(): Argument #2 must be of type DOMNode|string, null given -DOMElement::after(): Argument #2 must be of type DOMNode|string, stdClass given -DOMElement::replaceWith(): Argument #2 must be of type DOMNode|string, array given +TypeError: DOMElement::prepend(): Argument #2 must be of type DOMNode|string, int given +TypeError: DOMElement::append(): Argument #2 must be of type DOMNode|string, bool given +TypeError: DOMElement::before(): Argument #2 must be of type DOMNode|string, null given +TypeError: DOMElement::after(): Argument #2 must be of type DOMNode|string, stdClass given +TypeError: DOMElement::replaceWith(): Argument #2 must be of type DOMNode|string, array given diff --git a/ext/dom/tests/gh12002.phpt b/ext/dom/tests/gh12002.phpt index 7d1ae944646a..410953267bfd 100644 --- a/ext/dom/tests/gh12002.phpt +++ b/ext/dom/tests/gh12002.phpt @@ -16,7 +16,7 @@ var_dump($dom->encoding); try { $dom->encoding = make_nonconst('foobar'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->encoding); $dom->encoding = make_nonconst('utf-16le'); @@ -24,15 +24,15 @@ var_dump($dom->encoding); try { $dom->encoding = NULL; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->encoding); ?> --EXPECT-- string(5) "utf-8" -Invalid document encoding +ValueError: Invalid document encoding string(5) "utf-8" string(8) "utf-16le" -Invalid document encoding +ValueError: Invalid document encoding string(8) "utf-16le" diff --git a/ext/dom/tests/gh13960.phpt b/ext/dom/tests/gh13960.phpt index fae628f49c07..3327a49fd118 100644 --- a/ext/dom/tests/gh13960.phpt +++ b/ext/dom/tests/gh13960.phpt @@ -10,8 +10,8 @@ $xp = new DOMXPath($domd); try { $xp->query("//foo[contains(text(), " . $xp->quote("tes\x00t") . ")]"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMXPath::quote(): Argument #1 ($str) must not contain any null bytes +ValueError: DOMXPath::quote(): Argument #1 ($str) must not contain any null bytes diff --git a/ext/dom/tests/gh15137.phpt b/ext/dom/tests/gh15137.phpt index c5ce1aca75be..6013cee2a566 100644 --- a/ext/dom/tests/gh15137.phpt +++ b/ext/dom/tests/gh15137.phpt @@ -8,4 +8,3 @@ var_dump(new DOMText()->wholeText); ?> --EXPECT-- string(0) "" - diff --git a/ext/dom/tests/gh15910.phpt b/ext/dom/tests/gh15910.phpt index c9b14a0b8663..e892bd5df789 100644 --- a/ext/dom/tests/gh15910.phpt +++ b/ext/dom/tests/gh15910.phpt @@ -11,8 +11,8 @@ $doc->appendChild($doc->createElement('container')); try { $doc->documentElement->setAttributeNodeNS($doc); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMElement::setAttributeNodeNS(): Argument #1 ($attr) must be of type DOMAttr, DOMDocument given +TypeError: DOMElement::setAttributeNodeNS(): Argument #1 ($attr) must be of type DOMAttr, DOMDocument given diff --git a/ext/dom/tests/gh16039.phpt b/ext/dom/tests/gh16039.phpt index 48a862eda7b2..57763cb3719e 100644 --- a/ext/dom/tests/gh16039.phpt +++ b/ext/dom/tests/gh16039.phpt @@ -10,22 +10,22 @@ $element = $dom->appendChild($dom->createElement('root')); try { $element->prepend('x', new DOMEntity); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(); $dom->strictErrorChecking = false; // Should not have influence try { $element->prepend('x', new DOMEntity); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(); ?> --EXPECT-- -Invalid State Error +DOMException: Invalid State Error -Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/gh16151.phpt b/ext/dom/tests/gh16151.phpt index e11d3df4a56b..5528e4640e21 100644 --- a/ext/dom/tests/gh16151.phpt +++ b/ext/dom/tests/gh16151.phpt @@ -14,12 +14,12 @@ $element->setAttributeNodeNS($attr); try { $attr->insertBefore(new DOMComment("h")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $attr->appendChild(new DOMComment("h")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $attr->insertBefore($doc->createEntityReference('amp')); @@ -29,7 +29,7 @@ echo $doc->saveXML(); ?> --EXPECT-- -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error W diff --git a/ext/dom/tests/gh16190.phpt b/ext/dom/tests/gh16190.phpt index d3d83b5eb49d..8755e167dcf4 100644 --- a/ext/dom/tests/gh16190.phpt +++ b/ext/dom/tests/gh16190.phpt @@ -10,9 +10,9 @@ $rm = new ReflectionMethod($doc, '__construct'); try { $rm->invoke($doc); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot directly construct Dom\XMLDocument, use document methods instead +Error: Cannot directly construct Dom\XMLDocument, use document methods instead diff --git a/ext/dom/tests/gh16316.phpt b/ext/dom/tests/gh16316.phpt index 43368746bc46..e75320eb57f8 100644 --- a/ext/dom/tests/gh16316.phpt +++ b/ext/dom/tests/gh16316.phpt @@ -13,13 +13,13 @@ $demo = new Demo; try { var_dump($demo); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($demo->document); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -28,5 +28,5 @@ object(Demo)#1 (1) { ["registerNodeNamespaces"]=> bool(true) } -Invalid State Error -Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/gh16465.phpt b/ext/dom/tests/gh16465.phpt index b09f5de7dcc3..a36227891b58 100644 --- a/ext/dom/tests/gh16465.phpt +++ b/ext/dom/tests/gh16465.phpt @@ -9,21 +9,21 @@ $v10 = new DOMElement("a"); try { $v10->getElementsByTagName("text\0something"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $v10->getElementsByTagNameNS("", "text\0something"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $v10->getElementsByTagNameNS("text\0something", ""); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMElement::getElementsByTagName(): Argument #1 ($qualifiedName) must not contain any null bytes -DOMElement::getElementsByTagNameNS(): Argument #2 ($localName) must not contain any null bytes -DOMElement::getElementsByTagNameNS(): Argument #1 ($namespace) must not contain any null bytes +ValueError: DOMElement::getElementsByTagName(): Argument #1 ($qualifiedName) must not contain any null bytes +ValueError: DOMElement::getElementsByTagNameNS(): Argument #2 ($localName) must not contain any null bytes +ValueError: DOMElement::getElementsByTagNameNS(): Argument #1 ($namespace) must not contain any null bytes diff --git a/ext/dom/tests/gh16533.phpt b/ext/dom/tests/gh16533.phpt index dad40e88b4d1..a1fcb1b9bd68 100644 --- a/ext/dom/tests/gh16533.phpt +++ b/ext/dom/tests/gh16533.phpt @@ -9,12 +9,12 @@ $doc = new DOMDocument(); try { $doc->appendChild($doc->createAttribute('foo')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML(); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/gh16535.phpt b/ext/dom/tests/gh16535.phpt index adb1dfa91f20..4ea210b9c60f 100644 --- a/ext/dom/tests/gh16535.phpt +++ b/ext/dom/tests/gh16535.phpt @@ -12,14 +12,14 @@ $v4 = $v2->createElement('foo'); try { $v4->appendChild($v2); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $v2->loadHTML("

oU

"); echo $v2->saveXML(); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error

oU

diff --git a/ext/dom/tests/gh16593.phpt b/ext/dom/tests/gh16593.phpt index 416d794a4f0d..c220dc406018 100644 --- a/ext/dom/tests/gh16593.phpt +++ b/ext/dom/tests/gh16593.phpt @@ -11,12 +11,12 @@ $child = $root->appendChild($doc->createElement('child')); try { $root->replaceChild($doc->createAttribute('foo'), $child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $doc->saveXML(); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/gh16594.phpt b/ext/dom/tests/gh16594.phpt index adfde5948eef..c77a85b7f313 100644 --- a/ext/dom/tests/gh16594.phpt +++ b/ext/dom/tests/gh16594.phpt @@ -17,9 +17,9 @@ $v7->appendChild($v1); try { $v1->before($v6); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/gh16777_1.phpt b/ext/dom/tests/gh16777_1.phpt index d821842ace4e..9fdcfc7d1840 100644 --- a/ext/dom/tests/gh16777_1.phpt +++ b/ext/dom/tests/gh16777_1.phpt @@ -14,11 +14,11 @@ $dom2 = new DOMDocument(); try { $dom2->appendChild($text); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- my value my new value -Wrong Document Error +DOMException: Wrong Document Error diff --git a/ext/dom/tests/gh16777_2.phpt b/ext/dom/tests/gh16777_2.phpt index a6f3a59621b4..4f66c9ff21b9 100644 --- a/ext/dom/tests/gh16777_2.phpt +++ b/ext/dom/tests/gh16777_2.phpt @@ -15,7 +15,7 @@ $dom2 = new DOMDocument(); try { $dom2->appendChild($el); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($child->ownerDocument === $doc); ?> @@ -23,5 +23,5 @@ var_dump($child->ownerDocument === $doc); -Wrong Document Error +DOMException: Wrong Document Error bool(true) diff --git a/ext/dom/tests/gh17847.phpt b/ext/dom/tests/gh17847.phpt index b2c4caff2fc7..59c37174d7ba 100644 --- a/ext/dom/tests/gh17847.phpt +++ b/ext/dom/tests/gh17847.phpt @@ -38,15 +38,15 @@ foreach ($garbage as $node) { try { var_dump($node->localName); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Invalid State Error -Invalid State Error -Invalid State Error -Invalid State Error -Invalid State Error -Invalid State Error -Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error +DOMException: Invalid State Error diff --git a/ext/dom/tests/modern/common/template_rename.phpt b/ext/dom/tests/modern/common/template_rename.phpt index a71126b21f22..d7e7276f0856 100644 --- a/ext/dom/tests/modern/common/template_rename.phpt +++ b/ext/dom/tests/modern/common/template_rename.phpt @@ -20,7 +20,7 @@ var_dump($template->innerHTML); try { $template->rename($template->namespaceURI, 'screwthis'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // These shouldn't be changed! @@ -30,6 +30,6 @@ var_dump($template->innerHTML); ?> --EXPECT-- string(16) "a
foo
b" -It is not possible to rename the template element because it hosts a document fragment +DOMException: It is not possible to rename the template element because it hosts a document fragment string(8) "TEMPLATE" string(16) "a
foo
b" diff --git a/ext/dom/tests/modern/css_selectors/closest_invalid_selector.phpt b/ext/dom/tests/modern/css_selectors/closest_invalid_selector.phpt index 81db6a72b686..9e7da22c59a5 100644 --- a/ext/dom/tests/modern/css_selectors/closest_invalid_selector.phpt +++ b/ext/dom/tests/modern/css_selectors/closest_invalid_selector.phpt @@ -10,9 +10,9 @@ $dom = DOM\XMLDocument::createFromString(""); try { var_dump($dom->documentElement->closest('@invalid')); } catch (DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Invalid selector (Selectors. Unexpected token: @invalid) +DOMException: Invalid selector (Selectors. Unexpected token: @invalid) diff --git a/ext/dom/tests/modern/css_selectors/combinators.phpt b/ext/dom/tests/modern/css_selectors/combinators.phpt index b43b07f59e82..b88ee5d2b6c7 100644 --- a/ext/dom/tests/modern/css_selectors/combinators.phpt +++ b/ext/dom/tests/modern/css_selectors/combinators.phpt @@ -57,7 +57,7 @@ test_helper($dom, 'article[title].bar p'); try { test_helper($dom, 'col.selected||td'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -110,4 +110,4 @@ try { --- Selector: article[title].bar p ---

Fifth p

--- Selector: col.selected||td --- -Dom\Document::querySelectorAll(): Argument #1 ($selectors) contains an unsupported selector +ValueError: Dom\Document::querySelectorAll(): Argument #1 ($selectors) contains an unsupported selector diff --git a/ext/dom/tests/modern/css_selectors/matches_invalid_selector.phpt b/ext/dom/tests/modern/css_selectors/matches_invalid_selector.phpt index 11cc4a942d24..6b3af8152cd4 100644 --- a/ext/dom/tests/modern/css_selectors/matches_invalid_selector.phpt +++ b/ext/dom/tests/modern/css_selectors/matches_invalid_selector.phpt @@ -10,9 +10,9 @@ $dom = DOM\XMLDocument::createFromString(""); try { var_dump($dom->documentElement->matches('@invalid')); } catch (DOMException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Invalid selector (Selectors. Unexpected token: @invalid) +DOMException: Invalid selector (Selectors. Unexpected token: @invalid) diff --git a/ext/dom/tests/modern/css_selectors/pseudo_classes_blank.phpt b/ext/dom/tests/modern/css_selectors/pseudo_classes_blank.phpt index b1be7db685d4..1fb303d1a9d1 100644 --- a/ext/dom/tests/modern/css_selectors/pseudo_classes_blank.phpt +++ b/ext/dom/tests/modern/css_selectors/pseudo_classes_blank.phpt @@ -14,10 +14,10 @@ XML); try { test_helper($dom, ':blank'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- --- Selector: :blank --- -:blank selector is not implemented because CSSWG has not yet decided its semantics (https://github.com/w3c/csswg-drafts/issues/1967) +DOMException: :blank selector is not implemented because CSSWG has not yet decided its semantics (https://github.com/w3c/csswg-drafts/issues/1967) diff --git a/ext/dom/tests/modern/extensions/Element_renaming_html_ns_02.phpt b/ext/dom/tests/modern/extensions/Element_renaming_html_ns_02.phpt index 76bc6fbd0cf4..36e5d05840c1 100644 --- a/ext/dom/tests/modern/extensions/Element_renaming_html_ns_02.phpt +++ b/ext/dom/tests/modern/extensions/Element_renaming_html_ns_02.phpt @@ -10,16 +10,16 @@ $el = $dom->createElementNS("http://www.w3.org/1999/xhtml", "foo:bar"); try { $el->rename("urn:a", "foo:baz"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $el = $dom->createElementNS("urn:a", "foo:bar"); try { $el->rename("http://www.w3.org/1999/xhtml", "foo:baz"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -It is not possible to move an element out of the HTML namespace because the HTML namespace is tied to the HTMLElement class -It is not possible to move an element into the HTML namespace because the HTML namespace is tied to the HTMLElement class +DOMException: It is not possible to move an element out of the HTML namespace because the HTML namespace is tied to the HTMLElement class +DOMException: It is not possible to move an element into the HTML namespace because the HTML namespace is tied to the HTMLElement class diff --git a/ext/dom/tests/modern/extensions/attribute_renaming_conflict.phpt b/ext/dom/tests/modern/extensions/attribute_renaming_conflict.phpt index a63437ebd80d..3c02f370c8f7 100644 --- a/ext/dom/tests/modern/extensions/attribute_renaming_conflict.phpt +++ b/ext/dom/tests/modern/extensions/attribute_renaming_conflict.phpt @@ -20,37 +20,37 @@ $root = $dom->documentElement; try { $root->attributes[0]->rename(NULL, 'c'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->attributes[0]->rename(NULL, 'c'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->attributes[1]->rename(NULL, 'a'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->attributes[1]->rename('urn:a', 'foo'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->attributes[3]->rename('', 'a'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->firstElementChild->attributes[0]->rename(NULL, 'hello'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $root->firstElementChild->attributes[1]->rename(NULL, 'my-attr'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // This is here to validate that nothing actually changed @@ -58,12 +58,12 @@ echo $dom->saveXML(); ?> --EXPECT-- -An attribute with the given name in the given namespace already exists -An attribute with the given name in the given namespace already exists -An attribute with the given name in the given namespace already exists -An attribute with the given name in the given namespace already exists -An attribute with the given name in the given namespace already exists -An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists +DOMException: An attribute with the given name in the given namespace already exists diff --git a/ext/dom/tests/modern/extensions/node_renaming_validation_errors.phpt b/ext/dom/tests/modern/extensions/node_renaming_validation_errors.phpt index 5f899c8e814d..49d7131f6b37 100644 --- a/ext/dom/tests/modern/extensions/node_renaming_validation_errors.phpt +++ b/ext/dom/tests/modern/extensions/node_renaming_validation_errors.phpt @@ -10,20 +10,20 @@ $dom = Dom\XMLDocument::createFromString(''); try { $dom->documentElement->rename('', 'a:b'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->documentElement->rename('urn:a', 'a:b:c'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(); ?> --EXPECT-- -Namespace Error -Invalid Character Error +DOMException: Namespace Error +DOMException: Invalid Character Error diff --git a/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromFile_override_encoding.phpt b/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromFile_override_encoding.phpt index 6b87f1d4714a..bf2dfa3c9397 100644 --- a/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromFile_override_encoding.phpt +++ b/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromFile_override_encoding.phpt @@ -8,7 +8,7 @@ dom try { Dom\HTMLDocument::createFromFile(__DIR__ . '/gb18030_without_charset.html', overrideEncoding: 'nonexistent'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // The override encoding matches with the document encoding attribute @@ -23,7 +23,7 @@ var_dump($dom->charset); ?> --EXPECT-- -Dom\HTMLDocument::createFromFile(): Argument #3 ($overrideEncoding) must be a valid document encoding +ValueError: Dom\HTMLDocument::createFromFile(): Argument #3 ($overrideEncoding) must be a valid document encoding string(20) " Héllo, world! " diff --git a/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromString_override_encoding.phpt b/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromString_override_encoding.phpt index 75984d6acd97..a71c7c02c5f8 100644 --- a/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromString_override_encoding.phpt +++ b/ext/dom/tests/modern/html/encoding/HTMLDocument_createFromString_override_encoding.phpt @@ -8,7 +8,7 @@ dom try { Dom\HTMLDocument::createFromString(file_get_contents(__DIR__ . '/gb18030_without_charset.html'), overrideEncoding: 'nonexistent'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // The override encoding matches with the document encoding attribute @@ -23,7 +23,7 @@ var_dump($dom->charset); ?> --EXPECT-- -Dom\HTMLDocument::createFromString(): Argument #3 ($overrideEncoding) must be a valid document encoding +ValueError: Dom\HTMLDocument::createFromString(): Argument #3 ($overrideEncoding) must be a valid document encoding string(20) " Héllo, world! " diff --git a/ext/dom/tests/modern/html/encoding/HTMLDocument_encoding_field_test.phpt b/ext/dom/tests/modern/html/encoding/HTMLDocument_encoding_field_test.phpt index c4417d804108..6610c88ce71e 100644 --- a/ext/dom/tests/modern/html/encoding/HTMLDocument_encoding_field_test.phpt +++ b/ext/dom/tests/modern/html/encoding/HTMLDocument_encoding_field_test.phpt @@ -12,7 +12,7 @@ var_dump($dom->characterSet); try { $dom->charset = "nope"; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->charset); $dom->inputEncoding = "Windows-1251"; @@ -20,7 +20,7 @@ var_dump($dom->characterSet); try { $dom->charset = ""; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->inputEncoding); echo $dom->saveHtml(); @@ -28,16 +28,16 @@ echo $dom->saveHtml(); try { $dom = Dom\HTMLDocument::createEmpty("bogus"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(5) "UTF-8" string(6) "EUC-KR" -Invalid document encoding +ValueError: Invalid document encoding string(6) "EUC-KR" string(12) "windows-1251" -Invalid document encoding +ValueError: Invalid document encoding string(12) "windows-1251" -Dom\HTMLDocument::createEmpty(): Argument #1 ($encoding) must be a valid document encoding +ValueError: Dom\HTMLDocument::createEmpty(): Argument #1 ($encoding) must be a valid document encoding diff --git a/ext/dom/tests/modern/html/interactions/Document_body_setter_errors.phpt b/ext/dom/tests/modern/html/interactions/Document_body_setter_errors.phpt index 1f934fcff890..19eeee216037 100644 --- a/ext/dom/tests/modern/html/interactions/Document_body_setter_errors.phpt +++ b/ext/dom/tests/modern/html/interactions/Document_body_setter_errors.phpt @@ -12,7 +12,7 @@ function testNormalReplace($cb) try { $dom->body = $cb($dom); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->body?->nodeName); } @@ -34,7 +34,7 @@ $dom = DOM\XMLDocument::createEmpty(); try { $dom->body = $dom->createElementNS("http://www.w3.org/1999/xhtml", "body"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->body?->nodeName); @@ -42,20 +42,20 @@ var_dump($dom->body?->nodeName); --EXPECT-- --- Set body to NULL --- string(4) "BODY" -The new body must either be a body or a frameset tag +DOMException: The new body must either be a body or a frameset tag string(4) "BODY" --- Wrong element tag in right namespace --- string(4) "BODY" -The new body must either be a body or a frameset tag +DOMException: The new body must either be a body or a frameset tag string(4) "BODY" --- Right element tag in wrong namespace --- string(4) "BODY" -Cannot assign Dom\Element to property Dom\Document::$body of type ?Dom\HTMLElement +TypeError: Cannot assign Dom\Element to property Dom\Document::$body of type ?Dom\HTMLElement string(4) "BODY" --- Right element tag in no namespace --- string(4) "BODY" -Cannot assign Dom\Element to property Dom\Document::$body of type ?Dom\HTMLElement +TypeError: Cannot assign Dom\Element to property Dom\Document::$body of type ?Dom\HTMLElement string(4) "BODY" --- Set body without document element --- -A body can only be set if there is a document element +DOMException: A body can only be set if there is a document element NULL diff --git a/ext/dom/tests/modern/html/interactions/Dom_Element_insertAdjacentHTML_errors.phpt b/ext/dom/tests/modern/html/interactions/Dom_Element_insertAdjacentHTML_errors.phpt index b8e13ba436b6..9561ad87af2a 100644 --- a/ext/dom/tests/modern/html/interactions/Dom_Element_insertAdjacentHTML_errors.phpt +++ b/ext/dom/tests/modern/html/interactions/Dom_Element_insertAdjacentHTML_errors.phpt @@ -13,7 +13,7 @@ echo "--- BeforeBegin no parent ---\n"; try { $element->insertAdjacentHTML(Dom\AdjacentPosition::BeforeBegin, "test"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- AfterEnd no parent ---\n"; @@ -21,7 +21,7 @@ echo "--- AfterEnd no parent ---\n"; try { $element->insertAdjacentHTML(Dom\AdjacentPosition::AfterEnd, "test"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom->appendChild($element); @@ -31,7 +31,7 @@ echo "--- BeforeBegin document parent ---\n"; try { $element->insertAdjacentHTML(Dom\AdjacentPosition::BeforeBegin, "test"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- AfterEnd document parent ---\n"; @@ -39,16 +39,16 @@ echo "--- AfterEnd document parent ---\n"; try { $element->insertAdjacentHTML(Dom\AdjacentPosition::AfterEnd, "test"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- --- BeforeBegin no parent --- -No Modification Allowed Error +DOMException: No Modification Allowed Error --- AfterEnd no parent --- -No Modification Allowed Error +DOMException: No Modification Allowed Error --- BeforeBegin document parent --- -No Modification Allowed Error +DOMException: No Modification Allowed Error --- AfterEnd document parent --- -No Modification Allowed Error +DOMException: No Modification Allowed Error diff --git a/ext/dom/tests/modern/html/interactions/HTMLCollection_dimension_errors.phpt b/ext/dom/tests/modern/html/interactions/HTMLCollection_dimension_errors.phpt index 571f94e4d340..83b4476a233e 100644 --- a/ext/dom/tests/modern/html/interactions/HTMLCollection_dimension_errors.phpt +++ b/ext/dom/tests/modern/html/interactions/HTMLCollection_dimension_errors.phpt @@ -10,23 +10,23 @@ $dom = Dom\XMLDocument::createFromString(''); try { $dom->getElementsByTagName('root')[][1] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->getElementsByTagName('root')[true]; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { isset($dom->getElementsByTagName('root')[true]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot append to Dom\HTMLCollection -Cannot access offset of type bool on Dom\HTMLCollection -Cannot access offset of type bool in isset or empty +Error: Cannot append to Dom\HTMLCollection +TypeError: Cannot access offset of type bool on Dom\HTMLCollection +TypeError: Cannot access offset of type bool in isset or empty diff --git a/ext/dom/tests/modern/html/interactions/HTMLDocument_registerNodeClass_02.phpt b/ext/dom/tests/modern/html/interactions/HTMLDocument_registerNodeClass_02.phpt index 70be58a906ba..8e6139206b1a 100644 --- a/ext/dom/tests/modern/html/interactions/HTMLDocument_registerNodeClass_02.phpt +++ b/ext/dom/tests/modern/html/interactions/HTMLDocument_registerNodeClass_02.phpt @@ -14,7 +14,7 @@ $dom = Dom\HTMLDocument::createEmpty(); try { $dom->registerNodeClass("Dom\\Document", "Custom"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $element = $dom->appendChild($dom->createElement("foo")); @@ -27,7 +27,7 @@ $element->ownerDocument->foo(); ?> --EXPECTF-- -Dom\Document::registerNodeClass(): Argument #1 ($baseClass) must not be an abstract class +ValueError: Dom\Document::registerNodeClass(): Argument #1 ($baseClass) must not be an abstract class string(16) "Dom\HTMLDocument" Fatal error: Uncaught Error: Call to undefined method Dom\HTMLDocument::foo() in %s:%d diff --git a/ext/dom/tests/modern/html/interactions/without_constructor.phpt b/ext/dom/tests/modern/html/interactions/without_constructor.phpt index 96cd131b0391..cd19fb88a20d 100644 --- a/ext/dom/tests/modern/html/interactions/without_constructor.phpt +++ b/ext/dom/tests/modern/html/interactions/without_constructor.phpt @@ -10,11 +10,11 @@ foreach (['Dom\HTMLDocument', 'Dom\XMLDocument'] as $class) { $rc = new ReflectionClass($class); $rc->newInstanceWithoutConstructor(); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Class Dom\HTMLDocument is an internal class marked as final that cannot be instantiated without invoking its constructor -Class Dom\XMLDocument is an internal class marked as final that cannot be instantiated without invoking its constructor +ReflectionException: Class Dom\HTMLDocument is an internal class marked as final that cannot be instantiated without invoking its constructor +ReflectionException: Class Dom\XMLDocument is an internal class marked as final that cannot be instantiated without invoking its constructor diff --git a/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_nul_terminator_cases_path.phpt b/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_nul_terminator_cases_path.phpt index 37cf161ec045..c664813330d1 100644 --- a/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_nul_terminator_cases_path.phpt +++ b/ext/dom/tests/modern/html/parser/HTMLDocument_fromFile_nul_terminator_cases_path.phpt @@ -8,15 +8,15 @@ dom try { Dom\HTMLDocument::createFromFile("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Dom\HTMLDocument::createFromFile('%00'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Dom\HTMLDocument::createFromFile(): Argument #1 ($path) must not contain any null bytes -Dom\HTMLDocument::createFromFile(): Argument #1 ($path) must not contain percent-encoded NUL bytes +ValueError: Dom\HTMLDocument::createFromFile(): Argument #1 ($path) must not contain any null bytes +ValueError: Dom\HTMLDocument::createFromFile(): Argument #1 ($path) must not contain percent-encoded NUL bytes diff --git a/ext/dom/tests/modern/html/parser/HTMLDocument_parse_options.phpt b/ext/dom/tests/modern/html/parser/HTMLDocument_parse_options.phpt index f61ef2dec867..4ea6425d4a7e 100644 --- a/ext/dom/tests/modern/html/parser/HTMLDocument_parse_options.phpt +++ b/ext/dom/tests/modern/html/parser/HTMLDocument_parse_options.phpt @@ -32,7 +32,7 @@ foreach (["createFromString", "createFromFile"] as $method) { try { Dom\HTMLDocument::{$method}("x", $options); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -41,67 +41,67 @@ foreach (["createFromString", "createFromFile"] as $method) { --EXPECTF-- --- Method createFromString --- int(%d) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4194304) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(524288) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(8) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(16) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(256) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(16384) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(2) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(1024) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(1) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(2048) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(64) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(128) -Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) --- Method createFromFile --- int(%d) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4194304) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(524288) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(8) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(16) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(256) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(16384) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(4) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(2) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(1024) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(1) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(2048) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(64) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) int(128) -Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) +ValueError: Dom\HTMLDocument::createFromFile(): Argument #2 ($options) contains invalid flags (allowed flags: LIBXML_NOERROR, LIBXML_COMPACT, LIBXML_HTML_NOIMPLIED, Dom\HTML_NO_DEFAULT_NS) diff --git a/ext/dom/tests/modern/spec/CharacterData_deleteData_negative_in_bounds_length.phpt b/ext/dom/tests/modern/spec/CharacterData_deleteData_negative_in_bounds_length.phpt index f29a201ca106..a620c7420df7 100644 --- a/ext/dom/tests/modern/spec/CharacterData_deleteData_negative_in_bounds_length.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_deleteData_negative_in_bounds_length.phpt @@ -19,7 +19,7 @@ $comment = $dom->createComment("foobarbaz"); try { $comment->deleteData(3, -1); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; @@ -28,5 +28,5 @@ echo $dom->saveHtml($comment), "\n"; --- Modern behaviour --- --- Legacy behaviour --- -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_insertData_edge_cases.phpt b/ext/dom/tests/modern/spec/CharacterData_insertData_edge_cases.phpt index 9369bdadbffa..b439c221f217 100644 --- a/ext/dom/tests/modern/spec/CharacterData_insertData_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_insertData_edge_cases.phpt @@ -12,17 +12,17 @@ $comment = $dom->createComment("foobarbaz"); try { var_dump($comment->insertData(100, "data")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($comment->insertData(2**31+1, "data")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; ?> --EXPECT-- -Index Size Error -Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset.phpt b/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset.phpt index f00e9aa76aae..eab9a89c4830 100644 --- a/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset.phpt @@ -10,7 +10,7 @@ $comment = $dom->createComment("foobarbaz"); try { $comment->insertData(-1, "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; $comment->insertData(1, "A"); @@ -18,6 +18,6 @@ echo $dom->saveHtml($comment), "\n"; ?> --EXPECT-- -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset_mod32.phpt b/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset_mod32.phpt index 7c27c3bc8dd5..06999256fda3 100644 --- a/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset_mod32.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_insertData_negative_offset_mod32.phpt @@ -16,7 +16,7 @@ $comment = $dom->createComment("foobarbaz"); try { $comment->insertData(-1, "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; $comment->insertData(-(2**32 - 1), "A"); @@ -29,24 +29,24 @@ $comment = $dom->createComment("foobarbaz"); try { $comment->insertData(-1, "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; try { $comment->insertData(-(2**32 - 1), "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; ?> --EXPECT-- --- Modern behaviour --- -Index Size Error +DOMException: Index Size Error --- Legacy behaviour --- -Index Size Error +DOMException: Index Size Error -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_replaceData_negative_count_mod32.phpt b/ext/dom/tests/modern/spec/CharacterData_replaceData_negative_count_mod32.phpt index 64634b099257..35ae5ad80618 100644 --- a/ext/dom/tests/modern/spec/CharacterData_replaceData_negative_count_mod32.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_replaceData_negative_count_mod32.phpt @@ -26,13 +26,13 @@ $comment = $dom->createComment("foobarbaz"); try { $comment->replaceData(0, -1, "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; try { $comment->replaceData(2, -(2**32 - 2), "A"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; @@ -42,7 +42,7 @@ echo $dom->saveHtml($comment), "\n"; --- Legacy behaviour --- -Index Size Error +DOMException: Index Size Error -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_substringData_edge_cases.phpt b/ext/dom/tests/modern/spec/CharacterData_substringData_edge_cases.phpt index c463c0f7057c..770d6d6ca6e2 100644 --- a/ext/dom/tests/modern/spec/CharacterData_substringData_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_substringData_edge_cases.phpt @@ -12,23 +12,23 @@ $comment = $dom->createComment("foobarbaz"); try { var_dump($comment->substringData(0, 2**31+1)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($comment->substringData(2**31+1, 0)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($comment->substringData(100, 0)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; ?> --EXPECT-- -Index Size Error -Index Size Error -Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments.phpt b/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments.phpt index 28198d94d6d5..3d0941cd82e1 100644 --- a/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments.phpt @@ -14,7 +14,7 @@ echo $dom->saveHtml($comment), "\n"; try { var_dump($comment->substringData(-2, 2)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; @@ -24,5 +24,5 @@ string(9) "foobarbaz" string(7) "obarbaz" -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments_mod32.phpt b/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments_mod32.phpt index 7d38bd28d441..398327d2cf62 100644 --- a/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments_mod32.phpt +++ b/ext/dom/tests/modern/spec/CharacterData_substringData_negative_arguments_mod32.phpt @@ -27,19 +27,19 @@ $comment = $dom->createComment("foobarbaz"); try { var_dump($comment->substringData(0, -1)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; try { var_dump($comment->substringData(2, -(2**32 - 2))); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; try { var_dump($comment->substringData(-(2**32 - 2), 2)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml($comment), "\n"; @@ -53,9 +53,9 @@ string(2) "ob" string(2) "ob" --- Legacy behaviour --- -Index Size Error +DOMException: Index Size Error -Index Size Error +DOMException: Index Size Error -Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/Document_createAttributeNS.phpt b/ext/dom/tests/modern/spec/Document_createAttributeNS.phpt index 6441ee60ef4f..b4764f6a95f8 100644 --- a/ext/dom/tests/modern/spec/Document_createAttributeNS.phpt +++ b/ext/dom/tests/modern/spec/Document_createAttributeNS.phpt @@ -12,7 +12,7 @@ function testErrorCase($dom, $ns, $qname) { $dom->createAttributeNS($ns, $qname); } catch (DOMException $e) { $ns_readable = is_null($ns) ? 'null' : "\"$ns\""; - echo "($ns_readable, \"$qname\"): {$e->getMessage()}\n"; + echo "($ns_readable, \"$qname\"): ", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -68,13 +68,13 @@ echo $dom->saveHtml(), "\n"; ?> --EXPECT-- --- Error cases --- -("", "bar:bar"): Namespace Error -(null, "bar:bar"): Namespace Error -("urn:a", "@"): Invalid Character Error -("urn:a", "foo:bar:baz"): Invalid Character Error -("http://www.w3.org/2000/xmlns", "xmlns"): Namespace Error -("http://www.w3.org/2000/xmlns", "xmlns:bar"): Namespace Error -("http://www.w3.org/2000/xmlns", "xml:foo"): Namespace Error +("", "bar:bar"): DOMException: Namespace Error +(null, "bar:bar"): DOMException: Namespace Error +("urn:a", "@"): DOMException: Invalid Character Error +("urn:a", "foo:bar:baz"): DOMException: Invalid Character Error +("http://www.w3.org/2000/xmlns", "xmlns"): DOMException: Namespace Error +("http://www.w3.org/2000/xmlns", "xmlns:bar"): DOMException: Namespace Error +("http://www.w3.org/2000/xmlns", "xml:foo"): DOMException: Namespace Error --- Normal cases --- Attr: xmlns:foo diff --git a/ext/dom/tests/modern/spec/Document_createElementNS.phpt b/ext/dom/tests/modern/spec/Document_createElementNS.phpt index cbdbe5dfd983..b08ea8c7a5d3 100644 --- a/ext/dom/tests/modern/spec/Document_createElementNS.phpt +++ b/ext/dom/tests/modern/spec/Document_createElementNS.phpt @@ -33,7 +33,7 @@ function testError($dom, $namespaceURI, $qualifiedName) try { $dom->createElementNS($namespaceURI, $qualifiedName); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -89,8 +89,8 @@ namespaceURI: string(36) "http://www.w3.org/XML/1998/namespace" &hello --- Error cases --- -(NULL, "prefix:name"): Namespace Error -("", "prefix:name"): Namespace Error -("urn:foo", "@"): Invalid Character Error -("http://www.w3.org/2000/xmlns/", "svg"): Namespace Error -("urn:foo", "xml:xml"): Namespace Error +(NULL, "prefix:name"): DOMException: Namespace Error +("", "prefix:name"): DOMException: Namespace Error +("urn:foo", "@"): DOMException: Invalid Character Error +("http://www.w3.org/2000/xmlns/", "svg"): DOMException: Namespace Error +("urn:foo", "xml:xml"): DOMException: Namespace Error diff --git a/ext/dom/tests/modern/spec/Document_createElement_edge_cases.phpt b/ext/dom/tests/modern/spec/Document_createElement_edge_cases.phpt index 6d8fc878b6ce..e36c99013047 100644 --- a/ext/dom/tests/modern/spec/Document_createElement_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/Document_createElement_edge_cases.phpt @@ -9,15 +9,15 @@ $dom = Dom\HTMLDocument::createEmpty(); try { $dom->createElement(''); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->createElement('$'); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid Character Error -Invalid Character Error +DOMException: Invalid Character Error +DOMException: Invalid Character Error diff --git a/ext/dom/tests/modern/spec/Document_implementation_createDocumentType_errors.phpt b/ext/dom/tests/modern/spec/Document_implementation_createDocumentType_errors.phpt index 74e17fb5a4f0..4731bf309afe 100644 --- a/ext/dom/tests/modern/spec/Document_implementation_createDocumentType_errors.phpt +++ b/ext/dom/tests/modern/spec/Document_implementation_createDocumentType_errors.phpt @@ -9,21 +9,21 @@ $dom = Dom\XMLDocument::createEmpty(); try { $dom->implementation->createDocumentType("invalid name", "public", "system"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->implementation->createDocumentType("", "public", "system"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->implementation->createDocumentType("@", "", ""); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Namespace Error -Namespace Error -Namespace Error +DOMException: Namespace Error +DOMException: Namespace Error +DOMException: Namespace Error diff --git a/ext/dom/tests/modern/spec/Document_implementation_createDocument_errors.phpt b/ext/dom/tests/modern/spec/Document_implementation_createDocument_errors.phpt index 673aed3ef556..0634df25f28e 100644 --- a/ext/dom/tests/modern/spec/Document_implementation_createDocument_errors.phpt +++ b/ext/dom/tests/modern/spec/Document_implementation_createDocument_errors.phpt @@ -10,16 +10,16 @@ $dom = Dom\XMLDocument::createEmpty(); try { $dom->implementation->createDocument("urn:a", "@"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->implementation->createDocument("", "foo:bar"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid Character Error -Namespace Error +DOMException: Invalid Character Error +DOMException: Namespace Error diff --git a/ext/dom/tests/modern/spec/Document_implementation_same_object.phpt b/ext/dom/tests/modern/spec/Document_implementation_same_object.phpt index 690b2bf63584..e8e3cb25d876 100644 --- a/ext/dom/tests/modern/spec/Document_implementation_same_object.phpt +++ b/ext/dom/tests/modern/spec/Document_implementation_same_object.phpt @@ -18,7 +18,7 @@ var_dump($implementation); try { clone $implementation; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -28,4 +28,4 @@ bool(true) bool(false) object(Dom\Implementation)#2 (0) { } -Trying to clone an uncloneable object of class Dom\Implementation +Error: Trying to clone an uncloneable object of class Dom\Implementation diff --git a/ext/dom/tests/modern/spec/Document_importNode_not_supported.phpt b/ext/dom/tests/modern/spec/Document_importNode_not_supported.phpt index 9f02411fd8bb..090fb4e20ae2 100644 --- a/ext/dom/tests/modern/spec/Document_importNode_not_supported.phpt +++ b/ext/dom/tests/modern/spec/Document_importNode_not_supported.phpt @@ -14,11 +14,11 @@ $dom = Dom\HTMLDocument::createEmpty(); try { $dom->importNode($dom); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: DOMDocument::importNode(): Cannot import: Node Type Not Supported in %s on line %d bool(false) -Not Supported Error +DOMException: Not Supported Error diff --git a/ext/dom/tests/modern/spec/Element_insertAdjacentText.phpt b/ext/dom/tests/modern/spec/Element_insertAdjacentText.phpt index ef466817de89..ac015604ae20 100644 --- a/ext/dom/tests/modern/spec/Element_insertAdjacentText.phpt +++ b/ext/dom/tests/modern/spec/Element_insertAdjacentText.phpt @@ -10,7 +10,7 @@ $foo = $dom->appendChild($dom->createElement("foo")); try { $foo->insertAdjacentText(Dom\AdjacentPosition::BeforeBegin, "bar"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $foo->insertAdjacentText(Dom\AdjacentPosition::AfterBegin, "bar"); @@ -23,7 +23,7 @@ var_dump($foo->firstChild->nextSibling->textContent); ?> --EXPECT-- -Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document barbaz string(3) "bar" string(3) "baz" diff --git a/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt b/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt index cb623f702983..0b4d1d31ee30 100644 --- a/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt +++ b/ext/dom/tests/modern/spec/Element_prefix_readonly.phpt @@ -9,10 +9,10 @@ $div = $dom->createElement('div'); try { $div->prefix = "foo"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXml(); ?> --EXPECT-- -Cannot modify private(set) property Dom\Element::$prefix from global scope +Error: Cannot modify private(set) property Dom\Element::$prefix from global scope diff --git a/ext/dom/tests/modern/spec/Element_removeAttribute_edge_cases.phpt b/ext/dom/tests/modern/spec/Element_removeAttribute_edge_cases.phpt index e50ef36e31fa..51c274b5e698 100644 --- a/ext/dom/tests/modern/spec/Element_removeAttribute_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/Element_removeAttribute_edge_cases.phpt @@ -9,9 +9,9 @@ $dom = Dom\XMLDocument::createFromString(''); try { $dom->documentElement->removeAttributeNode($dom->createAttribute('test')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/modern/spec/Element_setAttributeNS.phpt b/ext/dom/tests/modern/spec/Element_setAttributeNS.phpt index a38048a47ce9..6091ac339a06 100644 --- a/ext/dom/tests/modern/spec/Element_setAttributeNS.phpt +++ b/ext/dom/tests/modern/spec/Element_setAttributeNS.phpt @@ -21,7 +21,7 @@ echo "--- name validation ---\n"; try { $container->setAttributeNS("urn:a", "a:b:c", ""); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- ns attributes with same namespace but different prefix ---\n"; @@ -53,7 +53,7 @@ string(5) "xmlns" string(9) "xmlns:foo" string(29) "http://www.w3.org/2000/xmlns/" --- name validation --- -Invalid Character Error +DOMException: Invalid Character Error --- ns attributes with same namespace but different prefix --- Attr: y:foo diff --git a/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt b/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt index ddbfbde7e616..e23e4960a27b 100644 --- a/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt +++ b/ext/dom/tests/modern/spec/Element_setAttributeNode_inuse.phpt @@ -14,11 +14,11 @@ $element = $container->appendChild($dom1->createElement("element")); try { $element->setAttributeNode($attr1); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom1->saveHtml(), "\n"; ?> --EXPECT-- -Inuse Attribute Error +DOMException: Inuse Attribute Error diff --git a/ext/dom/tests/modern/spec/HTMLDocument_createCDATASection.phpt b/ext/dom/tests/modern/spec/HTMLDocument_createCDATASection.phpt index 1787ae29f95d..2ec04e209a75 100644 --- a/ext/dom/tests/modern/spec/HTMLDocument_createCDATASection.phpt +++ b/ext/dom/tests/modern/spec/HTMLDocument_createCDATASection.phpt @@ -9,13 +9,13 @@ try { $dom->createCDATASection("foo"); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->createCDATASection("]]>"); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom = Dom\XMLDocument::createEmpty(); @@ -23,14 +23,14 @@ try { $dom->createCDATASection("]]>"); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom->createCDATASection("]>"); ?> --EXPECT-- int(9) -This operation is not supported for HTML documents +DOMException: This operation is not supported for HTML documents int(9) -This operation is not supported for HTML documents +DOMException: This operation is not supported for HTML documents int(5) -Invalid character sequence "]]>" in CDATA section +DOMException: Invalid character sequence "]]>" in CDATA section diff --git a/ext/dom/tests/modern/spec/HTMLDocument_createProcessingInstruction.phpt b/ext/dom/tests/modern/spec/HTMLDocument_createProcessingInstruction.phpt index f1a60b875b1d..8281ee4676e9 100644 --- a/ext/dom/tests/modern/spec/HTMLDocument_createProcessingInstruction.phpt +++ b/ext/dom/tests/modern/spec/HTMLDocument_createProcessingInstruction.phpt @@ -9,19 +9,19 @@ try { $dom->createProcessingInstruction("?>", ""); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->createProcessingInstruction("?>", "?>"); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->createProcessingInstruction("target", "?>"); } catch (DOMException $e) { var_dump($e->getCode()); - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom->appendChild($dom->createProcessingInstruction("foo", "")); $dom->appendChild($dom->createProcessingInstruction("foo", "bar")); @@ -29,9 +29,9 @@ echo $dom->saveHtml(); ?> --EXPECT-- int(5) -Invalid Character Error +DOMException: Invalid Character Error int(5) -Invalid Character Error +DOMException: Invalid Character Error int(5) -Invalid character sequence "?>" in processing instruction +DOMException: Invalid character sequence "?>" in processing instruction diff --git a/ext/dom/tests/modern/spec/NamedNodeMap_dimensions.phpt b/ext/dom/tests/modern/spec/NamedNodeMap_dimensions.phpt index cf446881559b..e95288e21c85 100644 --- a/ext/dom/tests/modern/spec/NamedNodeMap_dimensions.phpt +++ b/ext/dom/tests/modern/spec/NamedNodeMap_dimensions.phpt @@ -15,7 +15,7 @@ foreach ($test_values as $value) { try { var_dump($attributes[$value] ? $attributes[$value]->nodeName : "N/A", isset($attributes[$value]), empty($attributes[$value])); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -58,9 +58,9 @@ string(1) "b" bool(true) bool(false) --- true --- -Cannot access offset of type bool on Dom\NamedNodeMap +TypeError: Cannot access offset of type bool on Dom\NamedNodeMap --- null --- -Cannot access offset of type null on Dom\NamedNodeMap +TypeError: Cannot access offset of type null on Dom\NamedNodeMap --- "0" --- string(1) "a" bool(true) diff --git a/ext/dom/tests/modern/spec/NamedNodeMap_dimensions_errors.phpt b/ext/dom/tests/modern/spec/NamedNodeMap_dimensions_errors.phpt index 848b1a2c0b02..7833fb02e286 100644 --- a/ext/dom/tests/modern/spec/NamedNodeMap_dimensions_errors.phpt +++ b/ext/dom/tests/modern/spec/NamedNodeMap_dimensions_errors.phpt @@ -11,9 +11,9 @@ $attributes = $dom->documentElement->attributes; try { $attributes[][0] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot append to Dom\NamedNodeMap +Error: Cannot append to Dom\NamedNodeMap diff --git a/ext/dom/tests/modern/spec/NodeList_dimensions.phpt b/ext/dom/tests/modern/spec/NodeList_dimensions.phpt index f5fe6480e641..56c0ebfbcaa2 100644 --- a/ext/dom/tests/modern/spec/NodeList_dimensions.phpt +++ b/ext/dom/tests/modern/spec/NodeList_dimensions.phpt @@ -15,7 +15,7 @@ foreach ($test_values as $value) { try { var_dump($children[$value] ? $children[$value]->nodeName : "N/A", isset($children[$value]), empty($children[$value])); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -58,9 +58,9 @@ string(1) "b" bool(true) bool(false) --- true --- -Cannot access offset of type bool on Dom\NodeList +TypeError: Cannot access offset of type bool on Dom\NodeList --- null --- -Cannot access offset of type null on Dom\NodeList +TypeError: Cannot access offset of type null on Dom\NodeList --- "0" --- string(1) "a" bool(true) @@ -70,6 +70,6 @@ string(1) "b" bool(true) bool(false) --- "" --- -Cannot access offset of type string on Dom\NodeList +TypeError: Cannot access offset of type string on Dom\NodeList --- "foo" --- -Cannot access offset of type string on Dom\NodeList +TypeError: Cannot access offset of type string on Dom\NodeList diff --git a/ext/dom/tests/modern/spec/NodeList_dimensions_errors.phpt b/ext/dom/tests/modern/spec/NodeList_dimensions_errors.phpt index bfb882823b78..058f043c27fe 100644 --- a/ext/dom/tests/modern/spec/NodeList_dimensions_errors.phpt +++ b/ext/dom/tests/modern/spec/NodeList_dimensions_errors.phpt @@ -11,9 +11,9 @@ $children = $dom->documentElement->childNodes; try { $children[][0] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot append to Dom\NodeList +Error: Cannot append to Dom\NodeList diff --git a/ext/dom/tests/modern/spec/Node_appendChild_attribute.phpt b/ext/dom/tests/modern/spec/Node_appendChild_attribute.phpt index 3e3a5674c6a6..72bb8b81fafa 100644 --- a/ext/dom/tests/modern/spec/Node_appendChild_attribute.phpt +++ b/ext/dom/tests/modern/spec/Node_appendChild_attribute.phpt @@ -13,12 +13,12 @@ $attr->value = "hello"; try { $element->appendChild($attr); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($attr->value); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error string(5) "hello" diff --git a/ext/dom/tests/modern/spec/Node_appendChild_fragment_multiple_elements.phpt b/ext/dom/tests/modern/spec/Node_appendChild_fragment_multiple_elements.phpt index fc62d89811b5..bf74b83b355e 100644 --- a/ext/dom/tests/modern/spec/Node_appendChild_fragment_multiple_elements.phpt +++ b/ext/dom/tests/modern/spec/Node_appendChild_fragment_multiple_elements.phpt @@ -14,12 +14,12 @@ $fragment->appendChild($dom->createElement('bar')); try { $dom->appendChild($fragment); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXml($fragment), "\n"; ?> --EXPECT-- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document diff --git a/ext/dom/tests/modern/spec/Node_appendChild_invalid_parent.phpt b/ext/dom/tests/modern/spec/Node_appendChild_invalid_parent.phpt index af99bfc38057..bb29ba33cf44 100644 --- a/ext/dom/tests/modern/spec/Node_appendChild_invalid_parent.phpt +++ b/ext/dom/tests/modern/spec/Node_appendChild_invalid_parent.phpt @@ -15,30 +15,30 @@ $attr = $dom->createAttribute('Hello'); try { $text->appendChild($dom->createElement('br')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cdata->appendChild($dom->createElement('br')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $pi->appendChild($dom->createElement('br')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $attr->appendChild($dom->createElement('br')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/modern/spec/Node_cloneNode_copy_document_properties.phpt b/ext/dom/tests/modern/spec/Node_cloneNode_copy_document_properties.phpt index 7894aa0a3131..55d0b065ae1b 100644 --- a/ext/dom/tests/modern/spec/Node_cloneNode_copy_document_properties.phpt +++ b/ext/dom/tests/modern/spec/Node_cloneNode_copy_document_properties.phpt @@ -13,9 +13,9 @@ $dom->appendChild($dom->createElement("foo")); try { $dom->prepend($dom->createElement("bar")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document diff --git a/ext/dom/tests/modern/spec/Node_insertBefore_01.phpt b/ext/dom/tests/modern/spec/Node_insertBefore_01.phpt index 967334bbeba2..3813fbee61c8 100644 --- a/ext/dom/tests/modern/spec/Node_insertBefore_01.phpt +++ b/ext/dom/tests/modern/spec/Node_insertBefore_01.phpt @@ -14,12 +14,12 @@ $fragment->appendChild($dom->createElement('a')); try { $dom->insertBefore($fragment, $dom->doctype); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml(), "\n"; ?> --EXPECT-- -Document types must be the first child in a document +DOMException: Document types must be the first child in a document diff --git a/ext/dom/tests/modern/spec/Node_insertBefore_02.phpt b/ext/dom/tests/modern/spec/Node_insertBefore_02.phpt index 390dba0f176a..9984ec9a1284 100644 --- a/ext/dom/tests/modern/spec/Node_insertBefore_02.phpt +++ b/ext/dom/tests/modern/spec/Node_insertBefore_02.phpt @@ -13,12 +13,12 @@ $fragment->appendChild($dom->createElement('a')); try { $dom->insertBefore($fragment, $dom->documentElement); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveHtml(), "\n"; ?> --EXPECT-- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document diff --git a/ext/dom/tests/modern/spec/Node_replaceChild_edge_cases.phpt b/ext/dom/tests/modern/spec/Node_replaceChild_edge_cases.phpt index afa6d1e8a815..4ba1777ef054 100644 --- a/ext/dom/tests/modern/spec/Node_replaceChild_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/Node_replaceChild_edge_cases.phpt @@ -18,7 +18,7 @@ $comment = $dom->createComment('This is a comment'); try { $comment->replaceChild($comment, $dom->createElement("old-child")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Node is an inclusive ancestor of parent ---\n"; @@ -26,13 +26,13 @@ echo "--- Node is an inclusive ancestor of parent ---\n"; try { $parent->replaceChild($parent, $child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $parent->replaceChild($dom, $child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Child's parent is not parent ---\n"; @@ -40,7 +40,7 @@ echo "--- Child's parent is not parent ---\n"; try { $parent->replaceChild($dom->createElement("new-child"), $dom->createElement("old-child")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Invalid child to replace with ---\n"; @@ -49,7 +49,7 @@ try { $entityReference = $dom->importNode(Dom\XMLDocument::createEmpty()->createEntityReference("foo")); $parent->replaceChild($entityReference, $child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace element with text in document root ---\n"; @@ -57,7 +57,7 @@ echo "--- Replace element with text in document root ---\n"; try { $dom->replaceChild($dom->createTextNode("text"), $parent); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace child element with doctype inside element ---\n"; @@ -65,7 +65,7 @@ echo "--- Replace child element with doctype inside element ---\n"; try { $parent->replaceChild($dom->doctype, $child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace element with fragment containing multiple elements ---\n"; @@ -77,7 +77,7 @@ $fragment->appendChild($dom->createElement("new-child2")); try { $dom->replaceChild($fragment, $parent); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace comment in document causing more than two elements ---\n"; @@ -86,7 +86,7 @@ $comment = $dom->appendChild($dom->createComment("comment")); try { $dom->replaceChild($dom->createElement("new-child"), $comment); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace dtd with element ---\n"; @@ -94,7 +94,7 @@ echo "--- Replace dtd with element ---\n"; try { $dom->replaceChild($dom->createElement("new-child"), $dom->doctype); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace element with another dtd ---\n"; @@ -102,7 +102,7 @@ echo "--- Replace element with another dtd ---\n"; try { $dom->replaceChild($dom->doctype, $parent); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Replace parent with itself ---\n"; @@ -120,26 +120,26 @@ echo $dom->saveHtml(), "\n"; ?> --EXPECT-- --- Wrong parent node type --- -Hierarchy Request Error +DOMException: Hierarchy Request Error --- Node is an inclusive ancestor of parent --- -Hierarchy Request Error -Hierarchy Request Error +DOMException: Hierarchy Request Error +DOMException: Hierarchy Request Error --- Child's parent is not parent --- -Not Found Error +DOMException: Not Found Error --- Invalid child to replace with --- -Hierarchy Request Error +DOMException: Hierarchy Request Error --- Replace element with text in document root --- -Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document --- Replace child element with doctype inside element --- -Cannot insert a document type into anything other than a document +DOMException: Cannot insert a document type into anything other than a document --- Replace element with fragment containing multiple elements --- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document --- Replace comment in document causing more than two elements --- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document --- Replace dtd with element --- -Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document --- Replace element with another dtd --- -Document types must be the first child in a document +DOMException: Document types must be the first child in a document --- Replace parent with itself --- --- Replace parent with single-child fragment --- diff --git a/ext/dom/tests/modern/spec/ParentNode_append_exception_consistency.phpt b/ext/dom/tests/modern/spec/ParentNode_append_exception_consistency.phpt index a88b4fc808b0..a013070c2f9c 100644 --- a/ext/dom/tests/modern/spec/ParentNode_append_exception_consistency.phpt +++ b/ext/dom/tests/modern/spec/ParentNode_append_exception_consistency.phpt @@ -11,13 +11,13 @@ $fragment->append($dom->createElement("bar")); try { $dom->append($fragment); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($element->parentNode); ?> --EXPECT-- -Exception: Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document object(Dom\DocumentFragment)#2 (18) { ["children"]=> string(22) "(object value omitted)" diff --git a/ext/dom/tests/modern/spec/ParentNode_edge_case.phpt b/ext/dom/tests/modern/spec/ParentNode_edge_case.phpt index 367f1437c67d..e3eaaac880a2 100644 --- a/ext/dom/tests/modern/spec/ParentNode_edge_case.phpt +++ b/ext/dom/tests/modern/spec/ParentNode_edge_case.phpt @@ -10,9 +10,9 @@ $container = $dom->createElement('container'); try { $container->append($dom); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/modern/spec/ParentNode_hierarchy_text_nodes.phpt b/ext/dom/tests/modern/spec/ParentNode_hierarchy_text_nodes.phpt index f81450ca261e..fea13e5f4cfd 100644 --- a/ext/dom/tests/modern/spec/ParentNode_hierarchy_text_nodes.phpt +++ b/ext/dom/tests/modern/spec/ParentNode_hierarchy_text_nodes.phpt @@ -10,20 +10,20 @@ $dom = Dom\HTMLDocument::createEmpty(); try { $dom->append("bar"); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->append($dom->createTextNode("bar")); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $text = $dom->createTextNode("bar"); try { $dom->append($text); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($text->parentNode); @@ -34,14 +34,14 @@ $text = $element->appendChild($dom->createTextNode("text")); try { $dom->append($text); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Cannot insert text as a child of a document -Exception: Cannot insert text as a child of a document -Exception: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document NULL string(3) "bar" -Exception: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document diff --git a/ext/dom/tests/modern/spec/Text_splitText_edge_case.phpt b/ext/dom/tests/modern/spec/Text_splitText_edge_case.phpt index 4bd79b9b4a8b..862a5529147d 100644 --- a/ext/dom/tests/modern/spec/Text_splitText_edge_case.phpt +++ b/ext/dom/tests/modern/spec/Text_splitText_edge_case.phpt @@ -10,15 +10,15 @@ var_dump($text->splitText(5)->wholeText); try { var_dump($text->splitText(-1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($text->splitText(200)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(7) " World!" -Dom\Text::splitText(): Argument #1 ($offset) must be greater than or equal to 0 -Index Size Error +ValueError: Dom\Text::splitText(): Argument #1 ($offset) must be greater than or equal to 0 +DOMException: Index Size Error diff --git a/ext/dom/tests/modern/spec/XMLDocument_version.phpt b/ext/dom/tests/modern/spec/XMLDocument_version.phpt index 82f38839ea27..0c8f32c4cf4b 100644 --- a/ext/dom/tests/modern/spec/XMLDocument_version.phpt +++ b/ext/dom/tests/modern/spec/XMLDocument_version.phpt @@ -12,7 +12,7 @@ foreach (['0.1', '1.0', '1.1', '', 'foo'] as $version) { try { $dom->xmlVersion = $version; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->xmlVersion); } @@ -20,11 +20,11 @@ foreach (['0.1', '1.0', '1.1', '', 'foo'] as $version) { ?> --EXPECT-- string(3) "1.0" -Invalid XML version +ValueError: Invalid XML version string(3) "1.0" string(3) "1.0" string(3) "1.1" -Invalid XML version +ValueError: Invalid XML version string(3) "1.1" -Invalid XML version +ValueError: Invalid XML version string(3) "1.1" diff --git a/ext/dom/tests/modern/spec/appendChild_dtd_legacy.phpt b/ext/dom/tests/modern/spec/appendChild_dtd_legacy.phpt index 20a69b3b545d..c365795043d5 100644 --- a/ext/dom/tests/modern/spec/appendChild_dtd_legacy.phpt +++ b/ext/dom/tests/modern/spec/appendChild_dtd_legacy.phpt @@ -25,14 +25,14 @@ $other->appendChild($doctype); try { $other->appendChild($other->implementation->createDocumentType('doc', '', '')); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $other->saveXml(); ?> --EXPECT-- Found entity: foo -A document may only contain one document type +DOMException: A document may only contain one document type diff --git a/ext/dom/tests/modern/spec/append_text_nodes_invalid_hierarchy.phpt b/ext/dom/tests/modern/spec/append_text_nodes_invalid_hierarchy.phpt index ea530d675c3c..6852e389e7c6 100644 --- a/ext/dom/tests/modern/spec/append_text_nodes_invalid_hierarchy.phpt +++ b/ext/dom/tests/modern/spec/append_text_nodes_invalid_hierarchy.phpt @@ -10,19 +10,19 @@ $dom = Dom\HTMLDocument::createEmpty(); try { $dom->append("foo", "bar", "baz", $dom); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->append("foo", "bar", "baz"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveHtml()); ?> --EXPECT-- -Hierarchy Request Error -Cannot insert text as a child of a document +DOMException: Hierarchy Request Error +DOMException: Cannot insert text as a child of a document string(0) "" diff --git a/ext/dom/tests/modern/spec/documentURI_URL.phpt b/ext/dom/tests/modern/spec/documentURI_URL.phpt index 3e5a797eae67..51a275498daf 100644 --- a/ext/dom/tests/modern/spec/documentURI_URL.phpt +++ b/ext/dom/tests/modern/spec/documentURI_URL.phpt @@ -14,7 +14,7 @@ try { var_dump($dom->documentURI); var_dump($dom->URL); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom->URL = ""; @@ -29,7 +29,7 @@ var_dump($dom->URL); --EXPECTF-- string(%d) "%s" string(%d) "%s" -Cannot assign null to property Dom\Document::$URL of type string +TypeError: Cannot assign null to property Dom\Document::$URL of type string string(0) "" string(0) "" string(%d) "%s" diff --git a/ext/dom/tests/modern/spec/pre_insertion_validation.phpt b/ext/dom/tests/modern/spec/pre_insertion_validation.phpt index d16e3ffad9d9..0d6b4f9f69ef 100644 --- a/ext/dom/tests/modern/spec/pre_insertion_validation.phpt +++ b/ext/dom/tests/modern/spec/pre_insertion_validation.phpt @@ -13,17 +13,17 @@ echo "--- Trying to insert text node into the document ---\n"; try { $dom->append("foo", "bar", "baz"); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->append($dom->createTextNode("text node")); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dom->append($dom->createCDATASection("text node")); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Trying to insert doctype into not a document ---\n"; @@ -32,7 +32,7 @@ $element = $dom->createElement("foo"); try { $element->append($doctype); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Trying to insert doctype at the wrong place in a document ---\n"; @@ -40,7 +40,7 @@ echo "--- Trying to insert doctype at the wrong place in a document ---\n"; try { $dom->append($doctype); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Prepend doctype in a document should work ---\n"; @@ -52,7 +52,7 @@ echo "--- Trying to create multiple document roots ---\n"; try { $dom->append($dom->createElement("foo")); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Trying to insert an element before a document type ---\n"; @@ -61,7 +61,7 @@ $dom->documentElement->remove(); try { $dom->prepend($element); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Document output ---\n"; @@ -77,7 +77,7 @@ $fragment->append($dom->createElement("bar")); try { $dom->append($fragment); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Document fragment edge cases with text ---\n"; @@ -89,29 +89,29 @@ $fragment->append($dom->createCDATASection("bar")); try { $dom->append($fragment); } catch (DOMException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- --- Trying to insert text node into the document --- -Exception: Cannot insert text as a child of a document -Exception: Cannot insert text as a child of a document -Exception: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document --- Trying to insert doctype into not a document --- -Exception: Cannot insert a document type into anything other than a document +DOMException: Cannot insert a document type into anything other than a document --- Trying to insert doctype at the wrong place in a document --- -Exception: Document types must be the first child in a document +DOMException: Document types must be the first child in a document --- Prepend doctype in a document should work --- --- Trying to create multiple document roots --- -Exception: Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document --- Trying to insert an element before a document type --- -Exception: Document types must be the first child in a document +DOMException: Document types must be the first child in a document --- Document output --- --- Document fragment edge cases with multiple elements --- -Exception: Cannot have more than one element child in a document +DOMException: Cannot have more than one element child in a document --- Document fragment edge cases with text --- -Exception: Cannot insert text as a child of a document +DOMException: Cannot insert text as a child of a document diff --git a/ext/dom/tests/modern/spec/textContent_edge_cases.phpt b/ext/dom/tests/modern/spec/textContent_edge_cases.phpt index 2252013c7a3f..a5022e647877 100644 --- a/ext/dom/tests/modern/spec/textContent_edge_cases.phpt +++ b/ext/dom/tests/modern/spec/textContent_edge_cases.phpt @@ -12,7 +12,7 @@ var_dump($dom->textContent); try { $dom->textContent = "foo"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $container = $dom->documentElement; @@ -39,7 +39,7 @@ echo $dom->saveXml(), "\n"; ?> --EXPECT-- document text content: NULL -Cannot modify readonly property Dom\XMLDocument::$textContent +Error: Cannot modify readonly property Dom\XMLDocument::$textContent text node text content: string(4) "text" pi node text content: string(5) "value" text node text content: string(0) "" diff --git a/ext/dom/tests/modern/token_list/add_errors.phpt b/ext/dom/tests/modern/token_list/add_errors.phpt index 94db0d293114..4d571d9cd493 100644 --- a/ext/dom/tests/modern/token_list/add_errors.phpt +++ b/ext/dom/tests/modern/token_list/add_errors.phpt @@ -11,31 +11,31 @@ $list = $dom->documentElement->classList; try { $list->add(""); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->add(" "); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->add("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->add(0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(), "\n"; ?> --EXPECT-- -The empty string is not a valid token -The token must not contain any ASCII whitespace -Dom\TokenList::add(): Argument #1 must not contain any null bytes -Dom\TokenList::add(): Argument #1 must be of type string, int given +DOMException: The empty string is not a valid token +DOMException: The token must not contain any ASCII whitespace +ValueError: Dom\TokenList::add(): Argument #1 must not contain any null bytes +TypeError: Dom\TokenList::add(): Argument #1 must be of type string, int given diff --git a/ext/dom/tests/modern/token_list/clone.phpt b/ext/dom/tests/modern/token_list/clone.phpt index e0c71e9fd791..73ae99582f17 100644 --- a/ext/dom/tests/modern/token_list/clone.phpt +++ b/ext/dom/tests/modern/token_list/clone.phpt @@ -10,7 +10,7 @@ $element = $dom->documentElement; try { clone $element->classList; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/dom/tests/modern/token_list/contains_error.phpt b/ext/dom/tests/modern/token_list/contains_error.phpt index 9f402e685f4d..d373e1b8f52c 100644 --- a/ext/dom/tests/modern/token_list/contains_error.phpt +++ b/ext/dom/tests/modern/token_list/contains_error.phpt @@ -12,9 +12,9 @@ $list = $element->classList; try { $list->contains("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Dom\TokenList::contains(): Argument #1 ($token) must not contain any null bytes +ValueError: Dom\TokenList::contains(): Argument #1 ($token) must not contain any null bytes diff --git a/ext/dom/tests/modern/token_list/dimensions.phpt b/ext/dom/tests/modern/token_list/dimensions.phpt index e1507d61b08a..6a3e9b971482 100644 --- a/ext/dom/tests/modern/token_list/dimensions.phpt +++ b/ext/dom/tests/modern/token_list/dimensions.phpt @@ -20,7 +20,7 @@ echo "--- \"foo\" ---\n"; try { var_dump($list["foo"], isset($list["foo"]), empty($list["foo"])); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- 1.1 ---\n"; @@ -68,7 +68,7 @@ string(1) "A" bool(true) bool(false) --- "foo" --- -Cannot access offset of type string on Dom\TokenList +TypeError: Cannot access offset of type string on Dom\TokenList --- 1.1 --- Deprecated: Implicit conversion from float 1.1 to int loses precision in %s on line %d diff --git a/ext/dom/tests/modern/token_list/dimensions_error.phpt b/ext/dom/tests/modern/token_list/dimensions_error.phpt index c29fc058ef94..ba1cec9d7a76 100644 --- a/ext/dom/tests/modern/token_list/dimensions_error.phpt +++ b/ext/dom/tests/modern/token_list/dimensions_error.phpt @@ -18,40 +18,40 @@ foreach ($testOffsets as $offset) { try { $list[$offset]; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { isset($list[$offset]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { empty($list[$offset]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } try { $list[][0] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot access offset of type stdClass on Dom\TokenList -Cannot access offset of type stdClass in isset or empty -Cannot access offset of type stdClass in isset or empty -Cannot access offset of type array on Dom\TokenList -Cannot access offset of type array in isset or empty -Cannot access offset of type array in isset or empty +TypeError: Cannot access offset of type stdClass on Dom\TokenList +TypeError: Cannot access offset of type stdClass in isset or empty +TypeError: Cannot access offset of type stdClass in isset or empty +TypeError: Cannot access offset of type array on Dom\TokenList +TypeError: Cannot access offset of type array in isset or empty +TypeError: Cannot access offset of type array in isset or empty Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d -Cannot append to Dom\TokenList +Error: Cannot append to Dom\TokenList diff --git a/ext/dom/tests/modern/token_list/foreach_by_ref.phpt b/ext/dom/tests/modern/token_list/foreach_by_ref.phpt index b13b4c51c7c0..a06b94b8e7ef 100644 --- a/ext/dom/tests/modern/token_list/foreach_by_ref.phpt +++ b/ext/dom/tests/modern/token_list/foreach_by_ref.phpt @@ -11,9 +11,9 @@ try { foreach ($dom->documentElement->classList as &$class) { } } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference diff --git a/ext/dom/tests/modern/token_list/remove_errors.phpt b/ext/dom/tests/modern/token_list/remove_errors.phpt index fe0e58c334c9..67231de408c3 100644 --- a/ext/dom/tests/modern/token_list/remove_errors.phpt +++ b/ext/dom/tests/modern/token_list/remove_errors.phpt @@ -11,31 +11,31 @@ $list = $dom->documentElement->classList; try { $list->remove(""); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->remove(" "); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->remove("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->remove(0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $dom->saveXML(), "\n"; ?> --EXPECT-- -The empty string is not a valid token -The token must not contain any ASCII whitespace -Dom\TokenList::remove(): Argument #1 must not contain any null bytes -Dom\TokenList::remove(): Argument #1 must be of type string, int given +DOMException: The empty string is not a valid token +DOMException: The token must not contain any ASCII whitespace +ValueError: Dom\TokenList::remove(): Argument #1 must not contain any null bytes +TypeError: Dom\TokenList::remove(): Argument #1 must be of type string, int given diff --git a/ext/dom/tests/modern/token_list/replace_error.phpt b/ext/dom/tests/modern/token_list/replace_error.phpt index 14b02373d57d..9ff5a13c3e2b 100644 --- a/ext/dom/tests/modern/token_list/replace_error.phpt +++ b/ext/dom/tests/modern/token_list/replace_error.phpt @@ -12,23 +12,23 @@ $list = $element->classList; try { $list->replace("\0", "X"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->replace("X", "\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->replace("a b", "X"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Dom\TokenList::replace(): Argument #1 ($token) must not contain any null bytes -Dom\TokenList::replace(): Argument #2 ($newToken) must not contain any null bytes -The token must not contain any ASCII whitespace +ValueError: Dom\TokenList::replace(): Argument #1 ($token) must not contain any null bytes +ValueError: Dom\TokenList::replace(): Argument #2 ($newToken) must not contain any null bytes +DOMException: The token must not contain any ASCII whitespace diff --git a/ext/dom/tests/modern/token_list/supports.phpt b/ext/dom/tests/modern/token_list/supports.phpt index 6fc1d7f22549..d26bf8d48ebd 100644 --- a/ext/dom/tests/modern/token_list/supports.phpt +++ b/ext/dom/tests/modern/token_list/supports.phpt @@ -10,9 +10,9 @@ $element = $dom->documentElement; try { $element->classList->supports('a'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attribute "class" does not define any supported tokens +TypeError: Attribute "class" does not define any supported tokens diff --git a/ext/dom/tests/modern/token_list/toggle_error.phpt b/ext/dom/tests/modern/token_list/toggle_error.phpt index 7e3cfd462023..b9dabfa5f6ce 100644 --- a/ext/dom/tests/modern/token_list/toggle_error.phpt +++ b/ext/dom/tests/modern/token_list/toggle_error.phpt @@ -12,16 +12,16 @@ $list = $element->classList; try { $list->toggle("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $list->toggle("a b"); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Dom\TokenList::toggle(): Argument #1 ($token) must not contain any null bytes -The token must not contain any ASCII whitespace +ValueError: Dom\TokenList::toggle(): Argument #1 ($token) must not contain any null bytes +DOMException: The token must not contain any ASCII whitespace diff --git a/ext/dom/tests/modern/token_list/value_edge_cases.phpt b/ext/dom/tests/modern/token_list/value_edge_cases.phpt index af32d84180ba..b9a4f5156eef 100644 --- a/ext/dom/tests/modern/token_list/value_edge_cases.phpt +++ b/ext/dom/tests/modern/token_list/value_edge_cases.phpt @@ -13,7 +13,7 @@ var_dump($list->value); try { $list->value = "\0"; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($list->value); @@ -21,5 +21,5 @@ var_dump($list->value); ?> --EXPECT-- string(0) "" -Value must not contain any null bytes +ValueError: Value must not contain any null bytes string(0) "" diff --git a/ext/dom/tests/modern/xml/DtdNamedNodeMap_dimension_index_overflow_64.phpt b/ext/dom/tests/modern/xml/DtdNamedNodeMap_dimension_index_overflow_64.phpt index cc2d7a06a2ca..4804d78c94b9 100644 --- a/ext/dom/tests/modern/xml/DtdNamedNodeMap_dimension_index_overflow_64.phpt +++ b/ext/dom/tests/modern/xml/DtdNamedNodeMap_dimension_index_overflow_64.phpt @@ -24,7 +24,7 @@ function dump_access(Closure $callback): void { try { var_dump($callback()?->nodeName); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -36,6 +36,6 @@ dump_access(fn() => $doc->doctype->notations[$overflow]); ?> --EXPECT-- NULL -must be between 0 and 2147483647 +ValueError: must be between 0 and 2147483647 NULL -must be between 0 and 2147483647 +ValueError: must be between 0 and 2147483647 diff --git a/ext/dom/tests/modern/xml/Element_innerHTML_writing_errors.phpt b/ext/dom/tests/modern/xml/Element_innerHTML_writing_errors.phpt index 0316ac88439f..49a7c739d6e0 100644 --- a/ext/dom/tests/modern/xml/Element_innerHTML_writing_errors.phpt +++ b/ext/dom/tests/modern/xml/Element_innerHTML_writing_errors.phpt @@ -19,7 +19,7 @@ function test($child, $html) { try { $child->innerHTML = $html; } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($dom->saveXML() === $original); } @@ -33,15 +33,15 @@ test($child, ''); ?> --EXPECT-- -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) -XML fragment is not well-formed +DOMException: XML fragment is not well-formed bool(true) diff --git a/ext/dom/tests/modern/xml/Element_innerOuterHTML_reading_errors.phpt b/ext/dom/tests/modern/xml/Element_innerOuterHTML_reading_errors.phpt index 585c9c5fd875..770cc1157af1 100644 --- a/ext/dom/tests/modern/xml/Element_innerOuterHTML_reading_errors.phpt +++ b/ext/dom/tests/modern/xml/Element_innerOuterHTML_reading_errors.phpt @@ -17,12 +17,12 @@ function test($container) { try { var_dump($container->innerHTML); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($container->outerHTML); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -96,33 +96,33 @@ test($container); ?> --EXPECT-- -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed -The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed diff --git a/ext/dom/tests/modern/xml/Element_insertAdjacentHTML_errors.phpt b/ext/dom/tests/modern/xml/Element_insertAdjacentHTML_errors.phpt index 0ecd1d487360..c26374b7ff10 100644 --- a/ext/dom/tests/modern/xml/Element_insertAdjacentHTML_errors.phpt +++ b/ext/dom/tests/modern/xml/Element_insertAdjacentHTML_errors.phpt @@ -9,9 +9,9 @@ $dom = Dom\XMLDocument::createFromString(''); try { $dom->documentElement->insertAdjacentHTML(Dom\AdjacentPosition::AfterBegin, ""); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -XML fragment is not well-formed +DOMException: XML fragment is not well-formed diff --git a/ext/dom/tests/modern/xml/Element_outerHTML_writing_errors.phpt b/ext/dom/tests/modern/xml/Element_outerHTML_writing_errors.phpt index f7602539acac..c4ef3adf3aa2 100644 --- a/ext/dom/tests/modern/xml/Element_outerHTML_writing_errors.phpt +++ b/ext/dom/tests/modern/xml/Element_outerHTML_writing_errors.phpt @@ -9,17 +9,17 @@ $dom = Dom\XMLDocument::createFromString(''); try { $dom->documentElement->outerHTML = ''; } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom = Dom\XMLDocument::createFromString(''); try { $dom->documentElement->firstChild->outerHTML = ''; } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid Modification Error -XML fragment is not well-formed +DOMException: Invalid Modification Error +DOMException: XML fragment is not well-formed diff --git a/ext/dom/tests/modern/xml/Node_removeChild_from_comment.phpt b/ext/dom/tests/modern/xml/Node_removeChild_from_comment.phpt index eae3c97dbf00..dcb280be0566 100644 --- a/ext/dom/tests/modern/xml/Node_removeChild_from_comment.phpt +++ b/ext/dom/tests/modern/xml/Node_removeChild_from_comment.phpt @@ -12,9 +12,9 @@ $child = $comment->nextSibling; try { $comment->removeChild($child); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Not Found Error +DOMException: Not Found Error diff --git a/ext/dom/tests/modern/xml/XMLDocument_createFromFile_override_encoding.phpt b/ext/dom/tests/modern/xml/XMLDocument_createFromFile_override_encoding.phpt index f48c5f7f5a14..c97a1db1bfcc 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_createFromFile_override_encoding.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_createFromFile_override_encoding.phpt @@ -8,7 +8,7 @@ dom try { Dom\XMLDocument::createFromFile(__DIR__ . '/dummy.xml', overrideEncoding: 'nonexistent'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // The override encoding matches with the document encoding attribute @@ -23,7 +23,7 @@ var_dump($dom->charset); ?> --EXPECT-- -Dom\XMLDocument::createFromFile(): Argument #3 ($overrideEncoding) must be a valid document encoding +ValueError: Dom\XMLDocument::createFromFile(): Argument #3 ($overrideEncoding) must be a valid document encoding string(2) "é" string(5) "UTF-8" string(4) "é" diff --git a/ext/dom/tests/modern/xml/XMLDocument_createFromString_override_encoding.phpt b/ext/dom/tests/modern/xml/XMLDocument_createFromString_override_encoding.phpt index e45f74847dd1..19834045f3db 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_createFromString_override_encoding.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_createFromString_override_encoding.phpt @@ -8,7 +8,7 @@ dom try { Dom\XMLDocument::createFromString(file_get_contents(__DIR__ . '/dummy.xml'), overrideEncoding: 'nonexistent'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // The override encoding matches with the document encoding attribute @@ -23,7 +23,7 @@ var_dump($dom->charset); ?> --EXPECT-- -Dom\XMLDocument::createFromString(): Argument #3 ($overrideEncoding) must be a valid document encoding +ValueError: Dom\XMLDocument::createFromString(): Argument #3 ($overrideEncoding) must be a valid document encoding string(2) "é" string(5) "UTF-8" string(4) "é" diff --git a/ext/dom/tests/modern/xml/XMLDocument_fromFile_03.phpt b/ext/dom/tests/modern/xml/XMLDocument_fromFile_03.phpt index 73c1b0d22356..15684fb22723 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_fromFile_03.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_fromFile_03.phpt @@ -8,9 +8,9 @@ dom try { Dom\XMLDocument::createFromFile("%00"); } catch (ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Dom\XMLDocument::createFromFile(): Argument #1 ($path) must not contain percent-encoded NUL bytes +ValueError: Dom\XMLDocument::createFromFile(): Argument #1 ($path) must not contain percent-encoded NUL bytes diff --git a/ext/dom/tests/modern/xml/XMLDocument_fromString_03.phpt b/ext/dom/tests/modern/xml/XMLDocument_fromString_03.phpt index 16db09547bff..0691fc4b382e 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_fromString_03.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_fromString_03.phpt @@ -12,7 +12,7 @@ $flags = [ try { Dom\XMLDocument::createFromString('', -1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foreach ($flags as $flag) { @@ -21,7 +21,7 @@ foreach ($flags as $flag) { ?> --EXPECTF-- -Dom\XMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: %s) +ValueError: Dom\XMLDocument::createFromString(): Argument #2 ($options) contains invalid flags (allowed flags: %s) bool(true) bool(true) bool(true) diff --git a/ext/dom/tests/modern/xml/XMLDocument_xpath.phpt b/ext/dom/tests/modern/xml/XMLDocument_xpath.phpt index b42c21ed9ab1..8e3afe9ef6fb 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_xpath.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_xpath.phpt @@ -46,7 +46,7 @@ echo "--- Get a namespace node ---\n"; try { var_dump($xpath->evaluate("//*/namespace::*")); } catch (DOMException $e) { - echo $e->getCode(), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), "\n"; } ?> @@ -71,4 +71,4 @@ string(4) "data" string(11) "Dom\Comment" string(9) " comment " --- Get a namespace node --- -9: The namespace axis is not well-defined in the living DOM specification. Use Dom\Element::getInScopeNamespaces() or Dom\Element::getDescendantNamespaces() instead. +DOMException: 9: The namespace axis is not well-defined in the living DOM specification. Use Dom\Element::getInScopeNamespaces() or Dom\Element::getDescendantNamespaces() instead. diff --git a/ext/dom/tests/modern/xml/XMLDocument_xpath_errors.phpt b/ext/dom/tests/modern/xml/XMLDocument_xpath_errors.phpt index 1ef52b50961f..027905bf20b1 100644 --- a/ext/dom/tests/modern/xml/XMLDocument_xpath_errors.phpt +++ b/ext/dom/tests/modern/xml/XMLDocument_xpath_errors.phpt @@ -12,10 +12,10 @@ $xpath = new Dom\XPath($dom); try { var_dump($xpath->evaluate('-')); } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Dom\XPath::evaluate(): Invalid expression in %s on line %d -string(35) "Could not evaluate XPath expression" +Error: Could not evaluate XPath expression diff --git a/ext/dom/tests/modern/xml/canonicalize_unattached.phpt b/ext/dom/tests/modern/xml/canonicalize_unattached.phpt index cec5f1085757..b7326af0ca6a 100644 --- a/ext/dom/tests/modern/xml/canonicalize_unattached.phpt +++ b/ext/dom/tests/modern/xml/canonicalize_unattached.phpt @@ -12,9 +12,9 @@ $child->remove(); try { $child->C14N(); } catch (Dom\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Canonicalization can only happen on nodes attached to a document. +DOMException: Canonicalization can only happen on nodes attached to a document. diff --git a/ext/dom/tests/modern/xml/gh22570.phpt b/ext/dom/tests/modern/xml/gh22570.phpt index 3d648aac5e4d..816fba04637a 100644 --- a/ext/dom/tests/modern/xml/gh22570.phpt +++ b/ext/dom/tests/modern/xml/gh22570.phpt @@ -28,13 +28,13 @@ $doc->appendChild($node); try { $doc->saveXml(); } catch (\Error $e) { - echo "saveXml: ", $e::class, ": ", $e->getMessage(), "\n"; + echo 'saveXml: ', $e::class, ': ', $e->getMessage(), "\n"; } try { $doc->documentElement->innerHTML; } catch (\Error $e) { - echo "innerHTML: ", $e::class, ": ", $e->getMessage(), "\n"; + echo 'innerHTML: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/dom/tests/modern/xml/serialize_empty_xmlns.phpt b/ext/dom/tests/modern/xml/serialize_empty_xmlns.phpt index 7770143b2248..b4d35b8560e6 100644 --- a/ext/dom/tests/modern/xml/serialize_empty_xmlns.phpt +++ b/ext/dom/tests/modern/xml/serialize_empty_xmlns.phpt @@ -16,10 +16,10 @@ $x->setAttributeNS('http://www.w3.org/2000/xmlns/', 'xmlns:a', ''); try { var_dump($dom->documentElement->innerHTML); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(13) "" -The resulting XML serialization is not well-formed +DOMException: The resulting XML serialization is not well-formed diff --git a/ext/dom/tests/modern/xml/simplexml_interop.phpt b/ext/dom/tests/modern/xml/simplexml_interop.phpt index a1b02b7bdd83..9c5df6051dfe 100644 --- a/ext/dom/tests/modern/xml/simplexml_interop.phpt +++ b/ext/dom/tests/modern/xml/simplexml_interop.phpt @@ -22,7 +22,7 @@ echo $element->ownerDocument->saveXml($element), "\n"; try { dom_import_simplexml($sxe); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Import again and compare @@ -37,5 +37,5 @@ object(Dom\NamedNodeMap)#3 (1) { foo foo foovalue -dom_import_simplexml(): Argument #1 ($node) must not be already imported as a Dom\Node +TypeError: dom_import_simplexml(): Argument #1 ($node) must not be already imported as a Dom\Node bool(true) diff --git a/ext/dom/tests/not_serializable.phpt b/ext/dom/tests/not_serializable.phpt index 36053070f400..33f7761930d7 100644 --- a/ext/dom/tests/not_serializable.phpt +++ b/ext/dom/tests/not_serializable.phpt @@ -10,48 +10,48 @@ $doc->loadXML(''); try { serialize($doc); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $node = $doc->documentElement; try { serialize($node); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $xpath = new DOMXPath($doc); try { serialize($xpath); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ns = $xpath->query('//namespace::*')->item(0); try { serialize($ns); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom = Dom\XMLDocument::createEmpty(); try { serialize($dom); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { serialize(new Dom\XPath($dom)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Serialization of 'DOMDocument' is not allowed, unless serialization methods are implemented in a subclass -Serialization of 'DOMElement' is not allowed, unless serialization methods are implemented in a subclass -Serialization of 'DOMXPath' is not allowed -Serialization of 'DOMNameSpaceNode' is not allowed, unless serialization methods are implemented in a subclass -Serialization of 'Dom\XMLDocument' is not allowed, unless serialization methods are implemented in a subclass -Serialization of 'Dom\XPath' is not allowed +Exception: Serialization of 'DOMDocument' is not allowed, unless serialization methods are implemented in a subclass +Exception: Serialization of 'DOMElement' is not allowed, unless serialization methods are implemented in a subclass +Exception: Serialization of 'DOMXPath' is not allowed +Exception: Serialization of 'DOMNameSpaceNode' is not allowed, unless serialization methods are implemented in a subclass +Exception: Serialization of 'Dom\XMLDocument' is not allowed, unless serialization methods are implemented in a subclass +Exception: Serialization of 'Dom\XPath' is not allowed diff --git a/ext/dom/tests/not_unserializable.phpt b/ext/dom/tests/not_unserializable.phpt index a25a2737e852..389110ce8b7e 100644 --- a/ext/dom/tests/not_unserializable.phpt +++ b/ext/dom/tests/not_unserializable.phpt @@ -17,13 +17,13 @@ foreach ($classes as $class) try { unserialize('O:' . strlen($class) . ':"' . $class . '":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Unserialization of 'DOMXPath' is not allowed -Unserialization of 'DOMDocument' is not allowed, unless unserialization methods are implemented in a subclass -Unserialization of 'DOMNode' is not allowed, unless unserialization methods are implemented in a subclass -Unserialization of 'DOMNameSpaceNode' is not allowed, unless unserialization methods are implemented in a subclass +Exception: Unserialization of 'DOMXPath' is not allowed +Exception: Unserialization of 'DOMDocument' is not allowed, unless unserialization methods are implemented in a subclass +Exception: Unserialization of 'DOMNode' is not allowed, unless unserialization methods are implemented in a subclass +Exception: Unserialization of 'DOMNameSpaceNode' is not allowed, unless unserialization methods are implemented in a subclass diff --git a/ext/dom/tests/null_text_content_manipulation.phpt b/ext/dom/tests/null_text_content_manipulation.phpt index 9b1e35d60f76..28523ae0d979 100644 --- a/ext/dom/tests/null_text_content_manipulation.phpt +++ b/ext/dom/tests/null_text_content_manipulation.phpt @@ -8,26 +8,26 @@ $text = new DOMText(); try { var_dump($text->substringData(1, 0)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($text->insertData(1, "")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($text->deleteData(1, 1)); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($text->replaceData(1, 1, "")); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Index Size Error -Index Size Error -Index Size Error -Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error +DOMException: Index Size Error diff --git a/ext/dom/tests/php_function_edge_cases.phpt b/ext/dom/tests/php_function_edge_cases.phpt index 1091b50ce19b..f78472ace464 100644 --- a/ext/dom/tests/php_function_edge_cases.phpt +++ b/ext/dom/tests/php_function_edge_cases.phpt @@ -13,15 +13,15 @@ $xpath->registerPHPFunctions(); try { $xpath->query("//a[php:function(3)]"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->query("//a[php:function()]"); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Handler name must be a string -Function name must be passed as the first argument +TypeError: Handler name must be a string +Error: Function name must be passed as the first argument diff --git a/ext/dom/tests/property_write_errors.phpt b/ext/dom/tests/property_write_errors.phpt index 7d2af3b10555..9f583931ea58 100644 --- a/ext/dom/tests/property_write_errors.phpt +++ b/ext/dom/tests/property_write_errors.phpt @@ -11,19 +11,19 @@ $dom = new DOMDocument(); try { $dom->nodeValue = []; } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $dom->nodeType += 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $dom->xmlEncoding = null; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $entity = new DOMEntity(); @@ -31,26 +31,26 @@ $entity = new DOMEntity(); try { $entity->actualEncoding = null; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $entity->encoding = null; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $entity->version = null; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign array to property DOMNode::$nodeValue of type ?string -Cannot modify private(set) property DOMNode::$nodeType from global scope -Cannot modify private(set) property DOMDocument::$xmlEncoding from global scope -Cannot modify private(set) property DOMEntity::$actualEncoding from global scope -Cannot modify private(set) property DOMEntity::$encoding from global scope -Cannot modify private(set) property DOMEntity::$version from global scope +TypeError: Cannot assign array to property DOMNode::$nodeValue of type ?string +Error: Cannot modify private(set) property DOMNode::$nodeType from global scope +Error: Cannot modify private(set) property DOMDocument::$xmlEncoding from global scope +Error: Cannot modify private(set) property DOMEntity::$actualEncoding from global scope +Error: Cannot modify private(set) property DOMEntity::$encoding from global scope +Error: Cannot modify private(set) property DOMEntity::$version from global scope diff --git a/ext/dom/tests/registerNodeClass_abstract_class.phpt b/ext/dom/tests/registerNodeClass_abstract_class.phpt index 24124d712ea0..2848326206c2 100644 --- a/ext/dom/tests/registerNodeClass_abstract_class.phpt +++ b/ext/dom/tests/registerNodeClass_abstract_class.phpt @@ -14,7 +14,7 @@ $dom = new DOMDocument; try { $dom->registerNodeClass("DOMElement", "Test"); } catch (ValueError $e) { - echo "ValueError: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom->createElement("foo"); diff --git a/ext/dom/tests/registerPhpFunctionNS_errors.phpt b/ext/dom/tests/registerPhpFunctionNS_errors.phpt index 5098d8f7a84f..77ab58777a04 100644 --- a/ext/dom/tests/registerPhpFunctionNS_errors.phpt +++ b/ext/dom/tests/registerPhpFunctionNS_errors.phpt @@ -18,44 +18,44 @@ $xpath = new DOMXPath($doc); try { $xpath->registerPhpFunctionNS('http://php.net/xpath', 'strtolower', strtolower(...)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctionNS('http://php.net/xpath', 'test', [new TrampolineClass, 'test']); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctionNS('urn:foo', '$$$', [new TrampolineClass, 'test']); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctionNS('urn:foo', 'x:a', strtolower(...)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctionNS("urn:foo", "\0", strtolower(...)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $xpath->registerPhpFunctionNS("\0", 'strtolower', strtolower(...)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" because it is reserved by PHP -DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" because it is reserved by PHP -DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must be a valid callback name -DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must be a valid callback name -DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must not contain any null bytes -DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not contain any null bytes +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" because it is reserved by PHP +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not be "http://php.net/xpath" because it is reserved by PHP +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must be a valid callback name +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must be a valid callback name +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #2 ($name) must not contain any null bytes +ValueError: DOMXPath::registerPhpFunctionNS(): Argument #1 ($namespaceURI) must not contain any null bytes diff --git a/ext/dom/tests/register_node_class.phpt b/ext/dom/tests/register_node_class.phpt index 7482ec27bfa0..313e4218748c 100644 --- a/ext/dom/tests/register_node_class.phpt +++ b/ext/dom/tests/register_node_class.phpt @@ -30,7 +30,7 @@ echo get_class($attr), "\n"; try { print $attr->testit()."\n"; } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -39,4 +39,4 @@ HELLO Element myAttribute HELLO Attribute DOMAttr -Call to undefined method DOMAttr::testit() +Error: Call to undefined method DOMAttr::testit() diff --git a/ext/dom/tests/replaceChild_attribute_validation.phpt b/ext/dom/tests/replaceChild_attribute_validation.phpt index 32d5990f75e3..95e4389d86c3 100644 --- a/ext/dom/tests/replaceChild_attribute_validation.phpt +++ b/ext/dom/tests/replaceChild_attribute_validation.phpt @@ -12,7 +12,7 @@ $attr->textContent = "test"; try { $attr->replaceChild($dom->createProcessingInstruction('pi'), $attr->firstChild); } catch (DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $root = $dom->appendChild($dom->createElement('root')); @@ -22,6 +22,6 @@ echo $dom->saveXML(); ?> --EXPECT-- -Hierarchy Request Error +DOMException: Hierarchy Request Error diff --git a/ext/dom/tests/unsetting_properties.phpt b/ext/dom/tests/unsetting_properties.phpt index ec309c18bf58..966e8567de29 100644 --- a/ext/dom/tests/unsetting_properties.phpt +++ b/ext/dom/tests/unsetting_properties.phpt @@ -18,15 +18,15 @@ unset($root->myProp); try { $root->myProp; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($root->textContent); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property MyElement::$myProp must not be accessed before initialization -Cannot unset MyElement::$textContent +Error: Typed property MyElement::$myProp must not be accessed before initialization +Error: Cannot unset MyElement::$textContent diff --git a/ext/dom/tests/xpath_domnamespacenode_advanced.phpt b/ext/dom/tests/xpath_domnamespacenode_advanced.phpt index bbc49dc54652..ac00f3dda8e6 100644 --- a/ext/dom/tests/xpath_domnamespacenode_advanced.phpt +++ b/ext/dom/tests/xpath_domnamespacenode_advanced.phpt @@ -30,7 +30,7 @@ foreach ($xpath->query($query) as $attribute) { try { $attribute->parentNode->remove(); } catch (\DOMException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // However, it should not cause a use-after-free echo "After: ", $attribute->parentNode->tagName, "\n"; @@ -57,19 +57,19 @@ string(5) "child" Before: root After: root Before: root -Not Found Error +DOMException: Not Found Error After: root Before: root -Not Found Error +DOMException: Not Found Error After: root Before: child After: child Before: child -Not Found Error +DOMException: Not Found Error After: child Before: child -Not Found Error +DOMException: Not Found Error After: child Before: child -Not Found Error +DOMException: Not Found Error After: child diff --git a/ext/exif/tests/bug77540.phpt b/ext/exif/tests/bug77540.phpt index 397e9f8223ba..92a5927068fd 100644 --- a/ext/exif/tests/bug77540.phpt +++ b/ext/exif/tests/bug77540.phpt @@ -13,4 +13,4 @@ DONE --EXPECT-- Width 0 Height 0 -DONE \ No newline at end of file +DONE diff --git a/ext/exif/tests/bug77831.phpt b/ext/exif/tests/bug77831.phpt index 5f29581d11ce..1490b2d66064 100644 --- a/ext/exif/tests/bug77831.phpt +++ b/ext/exif/tests/bug77831.phpt @@ -10,4 +10,4 @@ DONE --EXPECTF-- %A bool(false) -DONE \ No newline at end of file +DONE diff --git a/ext/exif/tests/bug77950.phpt b/ext/exif/tests/bug77950.phpt index bccd9ec3e2c3..7361ff596a61 100644 --- a/ext/exif/tests/bug77950.phpt +++ b/ext/exif/tests/bug77950.phpt @@ -9,4 +9,4 @@ exif_read_data(__DIR__."/bug77950.tiff"); DONE --EXPECTF-- %A -DONE \ No newline at end of file +DONE diff --git a/ext/exif/tests/filename_empty.phpt b/ext/exif/tests/filename_empty.phpt index 753a7c6acd09..89b16cda0afa 100644 --- a/ext/exif/tests/filename_empty.phpt +++ b/ext/exif/tests/filename_empty.phpt @@ -8,30 +8,30 @@ exif try { exif_read_data(""); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { exif_thumbnail(""); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { exif_read_data("foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { exif_thumbnail("foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -exif_read_data(): Argument #1 ($file) must not be empty -exif_thumbnail(): Argument #1 ($file) must not be empty -exif_read_data(): Argument #1 ($file) must not contain any null bytes -exif_thumbnail(): Argument #1 ($file) must not contain any null bytes +ValueError: exif_read_data(): Argument #1 ($file) must not be empty +ValueError: exif_thumbnail(): Argument #1 ($file) must not be empty +ValueError: exif_read_data(): Argument #1 ($file) must not contain any null bytes +ValueError: exif_thumbnail(): Argument #1 ($file) must not contain any null bytes diff --git a/ext/ffi/tests/003.phpt b/ext/ffi/tests/003.phpt index d608c013d5a3..fe7e9b86ff89 100644 --- a/ext/ffi/tests/003.phpt +++ b/ext/ffi/tests/003.phpt @@ -32,12 +32,12 @@ var_dump($ffi->new("d")); try { var_dump($ffi->new("struct _e")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($ffi->new("f")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok\n"; ?> diff --git a/ext/ffi/tests/004.phpt b/ext/ffi/tests/004.phpt index 6852fe19ee75..1349257e5dce 100644 --- a/ext/ffi/tests/004.phpt +++ b/ext/ffi/tests/004.phpt @@ -42,12 +42,12 @@ var_dump($ffi->new("int[_c4]")); try { var_dump($ffi->new("enum _e")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($ffi->new("f")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok\n"; ?> diff --git a/ext/ffi/tests/008.phpt b/ext/ffi/tests/008.phpt index 9ad015eac54b..480eff70e9e4 100644 --- a/ext/ffi/tests/008.phpt +++ b/ext/ffi/tests/008.phpt @@ -20,7 +20,7 @@ $a = $ffi->new("struct {int x,y;}"); try { var_dump(count($a)); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -28,7 +28,7 @@ try { echo "$key => $val\n"; } } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/010.phpt b/ext/ffi/tests/010.phpt index ea17aef08c5d..a3275e018d1e 100644 --- a/ext/ffi/tests/010.phpt +++ b/ext/ffi/tests/010.phpt @@ -11,4 +11,4 @@ FFI::memset($a, ord("a"), FFI::sizeof($a)); var_dump(FFI::string($a, FFI::sizeof($a))); ?> --EXPECT-- -string(12) "aaaaaaaaaaaa" \ No newline at end of file +string(12) "aaaaaaaaaaaa" diff --git a/ext/ffi/tests/012.phpt b/ext/ffi/tests/012.phpt index 8695b0ca0170..d33940ae732e 100644 --- a/ext/ffi/tests/012.phpt +++ b/ext/ffi/tests/012.phpt @@ -9,7 +9,7 @@ ffi.enable=1 try { var_dump(serialize(FFI::cdef()->new("int[2]"))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/013.phpt b/ext/ffi/tests/013.phpt index dc8b99c1d71f..2d8906b08b0f 100644 --- a/ext/ffi/tests/013.phpt +++ b/ext/ffi/tests/013.phpt @@ -16,43 +16,43 @@ var_dump(count($a[0][0])); try { var_dump($ffi->new("void")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($ffi->new("void[1]")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static int foo(int)[5];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static int foo[5](int);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static int foo(int)(int);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("typedef int foo[2][];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("typedef int foo[][2];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/014.phpt b/ext/ffi/tests/014.phpt index d0f877e7a7f2..98c70be33dc6 100644 --- a/ext/ffi/tests/014.phpt +++ b/ext/ffi/tests/014.phpt @@ -17,4 +17,4 @@ ok int(8) int(8) int(16) -ok \ No newline at end of file +ok diff --git a/ext/ffi/tests/015.phpt b/ext/ffi/tests/015.phpt index de48105faa11..ccb7b699b11c 100644 --- a/ext/ffi/tests/015.phpt +++ b/ext/ffi/tests/015.phpt @@ -10,49 +10,49 @@ try { FFI::cdef("struct DIR; static struct DIR dir;"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; static struct DIR *ptr;"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; typedef struct DIR DIR; static DIR dir;"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; typedef struct DIR DIR; static DIR *ptr;"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; static struct DIR foo();"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; static struct DIR* foo();"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; static void foo(struct DIR);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct DIR; static void foo(struct DIR*);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/016.phpt b/ext/ffi/tests/016.phpt index 8a4326bb4d50..4581856e0ad8 100644 --- a/ext/ffi/tests/016.phpt +++ b/ext/ffi/tests/016.phpt @@ -10,19 +10,19 @@ try { FFI::cdef("struct X {void x();};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct X {struct X x;};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct X {struct X *ptr;};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/017.phpt b/ext/ffi/tests/017.phpt index 30f1efdde66c..af268da21a1c 100644 --- a/ext/ffi/tests/017.phpt +++ b/ext/ffi/tests/017.phpt @@ -9,17 +9,17 @@ ffi.enable=1 try { var_dump(FFI::new("struct X {void x();}")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::new("struct X {struct X x;}")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::new("struct X {struct X *ptr;}")); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/018.phpt b/ext/ffi/tests/018.phpt index 76ab23e08dac..902cf9cdba76 100644 --- a/ext/ffi/tests/018.phpt +++ b/ext/ffi/tests/018.phpt @@ -10,13 +10,13 @@ try { FFI::cdef("struct X {struct X x[2];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct X {struct X *ptr[2];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/019.phpt b/ext/ffi/tests/019.phpt index 867c10556d4b..f07f7d382ee9 100644 --- a/ext/ffi/tests/019.phpt +++ b/ext/ffi/tests/019.phpt @@ -10,13 +10,13 @@ try { FFI::cdef("static int foo(int[]);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static int foo(int bar(int));"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/020.phpt b/ext/ffi/tests/020.phpt index 37cb6b17d116..aecc3e2631c1 100644 --- a/ext/ffi/tests/020.phpt +++ b/ext/ffi/tests/020.phpt @@ -14,7 +14,7 @@ try { $p->y = 1; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = $ffi->new("struct {const int x; int y;}"); @@ -22,35 +22,35 @@ try { $p->x = 1; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = $ffi->new("const struct {int x; int y;}"); $p->x = 1; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = $ffi->new("const int[10]"); $p[1] = 1; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = $ffi->new("const int * [1]"); $p[0] = null; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = $ffi->new("int * const [1]"); $p[0] = null; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = FFI::cdef("typedef int * const t[1];"); @@ -58,7 +58,7 @@ try { $p[0] = null; echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ok diff --git a/ext/ffi/tests/023.phpt b/ext/ffi/tests/023.phpt index 9cf77d723b04..c9d9cf1b2829 100644 --- a/ext/ffi/tests/023.phpt +++ b/ext/ffi/tests/023.phpt @@ -11,7 +11,7 @@ ffi.enable=1 try { var_dump(FFI::sizeof($ffi->new("struct {}"))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(FFI::sizeof($ffi->new("struct {int a}"))); var_dump(FFI::sizeof($ffi->new("struct {int a; int b}"))); diff --git a/ext/ffi/tests/027.phpt b/ext/ffi/tests/027.phpt index b71bab4001bf..31d18c06b712 100644 --- a/ext/ffi/tests/027.phpt +++ b/ext/ffi/tests/027.phpt @@ -12,70 +12,70 @@ try { $p = $ffi->new("int[*]"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static int (*foo)[*];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("typedef int foo[*];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("static void foo(int[*][*]);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::sizeof($ffi->new("int[0]"))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::sizeof($ffi->new("int[]"))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::sizeof($ffi->cast("int[]", $ffi->new("int[2]")))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct _x {int a; int b[];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = FFI::cdef("typedef int(*foo)[];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = FFI::cdef("typedef int foo[][2];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = FFI::cdef("typedef int foo[];"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $f = FFI::cdef("static int foo(int[]);"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/028.phpt b/ext/ffi/tests/028.phpt index 473980bcd218..13e477a39397 100644 --- a/ext/ffi/tests/028.phpt +++ b/ext/ffi/tests/028.phpt @@ -10,37 +10,37 @@ try { FFI::cdef("struct _x {int a; int b[0];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct _x {int a; int b[];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct _x {int a[0]; int b;};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct _x {int a[]; int b;};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("struct _x { struct {int a; int b[];}; int c;};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef("union _x {int a; int b[];};"); echo "ok\n"; } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/031.phpt b/ext/ffi/tests/031.phpt index d4b43f8f6e6d..295155c648b8 100644 --- a/ext/ffi/tests/031.phpt +++ b/ext/ffi/tests/031.phpt @@ -13,7 +13,7 @@ function test_size($expected_size, $type) { echo "FAIL: sizeof($type) != $expected_size ($size)\n"; } } catch (Throwable $e) { - echo $type . "=>" . get_class($e) . ": " . $e->getMessage()."\n"; + echo $type, '=>', $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/ffi/tests/035.phpt b/ext/ffi/tests/035.phpt index bd8c6df71f97..01ccc1eaf4ce 100644 --- a/ext/ffi/tests/035.phpt +++ b/ext/ffi/tests/035.phpt @@ -13,7 +13,7 @@ FFI::free($p); try { var_dump($p); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- diff --git a/ext/ffi/tests/045.phpt b/ext/ffi/tests/045.phpt index 84cecae01562..a4fec1115aeb 100644 --- a/ext/ffi/tests/045.phpt +++ b/ext/ffi/tests/045.phpt @@ -12,12 +12,12 @@ var_dump(FFI::isNull(FFI::addr($i))); try { var_dump(FFI::isNull(null)); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(FFI::isNull(FFI::cdef()->new("int[0]"))); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/047.phpt b/ext/ffi/tests/047.phpt index e09da3fe9eec..48af033eb299 100644 --- a/ext/ffi/tests/047.phpt +++ b/ext/ffi/tests/047.phpt @@ -15,7 +15,7 @@ try { $x->cdata = 42; var_dump($x); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $x = FFI::cdef()->new("struct {int cdata;}"); @@ -23,7 +23,7 @@ try { $x->cdata = 42; var_dump($x); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -31,7 +31,7 @@ object(FFI\CData:int32_t)#%d (1) { ["cdata"]=> int(42) } -Attempt to assign field 'cdata' of non C struct/union +FFI\Exception: Attempt to assign field 'cdata' of non C struct/union object(FFI\CData:struct )#%d (1) { ["cdata"]=> int(42) diff --git a/ext/ffi/tests/bug77706.phpt b/ext/ffi/tests/bug77706.phpt index 704c4aec5315..1cffbfac3f44 100644 --- a/ext/ffi/tests/bug77706.phpt +++ b/ext/ffi/tests/bug77706.phpt @@ -33,25 +33,25 @@ $ffi = FFI::cdef($header, 'libc.so.6'); try { $ffi->time(); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ffi->time(null, null); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ffi->fprintf($ffi->stdout); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ffi->fprintf($ffi->stdout, 123, "Hello %s\n", "World"); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ffi/tests/bug78761.phpt b/ext/ffi/tests/bug78761.phpt index fc1c66129114..ec8b096dde4b 100644 --- a/ext/ffi/tests/bug78761.phpt +++ b/ext/ffi/tests/bug78761.phpt @@ -16,8 +16,8 @@ opcache.preload={PWD}/bug78761_preload.php try { FFI::cdef()->cast('char[10]', FFI::cdef()->new('char[1]')); } catch (FFI\Exception $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -attempt to cast to larger type +FFI\Exception: attempt to cast to larger type diff --git a/ext/ffi/tests/bug78762.phpt b/ext/ffi/tests/bug78762.phpt index 5c621d3547e8..d6adf5af9751 100644 --- a/ext/ffi/tests/bug78762.phpt +++ b/ext/ffi/tests/bug78762.phpt @@ -7,8 +7,8 @@ ffi try { FFI::cdef()->cast('char[10]', FFI::cdef()->new('char[1]')); } catch (FFI\Exception $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -attempt to cast to larger type +FFI\Exception: attempt to cast to larger type diff --git a/ext/ffi/tests/bug79576.phpt b/ext/ffi/tests/bug79576.phpt index a5dee75564c6..5712701c2086 100644 --- a/ext/ffi/tests/bug79576.phpt +++ b/ext/ffi/tests/bug79576.phpt @@ -11,12 +11,12 @@ if (PHP_DEBUG || getenv('SKIP_ASAN')) echo "xleak FFI cleanup after parser error try { FFI::cdef('struct tree *get_tree(const oid *, size_t, struct tree *);'); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef('struct tree *get_tree(oid, size_t, struct tree *);'); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { FFI::cdef(' @@ -25,7 +25,7 @@ typedef struct _simple_struct { } simple_struct; '); } catch (Throwable $e) { - echo get_class($e) . ": " . $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE diff --git a/ext/ffi/tests/deprecations.phpt b/ext/ffi/tests/deprecations.phpt index d62a214712d0..07fd464ff7c1 100644 --- a/ext/ffi/tests/deprecations.phpt +++ b/ext/ffi/tests/deprecations.phpt @@ -15,7 +15,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { FFI::new("uint8_t[2]"); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(null); @@ -29,7 +29,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { FFI::type("uint16_t[2]"); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(null); @@ -40,13 +40,13 @@ set_error_handler(function ($severity, $message, $file, $line) { try { FFI::cast("uint8_t[2]", $p1); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Calling FFI::new() statically is deprecated in %s on line %d -Calling FFI::new() statically is deprecated +Exception: Calling FFI::new() statically is deprecated object(FFI\CData:uint8_t[2])#1 (2) { [0]=> int(0) @@ -55,7 +55,7 @@ object(FFI\CData:uint8_t[2])#1 (2) { } Deprecated: Calling FFI::type() statically is deprecated in %s on line %d -Calling FFI::type() statically is deprecated +Exception: Calling FFI::type() statically is deprecated Deprecated: Calling FFI::cast() statically is deprecated in %s on line %d -Calling FFI::cast() statically is deprecated +Exception: Calling FFI::cast() statically is deprecated diff --git a/ext/ffi/tests/gh14286_2.phpt b/ext/ffi/tests/gh14286_2.phpt index 4dc48ccc27a1..56fb2559008c 100644 --- a/ext/ffi/tests/gh14286_2.phpt +++ b/ext/ffi/tests/gh14286_2.phpt @@ -14,8 +14,8 @@ try { } x; "); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Failed resolving C variable 'x' +FFI\Exception: Failed resolving C variable 'x' diff --git a/ext/ffi/tests/gh16397.phpt b/ext/ffi/tests/gh16397.phpt index 19ddf7ecc62a..d10ab1464d98 100644 --- a/ext/ffi/tests/gh16397.phpt +++ b/ext/ffi/tests/gh16397.phpt @@ -8,8 +8,8 @@ $ffi = FFI::cdef(); try { var_dump($ffi != 1); } catch (FFI\Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot compare FFI objects +FFI\Exception: Cannot compare FFI objects diff --git a/ext/ffi/tests/gh18629_cdef_resolve_func.phpt b/ext/ffi/tests/gh18629_cdef_resolve_func.phpt index ae81412efa63..e6c3abb53d7c 100644 --- a/ext/ffi/tests/gh18629_cdef_resolve_func.phpt +++ b/ext/ffi/tests/gh18629_cdef_resolve_func.phpt @@ -9,8 +9,8 @@ ffi.enable=1 try { $ffi = FFI::cdef("void nonexistent_ffi_test_func(void);"); } catch (\FFI\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Failed resolving C function 'nonexistent_ffi_test_func' +FFI\Exception: Failed resolving C function 'nonexistent_ffi_test_func' diff --git a/ext/ffi/tests/gh18629_read_field_non_struct.phpt b/ext/ffi/tests/gh18629_read_field_non_struct.phpt index 307fde1a53b8..c8b550f0c7f1 100644 --- a/ext/ffi/tests/gh18629_read_field_non_struct.phpt +++ b/ext/ffi/tests/gh18629_read_field_non_struct.phpt @@ -10,8 +10,8 @@ $x = FFI::cdef()->new("int*"); try { $y = $x->foo; } catch (\FFI\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attempt to read field 'foo' of non C struct/union +FFI\Exception: Attempt to read field 'foo' of non C struct/union diff --git a/ext/ffi/tests/gh9698.phpt b/ext/ffi/tests/gh9698.phpt index bab403810cd3..a9524d361e4e 100644 --- a/ext/ffi/tests/gh9698.phpt +++ b/ext/ffi/tests/gh9698.phpt @@ -11,11 +11,12 @@ try { stream_wrapper_register('badffi', 'FFI\CData'); file_get_contents('badffi://x'); } catch (Throwable $exception) { - echo $exception->getMessage(); + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } ?> DONE --EXPECT-- -Attempt to assign field 'context' to uninitialized FFI\CData object +FFI\Exception: Attempt to assign field 'context' to uninitialized FFI\CData object + DONE diff --git a/ext/fileinfo/tests/bug61173.phpt b/ext/fileinfo/tests/bug61173.phpt index e135f9093339..9d18dc8bcf52 100644 --- a/ext/fileinfo/tests/bug61173.phpt +++ b/ext/fileinfo/tests/bug61173.phpt @@ -9,8 +9,8 @@ try { $finfo = new finfo(1, '', false); var_dump($finfo); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -finfo::__construct() expects at most 2 arguments, 3 given +ArgumentCountError: finfo::__construct() expects at most 2 arguments, 3 given diff --git a/ext/fileinfo/tests/clone_serialize.phpt b/ext/fileinfo/tests/clone_serialize.phpt index 768cccfff392..7a63d04908a1 100644 --- a/ext/fileinfo/tests/clone_serialize.phpt +++ b/ext/fileinfo/tests/clone_serialize.phpt @@ -11,17 +11,17 @@ try { $finfo2 = clone $finfo; var_dump($finfo2->buffer("Test string")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $finfo3 = unserialize(serialize($finfo)); var_dump($finfo3->buffer("Test string")); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- string(%d) "%s" -Trying to clone an uncloneable object of class finfo -Serialization of 'finfo' is not allowed +Error: Trying to clone an uncloneable object of class finfo +Exception: Serialization of 'finfo' is not allowed diff --git a/ext/fileinfo/tests/finfo_close_error.phpt b/ext/fileinfo/tests/finfo_close_error.phpt index c7873b462724..798adb7e4dab 100644 --- a/ext/fileinfo/tests/finfo_close_error.phpt +++ b/ext/fileinfo/tests/finfo_close_error.phpt @@ -11,7 +11,7 @@ $fp = fopen( __FILE__, 'r' ); try { var_dump( finfo_close( $fp ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -21,4 +21,4 @@ try { -- Testing finfo_close() function with wrong resource type -- Deprecated: Function finfo_close() is deprecated since 8.5, as finfo objects are freed automatically in %s on line %d -finfo_close(): Argument #1 ($finfo) must be of type finfo, resource given +TypeError: finfo_close(): Argument #1 ($finfo) must be of type finfo, resource given diff --git a/ext/fileinfo/tests/finfo_file_001.phpt b/ext/fileinfo/tests/finfo_file_001.phpt index 91b9b69717f6..184eee77633a 100644 --- a/ext/fileinfo/tests/finfo_file_001.phpt +++ b/ext/fileinfo/tests/finfo_file_001.phpt @@ -9,20 +9,20 @@ $fp = finfo_open(); try { var_dump(finfo_file($fp, "\0")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(finfo_file($fp, '')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(finfo_file($fp, '.')); var_dump(finfo_file($fp, '&')); ?> --EXPECTF-- -finfo_file(): Argument #2 ($filename) must not contain any null bytes -finfo_file(): Argument #2 ($filename) must not be empty +ValueError: finfo_file(): Argument #2 ($filename) must not contain any null bytes +ValueError: finfo_file(): Argument #2 ($filename) must not be empty string(9) "directory" Warning: finfo_file(): Failed to open stream: No such file or directory in %s on line %d diff --git a/ext/fileinfo/tests/finfo_file_basic.phpt b/ext/fileinfo/tests/finfo_file_basic.phpt index 4545a3063a7f..9348dea33075 100644 --- a/ext/fileinfo/tests/finfo_file_basic.phpt +++ b/ext/fileinfo/tests/finfo_file_basic.phpt @@ -16,7 +16,7 @@ var_dump( finfo_file( $finfo, $magicFile ) ); try { var_dump( finfo_file( $finfo, $magicFile.chr(0).$magicFile) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -25,4 +25,4 @@ try { string(28) "text/x-php; charset=us-ascii" string(22) "PHP script, ASCII text" string(29) "text/x-file; charset=us-ascii" -finfo_file(): Argument #2 ($filename) must not contain any null bytes +ValueError: finfo_file(): Argument #2 ($filename) must not contain any null bytes diff --git a/ext/fileinfo/tests/finfo_open_001.phpt b/ext/fileinfo/tests/finfo_open_001.phpt index 2ed7168e90d3..2ee999113b95 100644 --- a/ext/fileinfo/tests/finfo_open_001.phpt +++ b/ext/fileinfo/tests/finfo_open_001.phpt @@ -7,7 +7,7 @@ fileinfo try { var_dump(finfo_open(FILEINFO_MIME, "\0")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(finfo_open(FILEINFO_MIME, NULL)); @@ -22,23 +22,23 @@ var_dump($obj = new finfo(FILEINFO_MIME, '')); try { var_dump($obj = new finfo(FILEINFO_MIME, 123)); } catch (\Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($obj = new finfo(FILEINFO_MIME, 1.0)); } catch (\Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($obj = new finfo(FILEINFO_MIME, '/foo/bar/inexistent')); } catch (\Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -finfo_open(): Argument #2 ($magic_database) must not contain any null bytes +ValueError: finfo_open(): Argument #2 ($magic_database) must not contain any null bytes object(finfo)#%d (0) { } object(finfo)#%d (0) { @@ -68,6 +68,6 @@ object(finfo)#%d (%d) { } object(finfo)#%d (%d) { } -finfo::__construct(): Failed to open stream: No such file or directory -finfo::__construct(): Failed to open stream: No such file or directory -finfo::__construct(): Failed to open stream: No such file or directory +Exception: finfo::__construct(): Failed to open stream: No such file or directory +Exception: finfo::__construct(): Failed to open stream: No such file or directory +Exception: finfo::__construct(): Failed to open stream: No such file or directory diff --git a/ext/fileinfo/tests/finfo_open_003.phpt b/ext/fileinfo/tests/finfo_open_003.phpt index 39a45a61c6ff..7e464c3d39c2 100644 --- a/ext/fileinfo/tests/finfo_open_003.phpt +++ b/ext/fileinfo/tests/finfo_open_003.phpt @@ -11,9 +11,9 @@ var_dump(finfo_open(FILEINFO_MIME, $buggyPath)); try { $object = new finfo(FILEINFO_MIME, $buggyPath); } catch (\Exception $ex) { - echo "TEST:" . $ex->getMessage() . PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECTF-- bool(false) -TEST:Constructor failed +Exception: Constructor failed diff --git a/ext/fileinfo/tests/finfo_open_004.phpt b/ext/fileinfo/tests/finfo_open_004.phpt index ff911bc75086..06f7858cb24d 100644 --- a/ext/fileinfo/tests/finfo_open_004.phpt +++ b/ext/fileinfo/tests/finfo_open_004.phpt @@ -13,10 +13,10 @@ var_dump(finfo_open(FILEINFO_MIME, $buggyPath)); try { $object = new finfo(FILEINFO_MIME, $buggyPath); } catch (\Exception $ex) { - echo "TEST:" . $ex->getMessage() . PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECTF-- Warning: finfo_open(): File name is longer than the maximum allowed path length on this platform (%d): %s in %s on line %d bool(false) -TEST:finfo::__construct(): File name is longer than the maximum allowed path length on this platform (%d): %s +Exception: finfo::__construct(): File name is longer than the maximum allowed path length on this platform (%d): %s diff --git a/ext/fileinfo/tests/finfo_open_error.phpt b/ext/fileinfo/tests/finfo_open_error.phpt index 7c6fc9766372..c48230b7aa2f 100644 --- a/ext/fileinfo/tests/finfo_open_error.phpt +++ b/ext/fileinfo/tests/finfo_open_error.phpt @@ -14,13 +14,13 @@ var_dump( finfo_open( PHP_INT_MAX - 1, $magicFile ) ); try { var_dump( finfo_open( 'foobar' ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( new finfo('foobar') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -37,5 +37,5 @@ bool(false) Warning: finfo_open(): using regular magic file `%smagic' in %sfinfo_open_error.php on line %d object(finfo)#%d (0) { } -finfo_open(): Argument #1 ($flags) must be of type int, string given -finfo::__construct(): Argument #1 ($flags) must be of type int, string given +TypeError: finfo_open(): Argument #1 ($flags) must be of type int, string given +TypeError: finfo::__construct(): Argument #1 ($flags) must be of type int, string given diff --git a/ext/fileinfo/tests/finfo_uninitialized.phpt b/ext/fileinfo/tests/finfo_uninitialized.phpt index 533574c9c0dc..9aba6719414c 100644 --- a/ext/fileinfo/tests/finfo_uninitialized.phpt +++ b/ext/fileinfo/tests/finfo_uninitialized.phpt @@ -10,37 +10,37 @@ $finfo = (new ReflectionClass('finfo'))->newInstanceWithoutConstructor(); try { var_dump(finfo_set_flags($finfo, FILEINFO_NONE)); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($finfo->set_flags(FILEINFO_NONE)); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(finfo_file($finfo, __FILE__)); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($finfo->file(__FILE__)); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(finfo_buffer($finfo, file_get_contents(__FILE__))); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($finfo->file(file_get_contents(__FILE__))); } catch (Error $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/fileinfo/tests/gh18267.phpt b/ext/fileinfo/tests/gh18267.phpt index ba7647288d1d..a33a51775a80 100644 --- a/ext/fileinfo/tests/gh18267.phpt +++ b/ext/fileinfo/tests/gh18267.phpt @@ -8,7 +8,7 @@ $cls = new finfo(); try { $cls->file("test",FILEINFO_NONE, STDERR); } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --EXPECT-- -finfo::file(): supplied resource is not a valid Stream-Context resource +TypeError: finfo::file(): supplied resource is not a valid Stream-Context resource diff --git a/ext/fileinfo/tests/mime_content_type_001.phpt b/ext/fileinfo/tests/mime_content_type_001.phpt index 93b145768141..74e22de59aa0 100644 --- a/ext/fileinfo/tests/mime_content_type_001.phpt +++ b/ext/fileinfo/tests/mime_content_type_001.phpt @@ -8,22 +8,22 @@ fileinfo try { mime_content_type(1); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mime_content_type(NULL); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mime_content_type(new stdclass); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mime_content_type(array()); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } mime_content_type('foo/inexistent'); @@ -31,21 +31,21 @@ mime_content_type('foo/inexistent'); try { mime_content_type(''); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mime_content_type("\0"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given -mime_content_type(): Argument #1 ($filename) must be of type resource|string, null given -mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given -mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given +TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, int given +TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, null given +TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, stdClass given +TypeError: mime_content_type(): Argument #1 ($filename) must be of type resource|string, array given Warning: mime_content_type(): Failed to open stream: No such file or directory in %s on line %d -mime_content_type(): Argument #1 ($filename) must not be empty -mime_content_type(): Argument #1 ($filename) must not contain any null bytes +ValueError: mime_content_type(): Argument #1 ($filename) must not be empty +TypeError: mime_content_type(): Argument #1 ($filename) must not contain any null bytes diff --git a/ext/filter/tests/011.phpt b/ext/filter/tests/011.phpt index 772fdf6b5ec7..008967099f7d 100644 --- a/ext/filter/tests/011.phpt +++ b/ext/filter/tests/011.phpt @@ -16,7 +16,7 @@ var_dump(filter_input(INPUT_GET, "a", FILTER_SANITIZE_SPECIAL_CHARS, array(1,2,3 try { filter_input(INPUT_GET, "b", FILTER_VALIDATE_FLOAT, new stdClass); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(filter_input(INPUT_POST, "d", FILTER_VALIDATE_FLOAT)); var_dump(filter_input(INPUT_POST, "c", FILTER_SANITIZE_SPECIAL_CHARS)); @@ -27,7 +27,7 @@ echo "Done\n"; --EXPECT-- string(18) "http://example.com" string(27) "<b>test</b>" -filter_input(): Argument #4 ($options) must be of type array|int, stdClass given +TypeError: filter_input(): Argument #4 ($options) must be of type array|int, stdClass given float(12345.7) string(29) "<p>string</p>" bool(false) diff --git a/ext/filter/tests/017.phpt b/ext/filter/tests/017.phpt index e37177c60d6e..9d2e702b4c7f 100644 --- a/ext/filter/tests/017.phpt +++ b/ext/filter/tests/017.phpt @@ -13,7 +13,7 @@ var_dump(filter_var("data", FILTER_VALIDATE_REGEXP, array("options"=>array("rege try { filter_var("data", FILTER_VALIDATE_REGEXP); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -24,5 +24,5 @@ bool(false) string(4) "data" bool(false) bool(false) -filter_var(): "regexp" option is missing +ValueError: filter_var(): "regexp" option is missing Done diff --git a/ext/filter/tests/029.phpt b/ext/filter/tests/029.phpt index ca4feb2e4ae0..44415e06b090 100644 --- a/ext/filter/tests/029.phpt +++ b/ext/filter/tests/029.phpt @@ -17,19 +17,19 @@ var_dump(filter_var("", FILTER_CALLBACK, array("options"=>"test"))); try { filter_var("qwe", FILTER_CALLBACK, array("options"=>"no such func")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { filter_var("qwe", FILTER_CALLBACK, array("options"=>"")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { filter_var("qwe", FILTER_CALLBACK); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* Simple class method callback */ @@ -68,7 +68,7 @@ function test3($var) { try { var_dump(filter_var("data", FILTER_CALLBACK, array("options"=>"test3"))); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -77,9 +77,9 @@ echo "Done\n"; string(4) "DATA" string(46) "~!@#$%^&*()_QWERTYUIOPASDFGHJKLZXCVBNM<>>?"}{:" string(0) "" -filter_var(): Option must be a valid callback -filter_var(): Option must be a valid callback -filter_var(): Option must be a valid callback +TypeError: filter_var(): Option must be a valid callback +TypeError: filter_var(): Option must be a valid callback +TypeError: filter_var(): Option must be a valid callback string(4) "data" string(46) "~!@#$%^&*()_qwertyuiopasdfghjklzxcvbnm<>>?"}{:" string(0) "" @@ -95,5 +95,5 @@ NULL Warning: test2(): Argument #1 ($var) must be passed by reference, value given in %s on line %d NULL -string(4) "test" +Exception: test Done diff --git a/ext/filter/tests/031.phpt b/ext/filter/tests/031.phpt index 70117fa025ad..eb930642d18f 100644 --- a/ext/filter/tests/031.phpt +++ b/ext/filter/tests/031.phpt @@ -36,7 +36,7 @@ foreach ($floats as $float => $dec) { try { var_dump(filter_var($float, FILTER_VALIDATE_FLOAT, array("options"=>array('decimal' => $dec)))); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,5 +55,5 @@ custom decimal: bool(false) float(1.234) float(1.234) -filter_var(): "decimal" option must be one character long +ValueError: filter_var(): "decimal" option must be one character long bool(false) diff --git a/ext/filter/tests/039.phpt b/ext/filter/tests/039.phpt index 229feecd4475..22a7170c05dd 100644 --- a/ext/filter/tests/039.phpt +++ b/ext/filter/tests/039.phpt @@ -14,7 +14,7 @@ var_dump(filter_var_array(array(), 1000000)); try { filter_var_array(array(), ""); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "-- (2)\n"; @@ -24,7 +24,7 @@ var_dump(filter_var_array(array(""=>""), 1000000)); try { filter_var_array(array(""=>""), ""); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "-- (3)\n"; @@ -34,7 +34,7 @@ var_dump(filter_var_array(array("aaa"=>"bbb"), 1000000)); try { filter_var_array(array("aaa"=>"bbb"), ""); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "-- (4)\n"; @@ -42,7 +42,7 @@ echo "-- (4)\n"; try { filter_var_array(array(), new stdclass); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(filter_var_array(array(), array())); @@ -54,12 +54,12 @@ echo "-- (5)\n"; try { filter_var_array(array("var_name"=>""), array("var_name"=>-1, "asdas"=>"asdasd", "qwe"=>"rty", ""=>"")); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { filter_var_array(array("asdas"=>"text"), array("var_name"=>-1, "asdas"=>"asdasd", "qwe"=>"rty", ""=>"")); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $a = array(""=>""); $b = -1; @@ -74,7 +74,7 @@ $a = array(""=>""); $b = ""; try { filter_var_array($a, $b); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($a, $b); @@ -96,7 +96,7 @@ bool(false) Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d bool(false) -filter_var_array(): Argument #2 ($options) must be of type array|int, string given +TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given -- (2) Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d @@ -104,7 +104,7 @@ bool(false) Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d bool(false) -filter_var_array(): Argument #2 ($options) must be of type array|int, string given +TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given -- (3) Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d @@ -112,9 +112,9 @@ bool(false) Warning: filter_var_array(): Unknown filter with ID 1000000 in %s on line %d bool(false) -filter_var_array(): Argument #2 ($options) must be of type array|int, string given +TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given -- (4) -filter_var_array(): Argument #2 ($options) must be of type array|int, stdClass given +TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, stdClass given array(0) { } array(1) { @@ -134,10 +134,10 @@ array(1) { -- (5) Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d -filter_var_array(): Argument #2 ($options) cannot contain empty keys +ValueError: filter_var_array(): Argument #2 ($options) cannot contain empty keys Warning: filter_var_array(): Unknown filter with ID 0 in %s on line %d -filter_var_array(): Argument #2 ($options) cannot contain empty keys +ValueError: filter_var_array(): Argument #2 ($options) cannot contain empty keys Warning: filter_var_array(): Unknown filter with ID -1 in %s on line %d bool(false) @@ -154,7 +154,7 @@ array(1) { string(0) "" } int(100000) -filter_var_array(): Argument #2 ($options) must be of type array|int, string given +TypeError: filter_var_array(): Argument #2 ($options) must be of type array|int, string given array(1) { [""]=> string(0) "" diff --git a/ext/filter/tests/040.phpt b/ext/filter/tests/040.phpt index 316088ff31cd..ff4eedf63b63 100644 --- a/ext/filter/tests/040.phpt +++ b/ext/filter/tests/040.phpt @@ -19,7 +19,7 @@ var_dump(filter_has_var(INPUT_GET, "cc")); try { filter_has_var(-1, "cc"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(filter_has_var(0, "cc")); @@ -34,6 +34,6 @@ bool(true) bool(true) bool(false) bool(false) -filter_has_var(): Argument #1 ($input_type) must be an INPUT_* constant +ValueError: filter_has_var(): Argument #1 ($input_type) must be an INPUT_* constant bool(false) Done diff --git a/ext/filter/tests/055.phpt b/ext/filter/tests/055.phpt index f058db064b02..23241b76ae90 100644 --- a/ext/filter/tests/055.phpt +++ b/ext/filter/tests/055.phpt @@ -24,7 +24,7 @@ foreach ($values as $value) { try { var_dump(filter_var($value[0], FILTER_VALIDATE_MAC, $value[1])); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(17) "01:23:45:67:89:aB" bool(false) bool(false) string(14) "0123.4567.89ab" -filter_var(): "separator" option must be one character long -filter_var(): "separator" option must be one character long +ValueError: filter_var(): "separator" option must be one character long +ValueError: filter_var(): "separator" option must be one character long Done diff --git a/ext/filter/tests/bug51368.phpt b/ext/filter/tests/bug51368.phpt index a3490215afdc..c13866932108 100644 --- a/ext/filter/tests/bug51368.phpt +++ b/ext/filter/tests/bug51368.phpt @@ -14,11 +14,11 @@ $options = ['flags' => FILTER_FLAG_ALLOW_THOUSAND, 'options' => ['thousand' => ' try { filter_var('12345', FILTER_VALIDATE_FLOAT, $options); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- float(1000) float(1234.567) -filter_var(): "thousand" option must not be empty +ValueError: filter_var(): "thousand" option must not be empty diff --git a/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt b/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt index 868829dbbac0..db857f0fef04 100644 --- a/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt +++ b/ext/filter/tests/throw-on-failure/filter_input_array_failure.phpt @@ -11,14 +11,14 @@ echo "\nvalidation fails (array type check)\n"; try { filter_input_array(INPUT_GET, ['a' => ['flags' => FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE]]); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (filter value)\n"; try { filter_input_array(INPUT_GET, ['a' => ['filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_THROW_ON_FAILURE]]); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/filter/tests/throw-on-failure/filter_input_failure.phpt b/ext/filter/tests/throw-on-failure/filter_input_failure.phpt index 8ec2d572e7f1..7130a777960b 100644 --- a/ext/filter/tests/throw-on-failure/filter_input_failure.phpt +++ b/ext/filter/tests/throw-on-failure/filter_input_failure.phpt @@ -11,21 +11,21 @@ echo "missing value\n"; try { filter_input(INPUT_GET, 'b', FILTER_DEFAULT, FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (array type check)\n"; try { filter_input(INPUT_GET, 'a', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (filter value)\n"; try { filter_input(INPUT_GET, 'a', FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt b/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt index f40dec1537dd..36d1db4eaa1a 100644 --- a/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt +++ b/ext/filter/tests/throw-on-failure/filter_var_array_failure.phpt @@ -9,21 +9,21 @@ echo "\nvalidation fails (array type check)\n"; try { filter_var_array(['a' => 'a'], ['a' => ['flags' => FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE]]); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (object without __toString)\n"; try { filter_var_array(['a' => new stdClass()], ['a' => ['flags' => FILTER_THROW_ON_FAILURE]]); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (filter value)\n"; try { filter_var_array(['a' => true], ['a' => ['filter' => FILTER_VALIDATE_EMAIL, 'flags' => FILTER_THROW_ON_FAILURE]]); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/filter/tests/throw-on-failure/filter_var_failure.phpt b/ext/filter/tests/throw-on-failure/filter_var_failure.phpt index fccc61da4d0f..d7a53105200c 100644 --- a/ext/filter/tests/throw-on-failure/filter_var_failure.phpt +++ b/ext/filter/tests/throw-on-failure/filter_var_failure.phpt @@ -9,21 +9,21 @@ echo "\nvalidation fails (array type check)\n"; try { filter_var('a', FILTER_DEFAULT, FILTER_REQUIRE_ARRAY | FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (object without __toString)\n"; try { filter_var(new stdClass(), FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nvalidation fails (filter value)\n"; try { filter_var('a', FILTER_VALIDATE_EMAIL, FILTER_THROW_ON_FAILURE); } catch (Filter\FilterFailedException $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt b/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt index 48c37618ed91..3dff1a85f788 100644 --- a/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt +++ b/ext/filter/tests/throw-on-failure/throw-and-null-error.phpt @@ -13,54 +13,54 @@ echo "filter_input(), with a missing value\n"; try { filter_input(INPUT_GET, 'b', FILTER_DEFAULT, $flags); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { filter_input(INPUT_GET, 'b', FILTER_DEFAULT, ['flags' => $flags]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nfilter_input(), with a missing value and a default\n"; try { filter_input(INPUT_GET, 'b', FILTER_DEFAULT, ['flags' => $flags, 'options' => ['default' => 'a']]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nfilter_input(), with a present value\n"; try { filter_input(INPUT_GET, 'a', FILTER_DEFAULT, $flags); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { filter_input(INPUT_GET, 'a', FILTER_DEFAULT, ['flags' => $flags]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nfilter_var()\n"; try { filter_var(true, FILTER_DEFAULT, $flags); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { filter_var(true, FILTER_DEFAULT, ['flags' => $flags]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nfilter_input_array()\n"; try { filter_input_array(INPUT_GET, ['a' => ['flags' => $flags]]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nfilter_var_array()\n"; try { filter_var_array(['a' => true], ['a' => ['flags' => $flags]]); } catch (ValueError $e) { - echo get_class($e) . ": " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/ftp/tests/004.phpt b/ext/ftp/tests/004.phpt index fde0b5090399..131fe984a1d9 100644 --- a/ext/ftp/tests/004.phpt +++ b/ext/ftp/tests/004.phpt @@ -11,7 +11,7 @@ require 'server.inc'; try { ftp_connect('127.0.0.1', 0, -3); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $ftp = ftp_connect('127.0.0.1', $port); @@ -23,7 +23,7 @@ var_dump(ftp_login($ftp, 'user', 'bogus')); var_dump(ftp_quit($ftp)); ?> --EXPECTF-- -ftp_connect(): Argument #3 ($timeout) must be greater than 0 +ValueError: ftp_connect(): Argument #3 ($timeout) must be greater than 0 bool(true) Warning: ftp_login(): Not logged in. in %s on line %d diff --git a/ext/ftp/tests/005.phpt b/ext/ftp/tests/005.phpt index f08cadd2b428..632badc9c59a 100644 --- a/ext/ftp/tests/005.phpt +++ b/ext/ftp/tests/005.phpt @@ -22,19 +22,19 @@ var_dump(ftp_exec($ftp, 'x')); try { ftp_fget($ftp, STDOUT, 'x', 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { ftp_fput($ftp, 'x', fopen(__FILE__, 'r'), 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { ftp_get($ftp, 'x', 'y', 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(ftp_mdtm($ftp, 'x')); @@ -44,13 +44,13 @@ var_dump(ftp_nb_continue($ftp)); try { ftp_nb_fget($ftp, STDOUT, 'x', 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { ftp_nb_fput($ftp, 'x', fopen(__FILE__, 'r'), 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(ftp_systype($ftp)); @@ -77,9 +77,9 @@ bool(false) Warning: ftp_exec(): Command not implemented (5). in %s005.php on line %d bool(false) -ftp_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY -ftp_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY -ftp_get(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY +ValueError: ftp_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY +ValueError: ftp_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY +ValueError: ftp_get(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY int(-1) Warning: ftp_mkdir(): Command not implemented (7). in %s005.php on line %d @@ -87,8 +87,8 @@ bool(false) Warning: ftp_nb_continue(): No non-blocking transfer to continue in %s on line %d int(0) -ftp_nb_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY -ftp_nb_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY +ValueError: ftp_nb_fget(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY +ValueError: ftp_nb_fput(): Argument #4 ($mode) must be either FTP_ASCII or FTP_BINARY Warning: ftp_systype(): Command not implemented (8). in %s005.php on line %d bool(false) diff --git a/ext/ftp/tests/007.phpt b/ext/ftp/tests/007.phpt index a23b5496be91..38eb20badd7f 100644 --- a/ext/ftp/tests/007.phpt +++ b/ext/ftp/tests/007.phpt @@ -13,202 +13,202 @@ $ftp = tmpfile(); try { var_dump(ftp_login($ftp, 'user', 'pass')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_pwd($ftp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_cdup($ftp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_chdir($ftp, '~')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_exec($ftp, 'x')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_raw($ftp, 'x')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_mkdir($ftp, '/')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_rmdir($ftp, '/')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_chmod($ftp, 7777, '/')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_alloc($ftp, 7777)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nlist($ftp, '/')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_rawlist($ftp, '~')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_mlsd($ftp, '~')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_systype($ftp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_fget($ftp, $ftp, 'remote', 7777)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nb_fget($ftp, $ftp, 'remote', 7777)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_pasv($ftp, false)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_get($ftp, 'local', 'remote', 7777)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nb_get($ftp, 'local', 'remote', 7777)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nb_continue($ftp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_fput($ftp, 'remote', $ftp, 9999)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nb_fput($ftp, 'remote', $ftp, 9999)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_put($ftp, 'remote', 'local', 9999)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_append($ftp, 'remote', 'local', 9999)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_nb_put($ftp, 'remote', 'local', 9999)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_size($ftp, '~')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_mdtm($ftp, '~')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_rename($ftp, 'old', 'new')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_delete($ftp, 'gone')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_site($ftp, 'localhost')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_close($ftp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_set_option($ftp, 1, 2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(ftp_get_option($ftp, 1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($ftp); ?> --EXPECT-- -ftp_login(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_pwd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_cdup(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_chdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_exec(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_raw(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_mkdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_rmdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_chmod(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_alloc(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_rawlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_mlsd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_systype(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nb_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_pasv(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nb_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nb_continue(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nb_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_append(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_nb_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_size(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_mdtm(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_rename(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_delete(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_site(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_close(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_set_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given -ftp_get_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_login(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_pwd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_cdup(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_chdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_exec(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_raw(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_mkdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_rmdir(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_chmod(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_alloc(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_rawlist(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_mlsd(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_systype(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nb_fget(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_pasv(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nb_get(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nb_continue(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nb_fput(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_append(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_nb_put(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_size(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_mdtm(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_rename(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_delete(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_site(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_close(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_set_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given +TypeError: ftp_get_option(): Argument #1 ($ftp) must be of type FTP\Connection, resource given diff --git a/ext/ftp/tests/dead-resource.phpt b/ext/ftp/tests/dead-resource.phpt index 75cf3c4a55f7..90e59d19641d 100644 --- a/ext/ftp/tests/dead-resource.phpt +++ b/ext/ftp/tests/dead-resource.phpt @@ -16,10 +16,10 @@ try { var_dump(ftp_login($ftp, 'user', 'pass')); echo "Login did not throw\n"; } catch (ValueError $ex) { - echo "Exception: ", $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- bool(true) bool(true) -Exception: FTP\Connection is already closed +ValueError: FTP\Connection is already closed diff --git a/ext/ftp/tests/ftp_close_during_transfer.phpt b/ext/ftp/tests/ftp_close_during_transfer.phpt index 72e410603921..201a6f172681 100644 --- a/ext/ftp/tests/ftp_close_during_transfer.phpt +++ b/ext/ftp/tests/ftp_close_during_transfer.phpt @@ -32,7 +32,7 @@ CloseDuringWrite::$ftp = $ftp; try { @ftp_get($ftp, 'reentrant://sink', 'a story.txt', FTP_BINARY); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ftp_close($ftp); @@ -40,5 +40,5 @@ echo "closed\n"; ?> --EXPECT-- bool(true) -Cannot close FTP\Connection while a transfer is in progress +Error: Cannot close FTP\Connection while a transfer is in progress closed diff --git a/ext/ftp/tests/ftp_constructor.phpt b/ext/ftp/tests/ftp_constructor.phpt index 6fae7f9d3fa0..70ac410ffe6c 100644 --- a/ext/ftp/tests/ftp_constructor.phpt +++ b/ext/ftp/tests/ftp_constructor.phpt @@ -9,8 +9,8 @@ pcntl try { new FTP\Connection(); } catch (Error $ex) { - echo "Exception: ", $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Cannot directly construct FTP\Connection, use ftp_connect() or ftp_ssl_connect() instead +Error: Cannot directly construct FTP\Connection, use ftp_connect() or ftp_ssl_connect() instead diff --git a/ext/ftp/tests/ftp_get_option.phpt b/ext/ftp/tests/ftp_get_option.phpt index 496fceadffe7..56738f2c6c72 100644 --- a/ext/ftp/tests/ftp_get_option.phpt +++ b/ext/ftp/tests/ftp_get_option.phpt @@ -21,7 +21,7 @@ var_dump(ftp_get_option($ftp, FTP_USEPASVADDRESS)); try { ftp_get_option($ftp, FOO_BAR); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -29,4 +29,4 @@ try { int(%d) bool(true) bool(true) -ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ValueError: ftp_get_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/ftp/tests/ftp_nb_close_during_transfer.phpt b/ext/ftp/tests/ftp_nb_close_during_transfer.phpt index 702648f69592..aacc4dfd77be 100644 --- a/ext/ftp/tests/ftp_nb_close_during_transfer.phpt +++ b/ext/ftp/tests/ftp_nb_close_during_transfer.phpt @@ -32,7 +32,7 @@ CloseDuringNbWrite::$ftp = $ftp; try { @ftp_nb_get($ftp, 'reentrantnb://sink', 'a story.txt', FTP_BINARY); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ftp_close($ftp); @@ -40,5 +40,5 @@ echo "closed\n"; ?> --EXPECT-- bool(true) -Cannot close FTP\Connection while a transfer is in progress +Error: Cannot close FTP\Connection while a transfer is in progress closed diff --git a/ext/ftp/tests/ftp_set_option_errors.phpt b/ext/ftp/tests/ftp_set_option_errors.phpt index 35785e7f1eba..5b30dfdef2d4 100644 --- a/ext/ftp/tests/ftp_set_option_errors.phpt +++ b/ext/ftp/tests/ftp_set_option_errors.phpt @@ -24,13 +24,13 @@ $options = [ foreach ($options as $option) try { var_dump(ftp_set_option($ftp, $option['option'], $option['value'])); } catch (\Throwable $ex) { - echo "Exception: ", $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception: ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOUT_SEC option -Exception: ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given -Exception: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given -Exception: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given -Exception: ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS +ValueError: ftp_set_option(): Argument #3 ($value) must be greater than 0 for the FTP_TIMEOUT_SEC option +TypeError: ftp_set_option(): Argument #3 ($value) must be of type int for the FTP_TIMEOUT_SEC option, string given +TypeError: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_USEPASVADDRESS option, array given +TypeError: ftp_set_option(): Argument #3 ($value) must be of type bool for the FTP_AUTOSEEK option, string given +ValueError: ftp_set_option(): Argument #2 ($option) must be one of FTP_TIMEOUT_SEC, FTP_AUTOSEEK, or FTP_USEPASVADDRESS diff --git a/ext/ftp/tests/ftp_ssl_connect_error.phpt b/ext/ftp/tests/ftp_ssl_connect_error.phpt index 65c7efbb23c4..a12a3d4add9b 100644 --- a/ext/ftp/tests/ftp_ssl_connect_error.phpt +++ b/ext/ftp/tests/ftp_ssl_connect_error.phpt @@ -18,7 +18,7 @@ echo "\n-- Testing ftp_ssl_connect() function timeout exception for value 0 --\n try { ftp_ssl_connect('totes.invalid', 21, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "===DONE===\n"; @@ -32,5 +32,5 @@ Warning: ftp_ssl_connect(): php_network_getaddresses: getaddrinfo for %s failed: bool(false) -- Testing ftp_ssl_connect() function timeout exception for value 0 -- -ftp_ssl_connect(): Argument #3 ($timeout) must be greater than 0 +ValueError: ftp_ssl_connect(): Argument #3 ($timeout) must be greater than 0 ===DONE=== diff --git a/ext/ftp/tests/gh20601.phpt b/ext/ftp/tests/gh20601.phpt index 3ece7736c3aa..f6013db497f2 100644 --- a/ext/ftp/tests/gh20601.phpt +++ b/ext/ftp/tests/gh20601.phpt @@ -12,8 +12,8 @@ if (PHP_OS_FAMILY === 'Windows') die("skip not for windows"); try { ftp_connect('127.0.0.1', 1024, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ftp_connect(): Argument #3 ($timeout) must be less than %d +ValueError: ftp_connect(): Argument #3 ($timeout) must be less than %d diff --git a/ext/ftp/tests/gh20601_set_option.phpt b/ext/ftp/tests/gh20601_set_option.phpt index 3317d4b5f2a0..c722f4d16448 100644 --- a/ext/ftp/tests/gh20601_set_option.phpt +++ b/ext/ftp/tests/gh20601_set_option.phpt @@ -19,8 +19,8 @@ ftp_login($ftp, 'user', 'pass'); try { ftp_set_option($ftp, FTP_TIMEOUT_SEC, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ftp_set_option(): Argument #3 ($value) must be less than %d for the FTP_TIMEOUT_SEC option +ValueError: ftp_set_option(): Argument #3 ($value) must be less than %d for the FTP_TIMEOUT_SEC option diff --git a/ext/ftp/tests/gh20601_ssl.phpt b/ext/ftp/tests/gh20601_ssl.phpt index 005f866e18e0..12c1c54ae59c 100644 --- a/ext/ftp/tests/gh20601_ssl.phpt +++ b/ext/ftp/tests/gh20601_ssl.phpt @@ -14,8 +14,8 @@ if (PHP_OS_FAMILY === 'Windows') die("skip not for windows"); try { ftp_ssl_connect('127.0.0.1', 1024, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ftp_ssl_connect(): Argument #3 ($timeout) must be less than %d +ValueError: ftp_ssl_connect(): Argument #3 ($timeout) must be less than %d diff --git a/ext/gd/tests/avif_decode_encode.phpt b/ext/gd/tests/avif_decode_encode.phpt index 054eb5246763..d412309bc18e 100644 --- a/ext/gd/tests/avif_decode_encode.phpt +++ b/ext/gd/tests/avif_decode_encode.phpt @@ -39,7 +39,7 @@ gd try { imageavif($img, $outfile, 1234); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Encoding AVIF with illegal speed: '; @@ -47,7 +47,7 @@ gd try { imageavif($img, $outfile, 70, 1234); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Encoding AVIF losslessly... '; @@ -75,8 +75,8 @@ Default AVIF encoding: ok Encoding AVIF at quality 70: ok Encoding AVIF at quality 70 with speed 5: ok Encoding AVIF with default quality: ok -Encoding AVIF with illegal quality: imageavif(): Argument #3 ($quality) must be between -1 and 100 -Encoding AVIF with illegal speed: imageavif(): Argument #4 ($speed) must be between -1 and 10 +Encoding AVIF with illegal quality: ValueError: imageavif(): Argument #3 ($quality) must be between -1 and 100 +Encoding AVIF with illegal speed: ValueError: imageavif(): Argument #4 ($speed) must be between -1 and 10 Encoding AVIF losslessly... ok Decoding the AVIF we just wrote... What is the mean squared error of the two images? 0 diff --git a/ext/gd/tests/bug66356.phpt b/ext/gd/tests/bug66356.phpt index 616a270115c1..b82eb03958d5 100644 --- a/ext/gd/tests/bug66356.phpt +++ b/ext/gd/tests/bug66356.phpt @@ -13,7 +13,7 @@ $arr = array("x" => 2147483647, "y" => 2147483647, "width" => 10, "height" => 10 try { imagecrop($img, $arr); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } print_r($arr); @@ -32,7 +32,7 @@ var_dump(imagecrop($img, array("x" => 0, "y" => 0, "width" => 65535, "height" => --EXPECTF-- object(GdImage)#2 (0) { } -imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys +ValueError: imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys Array ( [x] => 2147483647 diff --git a/ext/gd/tests/bug72337.phpt b/ext/gd/tests/bug72337.phpt index a15fa349304e..4973b39eb286 100644 --- a/ext/gd/tests/bug72337.phpt +++ b/ext/gd/tests/bug72337.phpt @@ -8,23 +8,23 @@ $im = imagecreatetruecolor(1, 1); try { imagescale($im, 1, 1, -10); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagescale($im, 0, 1, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagescale($im, 1, 0, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } imagescale($im, 1, 1, IMG_BICUBIC_FIXED); echo "OK"; ?> --EXPECT-- -imagescale(): Argument #4 ($mode) must be one of the GD_* constants -imagescale(): Argument #2 ($width) must be between 1 and 2147483647 -imagescale(): Argument #3 ($height) must be between 1 and 2147483647 +ValueError: imagescale(): Argument #4 ($mode) must be one of the GD_* constants +ValueError: imagescale(): Argument #2 ($width) must be between 1 and 2147483647 +ValueError: imagescale(): Argument #3 ($height) must be between 1 and 2147483647 OK diff --git a/ext/gd/tests/bug72709.phpt b/ext/gd/tests/bug72709.phpt index bc20d1bf58b8..7d9e34ecdabf 100644 --- a/ext/gd/tests/bug72709.phpt +++ b/ext/gd/tests/bug72709.phpt @@ -10,12 +10,12 @@ try { var_dump(imagesetstyle($im, array())); } catch (\Error $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } imagesetpixel($im, 0, 0, IMG_COLOR_STYLED); ?> ====DONE==== --EXPECT-- -imagesetstyle(): Argument #2 ($style) must not be empty +ValueError: imagesetstyle(): Argument #2 ($style) must not be empty ====DONE==== diff --git a/ext/gd/tests/bug73957.phpt b/ext/gd/tests/bug73957.phpt index 067d71674eb2..986adafa0767 100644 --- a/ext/gd/tests/bug73957.phpt +++ b/ext/gd/tests/bug73957.phpt @@ -15,8 +15,8 @@ try { // which is not supposed to happen var_dump(imagesx($im)); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -imagescale(): Argument #2 ($width) must be between 1 and %d +ValueError: imagescale(): Argument #2 ($width) must be between 1 and %d diff --git a/ext/gd/tests/bug81739.phpt b/ext/gd/tests/bug81739.phpt index b340aa7c0758..c7f6a4054bf4 100644 --- a/ext/gd/tests/bug81739.phpt +++ b/ext/gd/tests/bug81739.phpt @@ -19,4 +19,4 @@ Warning: imageloadfont(): %croduct of memory allocation multiplication would exc in %s on line %d Warning: imageloadfont(): Error reading font, invalid font header in %s on line %d -bool(false) \ No newline at end of file +bool(false) diff --git a/ext/gd/tests/colorclosest.phpt b/ext/gd/tests/colorclosest.phpt index 8cfcbdcdea4e..2a1898304613 100644 --- a/ext/gd/tests/colorclosest.phpt +++ b/ext/gd/tests/colorclosest.phpt @@ -15,7 +15,7 @@ $c = imagecolorclosest($im, 255,0,255); try { imagecolorsforindex($im, $c); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $im = null; @@ -53,7 +53,7 @@ $c = imagecolorclosestalpha($im, 255,0,255,100); try { imagecolorsforindex($im, $c); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $im = null; @@ -82,7 +82,7 @@ print_r(imagecolorsforindex($im, $c)); ?> --EXPECT-- FF00FF -imagecolorsforindex(): Argument #2 ($color) is out of range +ValueError: imagecolorsforindex(): Argument #2 ($color) is out of range Array ( [red] => 255 @@ -105,7 +105,7 @@ Array [alpha] => 0 ) 64FF00FF -imagecolorsforindex(): Argument #2 ($color) is out of range +ValueError: imagecolorsforindex(): Argument #2 ($color) is out of range Array ( [red] => 255 diff --git a/ext/gd/tests/colormatch.phpt b/ext/gd/tests/colormatch.phpt index fe22784c9942..a2def011c481 100644 --- a/ext/gd/tests/colormatch.phpt +++ b/ext/gd/tests/colormatch.phpt @@ -11,11 +11,11 @@ $im2 = imagecreate(5,5); try { imagecolormatch($im, $im2); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "ok\n"; ?> --EXPECT-- -imagecolormatch(): Argument #2 ($image2) must have at least one color +ValueError: imagecolormatch(): Argument #2 ($image2) must have at least one color ok diff --git a/ext/gd/tests/createfromstring.phpt b/ext/gd/tests/createfromstring.phpt index ce90b368f2e7..569fc0dd41be 100644 --- a/ext/gd/tests/createfromstring.phpt +++ b/ext/gd/tests/createfromstring.phpt @@ -55,7 +55,7 @@ unlink($dir . '/p.png'); try { imagecreatefromstring(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } //random string > 12 $im = imagecreatefromstring(' asdf jklp foo'); diff --git a/ext/gd/tests/gdimage_prevent_cloning.phpt b/ext/gd/tests/gdimage_prevent_cloning.phpt index 609e6f99bbfa..22a4120be0bc 100644 --- a/ext/gd/tests/gdimage_prevent_cloning.phpt +++ b/ext/gd/tests/gdimage_prevent_cloning.phpt @@ -9,7 +9,7 @@ try { $img_src = imagecreatetruecolor(32, 32); $img_dst = clone $img_src; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/gd/tests/gh16255.phpt b/ext/gd/tests/gh16255.phpt index 147dc5adf377..c255f1027e37 100644 --- a/ext/gd/tests/gh16255.phpt +++ b/ext/gd/tests/gh16255.phpt @@ -12,23 +12,23 @@ $im = imagecreatetruecolor(40, 40); try { imageconvolution($im, $matrix, NAN, 1.0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { imageconvolution($im, $matrix, 2.225E-307, 1.0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { imageconvolution($im, $matrix, 1, NAN); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imageconvolution(): Argument #3 ($divisor) must be finite -imageconvolution(): Argument #3 ($divisor) must not be 0 -imageconvolution(): Argument #4 ($offset) must be finite +ValueError: imageconvolution(): Argument #3 ($divisor) must be finite +ValueError: imageconvolution(): Argument #3 ($divisor) must not be 0 +ValueError: imageconvolution(): Argument #4 ($offset) must be finite diff --git a/ext/gd/tests/gh16260.phpt b/ext/gd/tests/gh16260.phpt index 563fc8d16278..57daf82b387d 100644 --- a/ext/gd/tests/gh16260.phpt +++ b/ext/gd/tests/gh16260.phpt @@ -9,14 +9,14 @@ $im = imagecreatetruecolor(10,10); try { imagerotate($im, PHP_INT_MIN, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagerotate($im, PHP_INT_MAX, 0); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --EXPECTF-- -imagerotate(): Argument #2 ($angle) must be between %s and %s -imagerotate(): Argument #2 ($angle) must be between %s and %s +ValueError: imagerotate(): Argument #2 ($angle) must be between %s and %s +ValueError: imagerotate(): Argument #2 ($angle) must be between %s and %s diff --git a/ext/gd/tests/gh16322.phpt b/ext/gd/tests/gh16322.phpt index 1e5ab2f3a6b1..abe6846b1726 100644 --- a/ext/gd/tests/gh16322.phpt +++ b/ext/gd/tests/gh16322.phpt @@ -10,16 +10,16 @@ $src = imagecreatetruecolor(8, 8); try { imageaffine($src, $matrix); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $matrix[0] = 1; $matrix[3] = -INF; try { imageaffine($src, $matrix); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -imageaffine(): Argument #2 ($affine) element 0 must be between %s and %d -imageaffine(): Argument #2 ($affine) element 3 must be between %s and %d +ValueError: imageaffine(): Argument #2 ($affine) element 0 must be between %s and %d +ValueError: imageaffine(): Argument #2 ($affine) element 3 must be between %s and %d diff --git a/ext/gd/tests/gh17703.phpt b/ext/gd/tests/gh17703.phpt index 4677b6a50139..9d9145f30e0c 100644 --- a/ext/gd/tests/gh17703.phpt +++ b/ext/gd/tests/gh17703.phpt @@ -10,8 +10,8 @@ $img = imagecreatetruecolor ( 256, 1); try { imagescale($img, -1, -1, 0); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Argument #2 ($width) and argument #3 ($height) cannot be both negative +ValueError: Argument #2 ($width) and argument #3 ($height) cannot be both negative diff --git a/ext/gd/tests/gh18005.phpt b/ext/gd/tests/gh18005.phpt index 5282c0be0268..e36d2efa2cd6 100644 --- a/ext/gd/tests/gh18005.phpt +++ b/ext/gd/tests/gh18005.phpt @@ -13,80 +13,80 @@ $img = imagecreatetruecolor(1, 1); try { imagesetstyle($img, [0, new A()]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagesetstyle($img, [0, PHP_INT_MIN]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [new A()]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagefilter($img, IMG_FILTER_SCATTER, 0, 0, [-1]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => PHP_INT_MIN, "y" => 0, "width" => 0, "height" => 0]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => PHP_INT_MIN, "width" => 0, "height" => 0]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => 0, "width" => PHP_INT_MAX, "height" => 0]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => PHP_INT_MAX]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => new A(), "y" => 0, "width" => 0, "height" => 0]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => new A(), "width" => 0, "height" => 0]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => 0, "width" => new A(), "height" => 0]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagecrop($img, ["x" => 0, "y" => 0, "width" => 0, "height" => new A()]); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $one = 1; var_dump(imagecrop($img, ["x" => &$one, "y" => &$one, "width" => &$one, "height" => &$one])); ?> --EXPECTF-- -imagesetstyle(): Argument #2 ($style) must only have elements of type int, A given -imagesetstyle(): Argument #2 ($style) elements must be between %i and %d -imagefilter(): Argument #5 must be of type int, A given -imagefilter(): Argument #5 value must be between 0 and 2147483647 -imagecrop(): Argument #2 ($rectangle) "x" key must be between %i and %d -imagecrop(): Argument #2 ($rectangle) "y" key must be between %i and %d -imagecrop(): Argument #2 ($rectangle) "width" key must be between %i and %d -imagecrop(): Argument #2 ($rectangle) "height" key must be between %i and %d -imagecrop(): Argument #2 ($rectangle) "x" key must be of type int, A given -imagecrop(): Argument #2 ($rectangle) "y" key must be of type int, A given -imagecrop(): Argument #2 ($rectangle) "width" key must be of type int, A given -imagecrop(): Argument #2 ($rectangle) "height" key must be of type int, A given +TypeError: imagesetstyle(): Argument #2 ($style) must only have elements of type int, A given +ValueError: imagesetstyle(): Argument #2 ($style) elements must be between %i and %d +TypeError: imagefilter(): Argument #5 must be of type int, A given +ValueError: imagefilter(): Argument #5 value must be between 0 and 2147483647 +ValueError: imagecrop(): Argument #2 ($rectangle) "x" key must be between %i and %d +ValueError: imagecrop(): Argument #2 ($rectangle) "y" key must be between %i and %d +ValueError: imagecrop(): Argument #2 ($rectangle) "width" key must be between %i and %d +ValueError: imagecrop(): Argument #2 ($rectangle) "height" key must be between %i and %d +TypeError: imagecrop(): Argument #2 ($rectangle) "x" key must be of type int, A given +TypeError: imagecrop(): Argument #2 ($rectangle) "y" key must be of type int, A given +TypeError: imagecrop(): Argument #2 ($rectangle) "width" key must be of type int, A given +TypeError: imagecrop(): Argument #2 ($rectangle) "height" key must be of type int, A given object(GdImage)#2 (0) { } diff --git a/ext/gd/tests/gh18243.phpt b/ext/gd/tests/gh18243.phpt index 3235098a3dcc..00698add614c 100644 --- a/ext/gd/tests/gh18243.phpt +++ b/ext/gd/tests/gh18243.phpt @@ -14,29 +14,29 @@ $im = imagecreatetruecolor(100, 80); try { imagettftext($im, PHP_INT_MAX, 0, 15, 60, 0, $font, ""); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagettftext($im, PHP_INT_MIN, 0, 15, 60, 0, $font, ""); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagettftext($im, NAN, 0, 15, 60, 0, $font, ""); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagettftext($im, INF, 0, 15, 60, 0, $font, ""); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -imagettftext(): Argument #2 ($size) must be between %i and %d -imagettftext(): Argument #2 ($size) must be between %i and %d -imagettftext(): Argument #2 ($size) must be finite -imagettftext(): Argument #2 ($size) must be between %i and %d +ValueError: imagettftext(): Argument #2 ($size) must be between %i and %d +ValueError: imagettftext(): Argument #2 ($size) must be between %i and %d +ValueError: imagettftext(): Argument #2 ($size) must be finite +ValueError: imagettftext(): Argument #2 ($size) must be between %i and %d diff --git a/ext/gd/tests/gh19578.phpt b/ext/gd/tests/gh19578.phpt index 15d10f752d0d..cc13c6467921 100644 --- a/ext/gd/tests/gh19578.phpt +++ b/ext/gd/tests/gh19578.phpt @@ -13,15 +13,15 @@ $src = imagecreatetruecolor(255, 255); try { imagefilledellipse($src, 0, 0, PHP_INT_MAX, 254, 0); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagefilledellipse($src, 0, 0, -16, 254, 0); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -imagefilledellipse(): Argument #4 ($width) must be between 0 and %d -imagefilledellipse(): Argument #4 ($width) must be between 0 and %d +ValueError: imagefilledellipse(): Argument #4 ($width) must be between 0 and %d +ValueError: imagefilledellipse(): Argument #4 ($width) must be between 0 and %d diff --git a/ext/gd/tests/gh20551.phpt b/ext/gd/tests/gh20551.phpt index 32ca50ca5f62..04a62a256df2 100644 --- a/ext/gd/tests/gh20551.phpt +++ b/ext/gd/tests/gh20551.phpt @@ -21,16 +21,16 @@ foreach ($gammas as $gamma) { try { imagegammacorrect($im, $gamma[0], $gamma[1]); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -imagegammacorrect(): Argument #2 ($input_gamma) must be finite -imagegammacorrect(): Argument #2 ($input_gamma) must be finite -imagegammacorrect(): Argument #2 ($input_gamma) must be finite -imagegammacorrect(): Argument #2 ($input_gamma) must be greater than 0 -imagegammacorrect(): Argument #3 ($output_gamma) must be finite -imagegammacorrect(): Argument #3 ($output_gamma) must be finite -imagegammacorrect(): Argument #3 ($output_gamma) must be finite -imagegammacorrect(): Argument #3 ($output_gamma) must be greater than 0 +ValueError: imagegammacorrect(): Argument #2 ($input_gamma) must be finite +ValueError: imagegammacorrect(): Argument #2 ($input_gamma) must be finite +ValueError: imagegammacorrect(): Argument #2 ($input_gamma) must be finite +ValueError: imagegammacorrect(): Argument #2 ($input_gamma) must be greater than 0 +ValueError: imagegammacorrect(): Argument #3 ($output_gamma) must be finite +ValueError: imagegammacorrect(): Argument #3 ($output_gamma) must be finite +ValueError: imagegammacorrect(): Argument #3 ($output_gamma) must be finite +ValueError: imagegammacorrect(): Argument #3 ($output_gamma) must be greater than 0 diff --git a/ext/gd/tests/gh20602.phpt b/ext/gd/tests/gh20602.phpt index 29c781e76a2d..b481b32ae9b6 100644 --- a/ext/gd/tests/gh20602.phpt +++ b/ext/gd/tests/gh20602.phpt @@ -9,14 +9,14 @@ $im = imagecreatetruecolor(16, 16); try { imagescale($im, PHP_INT_MAX, -1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagescale($im, -1, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -imagescale(): Argument #2 ($width) must be less than or equal to %d -imagescale(): Argument #3 ($height) must be less than or equal to %d +ValueError: imagescale(): Argument #2 ($width) must be less than or equal to %d +ValueError: imagescale(): Argument #3 ($height) must be less than or equal to %d diff --git a/ext/gd/tests/gh8848.phpt b/ext/gd/tests/gh8848.phpt index 0e18b64babb3..324307f55966 100644 --- a/ext/gd/tests/gh8848.phpt +++ b/ext/gd/tests/gh8848.phpt @@ -18,12 +18,12 @@ foreach ($argslist as $args) { try { imagecopyresized($image1, $image2, 1, 1, 1, 1, ...$args); } catch (ValueError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } } ?> --EXPECT-- -imagecopyresized(): Argument #7 ($dst_width) must be greater than 0 -imagecopyresized(): Argument #8 ($dst_height) must be greater than 0 -imagecopyresized(): Argument #9 ($src_width) must be greater than 0 -imagecopyresized(): Argument #10 ($src_height) must be greater than 0 +ValueError: imagecopyresized(): Argument #7 ($dst_width) must be greater than 0 +ValueError: imagecopyresized(): Argument #8 ($dst_height) must be greater than 0 +ValueError: imagecopyresized(): Argument #9 ($src_width) must be greater than 0 +ValueError: imagecopyresized(): Argument #10 ($src_height) must be greater than 0 diff --git a/ext/gd/tests/imagebmp_nullbyte_injection.phpt b/ext/gd/tests/imagebmp_nullbyte_injection.phpt index 81a3e40d7c27..2fe4aa9b34eb 100644 --- a/ext/gd/tests/imagebmp_nullbyte_injection.phpt +++ b/ext/gd/tests/imagebmp_nullbyte_injection.phpt @@ -12,8 +12,8 @@ $image = imagecreate(1,1);// 1px image try { imagebmp($image, "./foo\0bar"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagebmp(): Argument #2 ($file) must not contain null bytes +TypeError: imagebmp(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imagecolormatch_error2.phpt b/ext/gd/tests/imagecolormatch_error2.phpt index 5af039a785dd..c2cdc0b91580 100644 --- a/ext/gd/tests/imagecolormatch_error2.phpt +++ b/ext/gd/tests/imagecolormatch_error2.phpt @@ -15,9 +15,9 @@ $background_color = imagecolorallocate($imb, 0, 0, 100); try { imagecolormatch($ima, $imb); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -imagecolormatch(): Argument #1 ($image1) must be TrueColor +ValueError: imagecolormatch(): Argument #1 ($image1) must be TrueColor diff --git a/ext/gd/tests/imagecolormatch_error3.phpt b/ext/gd/tests/imagecolormatch_error3.phpt index 9b0d4c8830c7..02101585b979 100644 --- a/ext/gd/tests/imagecolormatch_error3.phpt +++ b/ext/gd/tests/imagecolormatch_error3.phpt @@ -15,9 +15,9 @@ $background_color = imagecolorallocate($imb, 0, 0, 100); try { imagecolormatch($ima, $imb); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -imagecolormatch(): Argument #2 ($image2) must be Palette +ValueError: imagecolormatch(): Argument #2 ($image2) must be Palette diff --git a/ext/gd/tests/imagecolormatch_error4.phpt b/ext/gd/tests/imagecolormatch_error4.phpt index e4aa04ca3d37..2c117dcd46ab 100644 --- a/ext/gd/tests/imagecolormatch_error4.phpt +++ b/ext/gd/tests/imagecolormatch_error4.phpt @@ -15,9 +15,9 @@ $background_color = imagecolorallocate($imb, 0, 0, 100); try { imagecolormatch($ima, $imb); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -imagecolormatch(): Argument #2 ($image2) must be the same size as argument #1 ($im1) +ValueError: imagecolormatch(): Argument #2 ($image2) must be the same size as argument #1 ($im1) diff --git a/ext/gd/tests/imagecrop_overflow.phpt b/ext/gd/tests/imagecrop_overflow.phpt index 3331a6267168..4edfb985ae95 100644 --- a/ext/gd/tests/imagecrop_overflow.phpt +++ b/ext/gd/tests/imagecrop_overflow.phpt @@ -11,7 +11,7 @@ $arr = ["x" => 2147483647, "y" => 2147483647, "width" => 10, "height" => 10]; try { imagecrop($img, $arr); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $arr = ["x" => -2147483648, "y" => 0, "width" => -10, "height" => 10]; @@ -19,7 +19,7 @@ $arr = ["x" => -2147483648, "y" => 0, "width" => -10, "height" => 10]; try { imagecrop($img, $arr); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $arr = ["x" => 1, "y" => 2147483647, "width" => 10, "height" => 10]; @@ -27,7 +27,7 @@ $arr = ["x" => 1, "y" => 2147483647, "width" => 10, "height" => 10]; try { imagecrop($img, $arr); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $arr = ["x" => 1, "y" => -2147483648, "width" => 10, "height" => -10]; @@ -35,11 +35,11 @@ $arr = ["x" => 1, "y" => -2147483648, "width" => 10, "height" => -10]; try { imagecrop($img, $arr); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys -imagecrop(): Argument #2 ($rectangle) underflow with "x" and "width" keys -imagecrop(): Argument #2 ($rectangle) overflow with "y" and "height" keys -imagecrop(): Argument #2 ($rectangle) underflow with "y" and "height" keys +ValueError: imagecrop(): Argument #2 ($rectangle) overflow with "x" and "width" keys +ValueError: imagecrop(): Argument #2 ($rectangle) underflow with "x" and "width" keys +ValueError: imagecrop(): Argument #2 ($rectangle) overflow with "y" and "height" keys +ValueError: imagecrop(): Argument #2 ($rectangle) underflow with "y" and "height" keys diff --git a/ext/gd/tests/imagefilter2.phpt b/ext/gd/tests/imagefilter2.phpt index 99b73ffc133d..5f0ec6615ae6 100644 --- a/ext/gd/tests/imagefilter2.phpt +++ b/ext/gd/tests/imagefilter2.phpt @@ -20,17 +20,17 @@ foreach ([-1, PHP_INT_MAX] as $val) { try { imagefilter($im, IMG_FILTER_SCATTER, $val, 0); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagefilter($im, IMG_FILTER_SCATTER, 0, $val); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECTF-- -imagefilter(): Argument #3 must be between 0 and %d -imagefilter(): Argument #4 must be between 0 and %d -imagefilter(): Argument #3 must be between 0 and %d -imagefilter(): Argument #4 must be between 0 and %d +ValueError: imagefilter(): Argument #3 must be between 0 and %d +ValueError: imagefilter(): Argument #4 must be between 0 and %d +ValueError: imagefilter(): Argument #3 must be between 0 and %d +ValueError: imagefilter(): Argument #4 must be between 0 and %d diff --git a/ext/gd/tests/imagefilter_error1.phpt b/ext/gd/tests/imagefilter_error1.phpt index cc9904e320da..f2e6e1c3e696 100644 --- a/ext/gd/tests/imagefilter_error1.phpt +++ b/ext/gd/tests/imagefilter_error1.phpt @@ -12,14 +12,14 @@ $image = imagecreatetruecolor(180, 30); try { var_dump(imagefilter($image)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(imagefilter(20, 1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagefilter() expects at least 2 arguments, 1 given -imagefilter(): Argument #1 ($image) must be of type GdImage, int given +ArgumentCountError: imagefilter() expects at least 2 arguments, 1 given +TypeError: imagefilter(): Argument #1 ($image) must be of type GdImage, int given diff --git a/ext/gd/tests/imagegd2_nullbyte_injection.phpt b/ext/gd/tests/imagegd2_nullbyte_injection.phpt index 5765543be1df..95995b78b1f2 100644 --- a/ext/gd/tests/imagegd2_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd2_nullbyte_injection.phpt @@ -8,8 +8,8 @@ $image = imagecreate(1,1);// 1px image try { imagegd($image, "./foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagegd(): Argument #2 ($file) must not contain any null bytes +ValueError: imagegd(): Argument #2 ($file) must not contain any null bytes diff --git a/ext/gd/tests/imagegd_nullbyte_injection.phpt b/ext/gd/tests/imagegd_nullbyte_injection.phpt index 657e11dd1788..fe4490acdde8 100644 --- a/ext/gd/tests/imagegd_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegd_nullbyte_injection.phpt @@ -8,8 +8,8 @@ $image = imagecreate(1,1);// 1px image try { imagegd($image, "./foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagegd(): Argument #2 ($file) must not contain any null bytes +ValueError: imagegd(): Argument #2 ($file) must not contain any null bytes diff --git a/ext/gd/tests/imagegif_nullbyte_injection.phpt b/ext/gd/tests/imagegif_nullbyte_injection.phpt index 5cdb6f6879f8..a0b98badb2d4 100644 --- a/ext/gd/tests/imagegif_nullbyte_injection.phpt +++ b/ext/gd/tests/imagegif_nullbyte_injection.phpt @@ -8,8 +8,8 @@ $image = imagecreate(1,1);// 1px image try { imagegif($image, "./foo\0bar"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagegif(): Argument #2 ($file) must not contain null bytes +TypeError: imagegif(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imagejpeg_nullbyte_injection.phpt b/ext/gd/tests/imagejpeg_nullbyte_injection.phpt index 6863626a0c93..1b260de67521 100644 --- a/ext/gd/tests/imagejpeg_nullbyte_injection.phpt +++ b/ext/gd/tests/imagejpeg_nullbyte_injection.phpt @@ -15,8 +15,8 @@ $image = imagecreate(1,1);// 1px image try { imagejpeg($image, "./foo\0bar"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagejpeg(): Argument #2 ($file) must not contain null bytes +TypeError: imagejpeg(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imagepng_nullbyte_injection.phpt b/ext/gd/tests/imagepng_nullbyte_injection.phpt index f5ec342b9c6e..ca04a5be9e1a 100644 --- a/ext/gd/tests/imagepng_nullbyte_injection.phpt +++ b/ext/gd/tests/imagepng_nullbyte_injection.phpt @@ -15,8 +15,8 @@ $image = imagecreate(1,1);// 1px image try { imagepng($image, "./foo\0bar"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagepng(): Argument #2 ($file) must not contain null bytes +TypeError: imagepng(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imageresolution_basic.phpt b/ext/gd/tests/imageresolution_basic.phpt index 74dc8c59dcda..d50173eb74d0 100644 --- a/ext/gd/tests/imageresolution_basic.phpt +++ b/ext/gd/tests/imageresolution_basic.phpt @@ -18,17 +18,17 @@ $res = imageresolution($exp); try { imageresolution($exp, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imageresolution($exp, 127, -PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } imageresolution($exp, 0, 0); var_dump(imageresolution($exp) == $res); ?> --EXPECTF-- -imageresolution(): Argument #2 ($resolution_x) must be between 0 and %d -imageresolution(): Argument #3 ($resolution_y) must be between 0 and %d +ValueError: imageresolution(): Argument #2 ($resolution_x) must be between 0 and %d +ValueError: imageresolution(): Argument #3 ($resolution_y) must be between 0 and %d bool(true) diff --git a/ext/gd/tests/imageresolution_jpeg.phpt b/ext/gd/tests/imageresolution_jpeg.phpt index 739b6949a871..a918c7402d2c 100644 --- a/ext/gd/tests/imageresolution_jpeg.phpt +++ b/ext/gd/tests/imageresolution_jpeg.phpt @@ -27,7 +27,7 @@ imageresolution($exp, 71, 299); try { imagejpeg($exp, $filename, 101); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -43,7 +43,7 @@ array(2) { [1]=> int(299) } -imagejpeg(): Argument #3 ($quality) must be at between -1 and 100 +ValueError: imagejpeg(): Argument #3 ($quality) must be at between -1 and 100 --CLEAN-- getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagewbmp(): Argument #2 ($file) must not contain null bytes +TypeError: imagewbmp(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imagewebp_nullbyte_injection.phpt b/ext/gd/tests/imagewebp_nullbyte_injection.phpt index 3fcb687eeeab..27169d6f4639 100644 --- a/ext/gd/tests/imagewebp_nullbyte_injection.phpt +++ b/ext/gd/tests/imagewebp_nullbyte_injection.phpt @@ -15,8 +15,8 @@ $image = imagecreate(1,1);// 1px image try { imagewebp($image, "./foo\0bar"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagewebp(): Argument #2 ($file) must not contain null bytes +TypeError: imagewebp(): Argument #2 ($file) must not contain null bytes diff --git a/ext/gd/tests/imagexbm_nullbyte_injection.phpt b/ext/gd/tests/imagexbm_nullbyte_injection.phpt index 701f910014c2..59892a25af59 100644 --- a/ext/gd/tests/imagexbm_nullbyte_injection.phpt +++ b/ext/gd/tests/imagexbm_nullbyte_injection.phpt @@ -8,8 +8,8 @@ $image = imagecreate(1,1);// 1px image try { imagexbm($image, "./foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -imagexbm(): Argument #2 ($filename) must not contain any null bytes +ValueError: imagexbm(): Argument #2 ($filename) must not contain any null bytes diff --git a/ext/gd/tests/pngcomp.phpt b/ext/gd/tests/pngcomp.phpt index 81beacad8a54..c6b65dd08139 100644 --- a/ext/gd/tests/pngcomp.phpt +++ b/ext/gd/tests/pngcomp.phpt @@ -18,12 +18,12 @@ gd try { imagepng($im, $cwd . '/test_pngcomp.png', -2); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { imagepng($im, $cwd . '/test_pngcomp.png', 10); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "PNG compression test: "; imagepng($im, $cwd . '/test_pngcomp.png', 9); @@ -37,6 +37,6 @@ gd @unlink($cwd . "/test_pngcomp.png"); ?> --EXPECT-- -imagepng(): Argument #3 ($quality) must be between -1 and 9 -imagepng(): Argument #3 ($quality) must be between -1 and 9 +ValueError: imagepng(): Argument #3 ($quality) must be between -1 and 9 +ValueError: imagepng(): Argument #3 ($quality) must be between -1 and 9 PNG compression test: ok diff --git a/ext/gd/tests/webp_basic.phpt b/ext/gd/tests/webp_basic.phpt index ef2fae865256..9f6272c52938 100644 --- a/ext/gd/tests/webp_basic.phpt +++ b/ext/gd/tests/webp_basic.phpt @@ -40,7 +40,7 @@ var_dump(mse($im1, $im_lossless) == 0); try { imagewebp($im1, $filename, -10); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -51,4 +51,4 @@ try { --EXPECT-- Is lossy conversion close enough? bool(true) Does lossless conversion work? bool(true) -imagewebp(): Argument #3 ($quality) must be greater than or equal to -1 +ValueError: imagewebp(): Argument #3 ($quality) must be greater than or equal to -1 diff --git a/ext/gettext/tests/44938.phpt b/ext/gettext/tests/44938.phpt index faaeea6a2a5b..1c80a4618612 100644 --- a/ext/gettext/tests/44938.phpt +++ b/ext/gettext/tests/44938.phpt @@ -12,107 +12,107 @@ $category = "cat"; try { bindtextdomain($overflown, 'path'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dngettext($overflown, $msgid, $msgid, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dngettext($domain, $overflown, $msgid, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dngettext($domain, $msgid, $overflown, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { gettext($overflown); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { ngettext($overflown, $msgid, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { ngettext($msgid, $overflown, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dcgettext($overflown, $msgid, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dcgettext($domain, $overflown, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dcngettext($overflown, $msgid, $msgid, -1, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dcngettext($domain, $overflown, $msgid, -1, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dcngettext($domain, $msgid, $overflown, -1, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dgettext($overflown, $msgid); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { dgettext($domain, $overflown); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { textdomain($overflown); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -bindtextdomain(): Argument #1 ($domain) is too long -dngettext(): Argument #1 ($domain) is too long -dngettext(): Argument #2 ($singular) is too long -dngettext(): Argument #3 ($plural) is too long -gettext(): Argument #1 ($message) is too long -ngettext(): Argument #1 ($singular) is too long -ngettext(): Argument #2 ($plural) is too long -dcgettext(): Argument #1 ($domain) is too long -dcgettext(): Argument #2 ($message) is too long -dcngettext(): Argument #1 ($domain) is too long -dcngettext(): Argument #2 ($singular) is too long -dcngettext(): Argument #3 ($plural) is too long -dgettext(): Argument #1 ($domain) is too long -dgettext(): Argument #2 ($message) is too long -textdomain(): Argument #1 ($domain) is too long +ValueError: bindtextdomain(): Argument #1 ($domain) is too long +ValueError: dngettext(): Argument #1 ($domain) is too long +ValueError: dngettext(): Argument #2 ($singular) is too long +ValueError: dngettext(): Argument #3 ($plural) is too long +ValueError: gettext(): Argument #1 ($message) is too long +ValueError: ngettext(): Argument #1 ($singular) is too long +ValueError: ngettext(): Argument #2 ($plural) is too long +ValueError: dcgettext(): Argument #1 ($domain) is too long +ValueError: dcgettext(): Argument #2 ($message) is too long +ValueError: dcngettext(): Argument #1 ($domain) is too long +ValueError: dcngettext(): Argument #2 ($singular) is too long +ValueError: dcngettext(): Argument #3 ($plural) is too long +ValueError: dgettext(): Argument #1 ($domain) is too long +ValueError: dgettext(): Argument #2 ($message) is too long +ValueError: textdomain(): Argument #1 ($domain) is too long diff --git a/ext/gettext/tests/dcgettext_lcall.phpt b/ext/gettext/tests/dcgettext_lcall.phpt index 004ae89409ec..ddfd5ada1424 100644 --- a/ext/gettext/tests/dcgettext_lcall.phpt +++ b/ext/gettext/tests/dcgettext_lcall.phpt @@ -7,15 +7,15 @@ gettext try { dcgettext('dngettextTest', 'item', LC_ALL); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { dcngettext('dngettextTest', 'item', 'item2', 1, LC_ALL); } catch (ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -dcgettext(): Argument #3 ($category) cannot be LC_ALL -dcngettext(): Argument #5 ($category) cannot be LC_ALL +ValueError: dcgettext(): Argument #3 ($category) cannot be LC_ALL +ValueError: dcngettext(): Argument #5 ($category) cannot be LC_ALL diff --git a/ext/gettext/tests/dcngettext.phpt b/ext/gettext/tests/dcngettext.phpt index 16258d678015..e10f952eeaec 100644 --- a/ext/gettext/tests/dcngettext.phpt +++ b/ext/gettext/tests/dcngettext.phpt @@ -17,13 +17,13 @@ var_dump(dcngettext("test","test","test",-1,-1)); try { dcngettext("","","",1,1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { dcngettext("","","",0,1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -33,6 +33,6 @@ string(1) "1" string(4) "test" string(4) "test" string(4) "test" -dcngettext(): Argument #1 ($domain) must not be empty -dcngettext(): Argument #1 ($domain) must not be empty +ValueError: dcngettext(): Argument #1 ($domain) must not be empty +ValueError: dcngettext(): Argument #1 ($domain) must not be empty Done diff --git a/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt b/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt index 44957ad8d700..6b3606924521 100644 --- a/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt +++ b/ext/gettext/tests/gettext_bind_textdomain_codeset-retval.phpt @@ -7,13 +7,13 @@ gettext try { bind_textdomain_codeset(false,false); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { bind_textdomain_codeset("", "UTF-8"); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // bind_textdomain_codeset() always returns false on musl @@ -28,8 +28,8 @@ gettext echo "Done\n"; ?> --EXPECT-- -bind_textdomain_codeset(): Argument #1 ($domain) must not be empty -bind_textdomain_codeset(): Argument #1 ($domain) must not be empty +ValueError: bind_textdomain_codeset(): Argument #1 ($domain) must not be empty +ValueError: bind_textdomain_codeset(): Argument #1 ($domain) must not be empty bool(true) Done --CREDITS-- diff --git a/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt b/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt index 607460b3c2db..cdb3ac58ee59 100644 --- a/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt +++ b/ext/gettext/tests/gettext_bindtextdomain-emptydomain.phpt @@ -10,12 +10,12 @@ chdir(__DIR__); try { bindtextdomain('', 'foobar'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -bindtextdomain(): Argument #1 ($domain) must not be empty +ValueError: bindtextdomain(): Argument #1 ($domain) must not be empty --CREDITS-- Till Klampaeckel, till@php.net PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gettext_textdomain-retval.phpt b/ext/gettext/tests/gettext_textdomain-retval.phpt index 2f2f52d37743..f9644db3be2b 100644 --- a/ext/gettext/tests/gettext_textdomain-retval.phpt +++ b/ext/gettext/tests/gettext_textdomain-retval.phpt @@ -22,21 +22,21 @@ echo textdomain('foo'), "\n"; try { textdomain('0'); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { textdomain(''); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- test test foo -textdomain(): Argument #1 ($domain) cannot be zero -textdomain(): Argument #1 ($domain) must not be empty +ValueError: textdomain(): Argument #1 ($domain) cannot be zero +ValueError: textdomain(): Argument #1 ($domain) must not be empty --CREDITS-- Christian Weiske, cweiske@php.net PHP Testfest Berlin 2009-05-09 diff --git a/ext/gettext/tests/gh17400.phpt b/ext/gettext/tests/gh17400.phpt index 836b792bf0de..33dc2a0e5d24 100644 --- a/ext/gettext/tests/gh17400.phpt +++ b/ext/gettext/tests/gh17400.phpt @@ -12,8 +12,8 @@ $utf16le_char_bad = pack("H*", "00dc00dc"); try { bindtextdomain($utf16le_char_bad,$utf16_first_le); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -bindtextdomain(): Argument #1 ($domain) must not contain any null bytes +ValueError: bindtextdomain(): Argument #1 ($domain) must not contain any null bytes diff --git a/ext/gmp/tests/003.phpt b/ext/gmp/tests/003.phpt index 8fdd723e8c4e..df9fd229fd87 100644 --- a/ext/gmp/tests/003.phpt +++ b/ext/gmp/tests/003.phpt @@ -26,7 +26,7 @@ gmp try { $test[] = gmp_init("4d2"); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $test[] = gmp_init("4d2", 16); @@ -35,7 +35,7 @@ gmp } ?> --EXPECT-- -gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string 1234 1234 10011010010 diff --git a/ext/gmp/tests/bug32773.phpt b/ext/gmp/tests/bug32773.phpt index 3df59e67faff..0f2b862897c0 100644 --- a/ext/gmp/tests/bug32773.phpt +++ b/ext/gmp/tests/bug32773.phpt @@ -10,17 +10,17 @@ echo '10 + "0" = ', gmp_strval(gmp_add(10, '0')), "\n"; try { var_dump(gmp_div(10, 0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_div_qr(10, 0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- 10 + 0 = 10 10 + "0" = 10 -gmp_div(): Argument #2 ($num2) Division by zero -gmp_div_qr(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div_qr(): Argument #2 ($num2) Division by zero diff --git a/ext/gmp/tests/bug50283.phpt b/ext/gmp/tests/bug50283.phpt index db0e456da0e1..5f1806e508fe 100644 --- a/ext/gmp/tests/bug50283.phpt +++ b/ext/gmp/tests/bug50283.phpt @@ -10,34 +10,34 @@ printf("Decimal: %s, 36-based: %s\n", gmp_strval($a), gmp_strval($a,36)); try { printf("Decimal: %s, -1-based: %s\n", gmp_strval($a), gmp_strval($a,-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { printf("Decimal: %s, 1-based: %s\n", gmp_strval($a), gmp_strval($a,1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { printf("Decimal: %s, -37-based: %s\n", gmp_strval($a), gmp_strval($a,-37)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } printf("Decimal: %s, 37-based: %s\n", gmp_strval($a), gmp_strval($a,37)); printf("Decimal: %s, 62-based: %s\n", gmp_strval($a), gmp_strval($a,62)); try { printf("Decimal: %s, 63-based: %s\n\n", gmp_strval($a), gmp_strval($a,63)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } printf("Base 32 and 62-based: %s\n", gmp_strval(gmp_init("gh82179fbf5", 32), 62)); ?> --EXPECT-- Decimal: 71915494046709, -36-based: PHPISCOOL Decimal: 71915494046709, 36-based: phpiscool -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 Decimal: 71915494046709, 37-based: KHKATELJF Decimal: 71915494046709, 62-based: KQ6yq741 -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 Base 32 and 62-based: 1NHkAcdIiD diff --git a/ext/gmp/tests/bug66872.phpt b/ext/gmp/tests/bug66872.phpt index 3d65a910b784..67870c06752f 100644 --- a/ext/gmp/tests/bug66872.phpt +++ b/ext/gmp/tests/bug66872.phpt @@ -8,9 +8,9 @@ gmp try { var_dump(gmp_testbit("abc", 1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -gmp_testbit(): Argument #1 ($num) is not an integer string +ValueError: gmp_testbit(): Argument #1 ($num) is not an integer string diff --git a/ext/gmp/tests/bug80560.phpt b/ext/gmp/tests/bug80560.phpt index 85f4dff96be4..2788c51e35d0 100644 --- a/ext/gmp/tests/bug80560.phpt +++ b/ext/gmp/tests/bug80560.phpt @@ -72,24 +72,24 @@ echo 'Hexadecimal', \PHP_EOL; try { var_dump(gmp_init('0X', 16)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init('0x', 16)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Binary', \PHP_EOL; try { var_dump(gmp_init('0B', 2)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init('0b', 2)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Fuzzing gmp functions:', \PHP_EOL; @@ -219,10 +219,10 @@ echo "Done\n"; --EXPECT-- Explicit base with gmp_init: Hexadecimal -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string Binary -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string Fuzzing gmp functions: Done diff --git a/ext/gmp/tests/bug81119.phpt b/ext/gmp/tests/bug81119.phpt index e689a7251f60..8747871b11a0 100644 --- a/ext/gmp/tests/bug81119.phpt +++ b/ext/gmp/tests/bug81119.phpt @@ -10,7 +10,7 @@ function test($f) { $f(); echo "No error?\n"; } catch (TypeError|ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) < "x"); @@ -20,7 +20,7 @@ test(fn($WRONG_SCOPE_1 = 0, $WRONG_SCOPE_2 = 0) => gmp_init(1) + []); ?> --EXPECT-- -Number is not an integer string -Number must be of type GMP|string|int, array given -Number is not an integer string -Number must be of type GMP|string|int, array given +ValueError: Number is not an integer string +TypeError: Number must be of type GMP|string|int, array given +ValueError: Number is not an integer string +TypeError: Number must be of type GMP|string|int, array given diff --git a/ext/gmp/tests/comparison_invalid.phpt b/ext/gmp/tests/comparison_invalid.phpt index edf24e889b8e..46ea036eae2d 100644 --- a/ext/gmp/tests/comparison_invalid.phpt +++ b/ext/gmp/tests/comparison_invalid.phpt @@ -8,13 +8,13 @@ gmp try { var_dump("hapfegfbu" > gmp_init(0)); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump((new DateTime()) > gmp_init(0)); } catch (\Error $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/gmp/tests/construct.phpt b/ext/gmp/tests/construct.phpt index 1b23bd791edd..28957bc5eee1 100644 --- a/ext/gmp/tests/construct.phpt +++ b/ext/gmp/tests/construct.phpt @@ -12,17 +12,17 @@ var_dump(new GMP("12", 4)); try { var_dump(new GMP("12", 999)); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new GMP("", 10)); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new GMP("hello")); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -46,6 +46,6 @@ object(GMP)#1 (1) { ["num"]=> string(1) "6" } -GMP::__construct(): Argument #2 ($base) must be 0 or between 2 and 62 -GMP::__construct(): Argument #1 ($num) is not an integer string -GMP::__construct(): Argument #1 ($num) is not an integer string +ValueError: GMP::__construct(): Argument #2 ($base) must be 0 or between 2 and 62 +ValueError: GMP::__construct(): Argument #1 ($num) is not an integer string +ValueError: GMP::__construct(): Argument #1 ($num) is not an integer string diff --git a/ext/gmp/tests/gh16501.phpt b/ext/gmp/tests/gh16501.phpt index 325be85d1917..351370ff1b7d 100644 --- a/ext/gmp/tests/gh16501.phpt +++ b/ext/gmp/tests/gh16501.phpt @@ -7,8 +7,8 @@ gmp try { gmp_random_bits(PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d +ValueError: gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d diff --git a/ext/gmp/tests/gh9308.phpt b/ext/gmp/tests/gh9308.phpt index af13b8bdf328..94295c8226c3 100644 --- a/ext/gmp/tests/gh9308.phpt +++ b/ext/gmp/tests/gh9308.phpt @@ -11,9 +11,9 @@ declare(strict_types=1); try { $gmp = gmp_init(gmp_init(123)); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -gmp_init(): Argument #1 ($num) must be of type string|int, GMP given +TypeError: gmp_init(): Argument #1 ($num) must be of type string|int, GMP given diff --git a/ext/gmp/tests/gmp_abs.phpt b/ext/gmp/tests/gmp_abs.phpt index 23fac5be5dee..0d75efc7ff52 100644 --- a/ext/gmp/tests/gmp_abs.phpt +++ b/ext/gmp/tests/gmp_abs.phpt @@ -8,14 +8,14 @@ gmp try { var_dump(gmp_strval(gmp_abs(""))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_abs("0"))); var_dump(gmp_strval(gmp_abs(0))); try { var_dump(gmp_strval(gmp_abs(-111111111111111111111))); // This is a float } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_abs("111111111111111111111"))); var_dump(gmp_strval(gmp_abs("-111111111111111111111"))); @@ -25,33 +25,33 @@ try { // Base 8 var_dump(gmp_strval(gmp_abs("09876543"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // Base 8 var_dump(gmp_strval(gmp_abs("-099987654"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_abs(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -gmp_abs(): Argument #1 ($num) is not an integer string +ValueError: gmp_abs(): Argument #1 ($num) is not an integer string string(1) "0" string(1) "0" -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given string(21) "111111111111111111111" string(21) "111111111111111111111" string(1) "0" -gmp_abs(): Argument #1 ($num) is not an integer string -gmp_abs(): Argument #1 ($num) is not an integer string -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_abs(): Argument #1 ($num) is not an integer string +ValueError: gmp_abs(): Argument #1 ($num) is not an integer string +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_and.phpt b/ext/gmp/tests/gmp_and.phpt index f2356dc835a3..c5eff64fa26d 100644 --- a/ext/gmp/tests/gmp_and.phpt +++ b/ext/gmp/tests/gmp_and.phpt @@ -14,7 +14,7 @@ var_dump(gmp_strval(gmp_and(4545, -20))); try { var_dump(gmp_strval(gmp_and("test", "no test"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init("987657876543456"); @@ -26,17 +26,17 @@ var_dump(gmp_strval(gmp_and($n, $n1))); try { var_dump(gmp_and(array(), 1)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_and(1, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_and(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -47,10 +47,10 @@ string(5) "40994" string(3) "515" string(4) "3333" string(4) "4544" -gmp_and(): Argument #1 ($num1) is not an integer string +ValueError: gmp_and(): Argument #1 ($num1) is not an integer string string(4) "1536" string(15) "424703623692768" -gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_and(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_and(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_and(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_binomial.phpt b/ext/gmp/tests/gmp_binomial.phpt index 1bf371e68a14..7cca4c7f5785 100644 --- a/ext/gmp/tests/gmp_binomial.phpt +++ b/ext/gmp/tests/gmp_binomial.phpt @@ -23,7 +23,7 @@ var_dump(gmp_binomial(-2, 6)); // == (2 + 6 - 1 over 6) try { var_dump(gmp_binomial(5, -2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -67,4 +67,4 @@ object(GMP)#2 (1) { ["num"]=> string(1) "7" } -gmp_binomial(): Argument #2 ($k) must be between 0 and %d +ValueError: gmp_binomial(): Argument #2 ($k) must be between 0 and %d diff --git a/ext/gmp/tests/gmp_clrbit.phpt b/ext/gmp/tests/gmp_clrbit.phpt index afefa740f10e..9dc63a87f5a5 100644 --- a/ext/gmp/tests/gmp_clrbit.phpt +++ b/ext/gmp/tests/gmp_clrbit.phpt @@ -13,7 +13,7 @@ $n = gmp_init(-1); try { gmp_clrbit($n, -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval($n)); @@ -21,7 +21,7 @@ $n = gmp_init("1000000"); try { gmp_clrbit($n, -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval($n)); @@ -39,18 +39,18 @@ $n = array(); try { gmp_clrbit($n, 3); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- string(1) "0" -gmp_clrbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_clrbit(): Argument #2 ($index) must be between 0 and %d * %d string(2) "-1" -gmp_clrbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_clrbit(): Argument #2 ($index) must be between 0 and %d * %d string(7) "1000000" string(7) "1000000" string(30) "238462734628347239571822592658" -gmp_clrbit(): Argument #1 ($num) must be of type GMP, array given +TypeError: gmp_clrbit(): Argument #1 ($num) must be of type GMP, array given Done diff --git a/ext/gmp/tests/gmp_cmp.phpt b/ext/gmp/tests/gmp_cmp.phpt index 535d23cc4a20..8e5b68e801f8 100644 --- a/ext/gmp/tests/gmp_cmp.phpt +++ b/ext/gmp/tests/gmp_cmp.phpt @@ -30,7 +30,7 @@ var_dump(gmp_cmp($n1,$n) === 0); try { var_dump(gmp_cmp(array(),array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -44,5 +44,5 @@ gmp(1231222, 0): left greater than right gmp(0, 345355): right greater than left bool(true) bool(true) -gmp_cmp(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_cmp(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_com.phpt b/ext/gmp/tests/gmp_com.phpt index 344903a13c3e..5d92494c4bb6 100644 --- a/ext/gmp/tests/gmp_com.phpt +++ b/ext/gmp/tests/gmp_com.phpt @@ -10,7 +10,7 @@ var_dump(gmp_strval(gmp_com("0"))); try { var_dump(gmp_strval(gmp_com("test"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_com("2394876545678"))); var_dump(gmp_strval(gmp_com("-111"))); @@ -25,7 +25,7 @@ var_dump(gmp_strval(gmp_com($n))); try { var_dump(gmp_strval(gmp_com(array()))); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -33,12 +33,12 @@ echo "Done\n"; --EXPECT-- string(2) "-1" string(2) "-1" -gmp_com(): Argument #1 ($num) is not an integer string +ValueError: gmp_com(): Argument #1 ($num) is not an integer string string(14) "-2394876545679" string(3) "110" string(7) "-874654" string(4) "9875" string(9) "-98765468" string(12) "-98765463338" -gmp_com(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_com(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_q.phpt b/ext/gmp/tests/gmp_div_q.phpt index 8d892c3ff0ad..d02db8db9eb3 100644 --- a/ext/gmp/tests/gmp_div_q.phpt +++ b/ext/gmp/tests/gmp_div_q.phpt @@ -10,14 +10,14 @@ var_dump(gmp_div_q(0,1)); try { var_dump(gmp_div_q(1, 0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_div_q(12653,23482734)); try { var_dump(gmp_div_q(12653,23482734, 10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_div_q(1123123,123)); var_dump(gmp_div_q(1123123,123, 1)); @@ -31,12 +31,12 @@ $fp = fopen(__FILE__, 'r'); try { var_dump(gmp_div_q($fp, $fp)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_div_q(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -46,12 +46,12 @@ object(GMP)#1 (1) { ["num"]=> string(1) "0" } -gmp_div_q(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div_q(): Argument #2 ($num2) Division by zero object(GMP)#2 (1) { ["num"]=> string(1) "0" } -gmp_div_q(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +ValueError: gmp_div_q(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF object(GMP)#1 (1) { ["num"]=> string(4) "9131" @@ -76,6 +76,6 @@ object(GMP)#1 (1) { ["num"]=> string(4) "9131" } -gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, resource given -gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, resource given +TypeError: gmp_div_q(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_qr.phpt b/ext/gmp/tests/gmp_div_qr.phpt index f7649b0208c2..00234b5e635f 100644 --- a/ext/gmp/tests/gmp_div_qr.phpt +++ b/ext/gmp/tests/gmp_div_qr.phpt @@ -10,19 +10,19 @@ var_dump(gmp_div_qr(0,1)); try { var_dump(gmp_div_qr(1,0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_div_qr(gmp_init(1), gmp_init(0))); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_div_qr(12653,23482734)); try { var_dump(gmp_div_qr(12653,23482734, 10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_div_qr(1123123,123)); var_dump(gmp_div_qr(1123123,123, 1)); @@ -37,12 +37,12 @@ $fp = fopen(__FILE__, 'r'); try { var_dump(gmp_div_qr($fp, $fp)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_div_qr(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -60,8 +60,8 @@ array(2) { string(1) "0" } } -gmp_div_qr(): Argument #2 ($num2) Division by zero -gmp_div_qr(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div_qr(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div_qr(): Argument #2 ($num2) Division by zero array(2) { [0]=> object(GMP)#2 (1) { @@ -74,7 +74,7 @@ array(2) { string(5) "12653" } } -gmp_div_qr(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +ValueError: gmp_div_qr(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF array(2) { [0]=> object(GMP)#4 (1) { @@ -159,6 +159,6 @@ array(2) { string(2) "10" } } -gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, resource given -gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, resource given +TypeError: gmp_div_qr(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_div_r.phpt b/ext/gmp/tests/gmp_div_r.phpt index 501284ad47f8..124e07e05037 100644 --- a/ext/gmp/tests/gmp_div_r.phpt +++ b/ext/gmp/tests/gmp_div_r.phpt @@ -10,14 +10,14 @@ var_dump($r = gmp_div_r(0,1)); try { var_dump($r = gmp_div_r(1,0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($r = gmp_div_r(12653,23482734)); try { var_dump($r = gmp_div_r(12653,23482734, 10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($r = gmp_div_r(1123123,123)); var_dump($r = gmp_div_r(1123123,123, 1)); @@ -31,12 +31,12 @@ $fp = fopen(__FILE__, 'r'); try { var_dump(gmp_div_r($fp, $fp)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_div_r(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -46,12 +46,12 @@ object(GMP)#1 (1) { ["num"]=> string(1) "0" } -gmp_div_r(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_div_r(): Argument #2 ($num2) Division by zero object(GMP)#3 (1) { ["num"]=> string(5) "12653" } -gmp_div_r(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF +ValueError: gmp_div_r(): Argument #3 ($rounding_mode) must be one of GMP_ROUND_ZERO, GMP_ROUND_PLUSINF, or GMP_ROUND_MINUSINF object(GMP)#2 (1) { ["num"]=> string(2) "10" @@ -76,6 +76,6 @@ object(GMP)#3 (1) { ["num"]=> string(2) "10" } -gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, resource given -gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, resource given +TypeError: gmp_div_r(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_divexact.phpt b/ext/gmp/tests/gmp_divexact.phpt index ecd7df4fef23..79cc481e513c 100644 --- a/ext/gmp/tests/gmp_divexact.phpt +++ b/ext/gmp/tests/gmp_divexact.phpt @@ -18,7 +18,7 @@ try { $r = gmp_divexact("233", "0"); var_dump(gmp_strval($r)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $r = gmp_divexact("100", "10"); @@ -42,7 +42,7 @@ echo "Done\n"; ?> --EXPECT-- string(1) "0" -gmp_divexact(): Argument #2 ($num2) Division by zero +DivisionByZeroError: gmp_divexact(): Argument #2 ($num2) Division by zero string(2) "10" string(3) "512" string(19) "5000000000000000000" diff --git a/ext/gmp/tests/gmp_export.phpt b/ext/gmp/tests/gmp_export.phpt index 085bafbbcc3c..b8022fb1df0a 100644 --- a/ext/gmp/tests/gmp_export.phpt +++ b/ext/gmp/tests/gmp_export.phpt @@ -57,30 +57,30 @@ var_dump(bin2hex(gmp_export(0xff))); try { var_dump(gmp_export(123, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_export(123, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // Invalid options try { var_dump(gmp_export(123, 1, GMP_MSW_FIRST | GMP_LSW_FIRST)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_export(123, 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) string(2) "ff" -gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 -gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 -gmp_export(): Argument #3 ($flags) cannot use multiple word order options -gmp_export(): Argument #3 ($flags) cannot use multiple endian options +ValueError: gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 +ValueError: gmp_export(): Argument #2 ($word_size) must be greater than or equal to 1 +ValueError: gmp_export(): Argument #3 ($flags) cannot use multiple word order options +ValueError: gmp_export(): Argument #3 ($flags) cannot use multiple endian options diff --git a/ext/gmp/tests/gmp_fact.phpt b/ext/gmp/tests/gmp_fact.phpt index b28f572c6975..7ebdd5df72ed 100644 --- a/ext/gmp/tests/gmp_fact.phpt +++ b/ext/gmp/tests/gmp_fact.phpt @@ -9,18 +9,18 @@ var_dump(gmp_strval(gmp_fact(0))); try { var_dump(gmp_strval(gmp_fact(""))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_fact("0"))); try { var_dump(gmp_strval(gmp_fact("-1"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval(gmp_fact(-1))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_fact(20))); @@ -34,28 +34,28 @@ $n = gmp_init(-10); try { var_dump(gmp_strval(gmp_fact($n))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_fact(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- string(1) "1" -gmp_fact(): Argument #1 ($num) is not an integer string +ValueError: gmp_fact(): Argument #1 ($num) is not an integer string string(1) "1" -gmp_fact(): Argument #1 ($num) must be between 0 and %d -gmp_fact(): Argument #1 ($num) must be between 0 and %d +ValueError: gmp_fact(): Argument #1 ($num) must be between 0 and %d +ValueError: gmp_fact(): Argument #1 ($num) must be between 0 and %d string(19) "2432902008176640000" string(65) "30414093201713378043612608166064768844377641568960512000000000000" string(7) "3628800" string(1) "1" string(9) "479001600" -gmp_fact(): Argument #1 ($num) must be between 0 and %d -gmp_fact(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_fact(): Argument #1 ($num) must be between 0 and %d +TypeError: gmp_fact(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_fact_overflow.phpt b/ext/gmp/tests/gmp_fact_overflow.phpt index 2d22005818c5..dd7984edaeae 100644 --- a/ext/gmp/tests/gmp_fact_overflow.phpt +++ b/ext/gmp/tests/gmp_fact_overflow.phpt @@ -8,18 +8,18 @@ gmp try { var_dump(gmp_fact(gmp_pow(2, 100))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_fact(gmp_init("18446744073709551616"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- -gmp_fact(): Argument #1 ($num) must be between 0 and %d -gmp_fact(): Argument #1 ($num) must be between 0 and %d +ValueError: gmp_fact(): Argument #1 ($num) must be between 0 and %d +ValueError: gmp_fact(): Argument #1 ($num) must be between 0 and %d Done diff --git a/ext/gmp/tests/gmp_gcdext.phpt b/ext/gmp/tests/gmp_gcdext.phpt index 530e0cb24c98..cb6284a575ef 100644 --- a/ext/gmp/tests/gmp_gcdext.phpt +++ b/ext/gmp/tests/gmp_gcdext.phpt @@ -31,12 +31,12 @@ foreach ($a as $val) { try { var_dump(gmp_gcdext($val[0], array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_gcdext(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -62,6 +62,6 @@ string(1) "1" string(1) "1" string(3) "195" string(3) "195" -gmp_gcdext(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_gcdext(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_gcdext(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_gcdext(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_hamdist.phpt b/ext/gmp/tests/gmp_hamdist.phpt index 26de0f5a46e3..aca4433d8a6f 100644 --- a/ext/gmp/tests/gmp_hamdist.phpt +++ b/ext/gmp/tests/gmp_hamdist.phpt @@ -19,17 +19,17 @@ var_dump(gmp_hamdist($n, $n1)); try { var_dump(gmp_hamdist($n, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_hamdist(array(), $n)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_hamdist(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -42,7 +42,7 @@ int(-1) int(43) int(0) int(26) -gmp_hamdist(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_hamdist(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_hamdist(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_import.phpt b/ext/gmp/tests/gmp_import.phpt index 6292738b5544..781388c8b1b3 100644 --- a/ext/gmp/tests/gmp_import.phpt +++ b/ext/gmp/tests/gmp_import.phpt @@ -51,49 +51,49 @@ var_dump($passed); try { var_dump(gmp_import('a', -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_import('a', 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // Invalid data lengths try { var_dump(gmp_import('a', 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_import('aa', 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_import(str_repeat('a', 100), 64)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // Invalid options try { var_dump(gmp_import('a', 1, GMP_MSW_FIRST | GMP_LSW_FIRST)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_import('a', 1, GMP_BIG_ENDIAN | GMP_LITTLE_ENDIAN)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1 -gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1 -gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) -gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) -gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) -gmp_import(): Argument #3 ($flags) cannot use multiple word order options -gmp_import(): Argument #3 ($flags) cannot use multiple endian options +ValueError: gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1 +ValueError: gmp_import(): Argument #2 ($word_size) must be greater than or equal to 1 +ValueError: gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) +ValueError: gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) +ValueError: gmp_import(): Argument #1 ($data) must be a multiple of argument #2 ($word_size) +ValueError: gmp_import(): Argument #3 ($flags) cannot use multiple word order options +ValueError: gmp_import(): Argument #3 ($flags) cannot use multiple endian options diff --git a/ext/gmp/tests/gmp_init.phpt b/ext/gmp/tests/gmp_init.phpt index 4032b54ba47e..a41e63ef54f3 100644 --- a/ext/gmp/tests/gmp_init.phpt +++ b/ext/gmp/tests/gmp_init.phpt @@ -10,23 +10,23 @@ var_dump(gmp_strval(gmp_init("98765678"))); try { var_dump(gmp_init(1,-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init("",36)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init("foo",3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval(gmp_init("993247326237679187178",3))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -37,8 +37,8 @@ object(GMP)#1 (1) { string(8) "98765678" } string(8) "98765678" -gmp_init(): Argument #2 ($base) must be 0 or between 2 and 62 -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #2 ($base) must be 0 or between 2 and 62 +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string Done diff --git a/ext/gmp/tests/gmp_intval.phpt b/ext/gmp/tests/gmp_intval.phpt index 15a1cdcc3d83..310f4a03fe5f 100644 --- a/ext/gmp/tests/gmp_intval.phpt +++ b/ext/gmp/tests/gmp_intval.phpt @@ -16,22 +16,22 @@ var_dump(gmp_intval($g)); try { var_dump(gmp_intval("")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gmp_intval(new stdclass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gmp_intval(array())); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gmp_intval("1.0001")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -42,8 +42,8 @@ int(-1) int(-2349828) int(2342344) int(12345678) -gmp_intval(): Argument #1 ($num) is not an integer string -gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given -gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, array given -gmp_intval(): Argument #1 ($num) is not an integer string +ValueError: gmp_intval(): Argument #1 ($num) is not an integer string +TypeError: gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given +TypeError: gmp_intval(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_intval(): Argument #1 ($num) is not an integer string Done diff --git a/ext/gmp/tests/gmp_invert.phpt b/ext/gmp/tests/gmp_invert.phpt index e2cd5c252abc..16dbd075e4da 100644 --- a/ext/gmp/tests/gmp_invert.phpt +++ b/ext/gmp/tests/gmp_invert.phpt @@ -11,14 +11,14 @@ var_dump(gmp_strval(gmp_invert("12312323213123123",7624))); try { var_dump(gmp_strval(gmp_invert(444,0))); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $zero = new GMP(0); var_dump(gmp_invert(5, $zero)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "No inverse modulo\n"; @@ -36,17 +36,17 @@ var_dump(gmp_strval(gmp_invert($n1, $n))); try { var_dump(gmp_invert(array(), 1)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_invert(1, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_invert(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -54,8 +54,8 @@ echo "Done\n"; --EXPECT-- string(7) "2293131" string(4) "5827" -Division by zero -Division by zero +DivisionByZeroError: Division by zero +DivisionByZeroError: Division by zero No inverse modulo bool(false) bool(false) @@ -63,7 +63,7 @@ bool(false) bool(false) string(22) "3498273496234234523441" string(1) "1" -gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_invert(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_invert(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_invert(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_jacobi.phpt b/ext/gmp/tests/gmp_jacobi.phpt index 59fab662fa83..d28847a4655a 100644 --- a/ext/gmp/tests/gmp_jacobi.phpt +++ b/ext/gmp/tests/gmp_jacobi.phpt @@ -23,17 +23,17 @@ var_dump(gmp_strval(gmp_jacobi(3, $n1))); try { var_dump(gmp_jacobi(3, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_jacobi(array(), 3)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_jacobi(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_jacobi(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_jacobi(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_jacobi(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_legendre.phpt b/ext/gmp/tests/gmp_legendre.phpt index 4955558281d0..fa3b2e05ad51 100644 --- a/ext/gmp/tests/gmp_legendre.phpt +++ b/ext/gmp/tests/gmp_legendre.phpt @@ -23,17 +23,17 @@ var_dump(gmp_strval(gmp_legendre(3, $n1))); try { var_dump(gmp_legendre(3, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_legendre(array(), 3)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_legendre(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -56,7 +56,7 @@ string(1) "0" string(2) "-1" string(1) "0" string(2) "-1" -gmp_legendre(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_legendre(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_legendre(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_mod.phpt b/ext/gmp/tests/gmp_mod.phpt index af2e5936d5cf..f66edaeb10e7 100644 --- a/ext/gmp/tests/gmp_mod.phpt +++ b/ext/gmp/tests/gmp_mod.phpt @@ -8,7 +8,7 @@ gmp try { var_dump(gmp_mod("","")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_mod(0,1)); var_dump(gmp_mod(0,-1)); @@ -16,13 +16,13 @@ var_dump(gmp_mod(0,-1)); try { var_dump(gmp_mod(-1,0)); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_mod(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $a = gmp_init("-100000000"); @@ -33,7 +33,7 @@ var_dump(gmp_mod($a, $b)); echo "Done\n"; ?> --EXPECT-- -gmp_mod(): Argument #1 ($num1) is not an integer string +ValueError: gmp_mod(): Argument #1 ($num1) is not an integer string object(GMP)#2 (1) { ["num"]=> string(1) "0" @@ -42,8 +42,8 @@ object(GMP)#2 (1) { ["num"]=> string(1) "0" } -gmp_mod(): Argument #2 ($num2) Modulo by zero -gmp_mod(): Argument #1 ($num1) must be of type GMP|string|int, array given +DivisionByZeroError: gmp_mod(): Argument #2 ($num2) Modulo by zero +TypeError: gmp_mod(): Argument #1 ($num1) must be of type GMP|string|int, array given object(GMP)#4 (1) { ["num"]=> string(5) "31161" diff --git a/ext/gmp/tests/gmp_neg.phpt b/ext/gmp/tests/gmp_neg.phpt index 6a7177a6ed35..1f48c3cc7cf1 100644 --- a/ext/gmp/tests/gmp_neg.phpt +++ b/ext/gmp/tests/gmp_neg.phpt @@ -13,7 +13,7 @@ var_dump(gmp_intval(gmp_neg("-1"))); try { var_dump(gmp_intval(gmp_neg(""))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_intval(gmp_neg(0))); @@ -26,7 +26,7 @@ var_dump(gmp_strval(gmp_neg($n))); try { var_dump(gmp_neg(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -36,9 +36,9 @@ int(0) int(-1) int(1) int(1) -gmp_neg(): Argument #1 ($num) is not an integer string +ValueError: gmp_neg(): Argument #1 ($num) is not an integer string int(0) int(0) string(21) "-12345678901234567890" -gmp_neg(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_neg(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_nextprime.phpt b/ext/gmp/tests/gmp_nextprime.phpt index b907d7a84e99..6a6fb565e7d6 100644 --- a/ext/gmp/tests/gmp_nextprime.phpt +++ b/ext/gmp/tests/gmp_nextprime.phpt @@ -19,19 +19,19 @@ try { $n = gmp_nextprime(array()); var_dump(gmp_strval($n)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $n = gmp_nextprime(""); var_dump(gmp_strval($n)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $n = gmp_nextprime(new stdclass()); var_dump(gmp_strval($n)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -42,7 +42,7 @@ string(1) "2" string(1) "2" string(4) "1009" string(6) "100003" -gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, array given -gmp_nextprime(): Argument #1 ($num) is not an integer string -gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, stdClass given +TypeError: gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_nextprime(): Argument #1 ($num) is not an integer string +TypeError: gmp_nextprime(): Argument #1 ($num) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_null_bytes.phpt b/ext/gmp/tests/gmp_null_bytes.phpt index 1518d342dda2..910d754fa8bc 100644 --- a/ext/gmp/tests/gmp_null_bytes.phpt +++ b/ext/gmp/tests/gmp_null_bytes.phpt @@ -16,13 +16,13 @@ foreach ($tests as $label => $test) { try { $test(); } catch (ValueError $e) { - echo $label, ": ", $e->getMessage(), PHP_EOL; + echo $label, ': ', $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -gmp_init: gmp_init(): Argument #1 ($num) is not an integer string -gmp_init prefix: gmp_init(): Argument #1 ($num) is not an integer string -gmp_add: gmp_add(): Argument #1 ($num1) is not an integer string -constructor: GMP::__construct(): Argument #1 ($num) is not an integer string +gmp_init: ValueError: gmp_init(): Argument #1 ($num) is not an integer string +gmp_init prefix: ValueError: gmp_init(): Argument #1 ($num) is not an integer string +gmp_add: ValueError: gmp_add(): Argument #1 ($num1) is not an integer string +constructor: ValueError: GMP::__construct(): Argument #1 ($num) is not an integer string diff --git a/ext/gmp/tests/gmp_operator_rhs_gmp_overflow.phpt b/ext/gmp/tests/gmp_operator_rhs_gmp_overflow.phpt index e8b6139ace0f..4fb1b3e23952 100644 --- a/ext/gmp/tests/gmp_operator_rhs_gmp_overflow.phpt +++ b/ext/gmp/tests/gmp_operator_rhs_gmp_overflow.phpt @@ -9,25 +9,25 @@ $too_large = gmp_init("18446744073709551616"); try { var_dump(gmp_init(2) ** $too_large); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init(2) << $too_large); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_init(2) >> $too_large); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- -Exponent must be between 0 and %d -Shift must be between 0 and %d -Shift must be between 0 and %d +ValueError: Exponent must be between 0 and %d +ValueError: Shift must be between 0 and %d +ValueError: Shift must be between 0 and %d Done diff --git a/ext/gmp/tests/gmp_or.phpt b/ext/gmp/tests/gmp_or.phpt index a51a06a09cad..2cbbecba1c0a 100644 --- a/ext/gmp/tests/gmp_or.phpt +++ b/ext/gmp/tests/gmp_or.phpt @@ -14,7 +14,7 @@ var_dump(gmp_strval(gmp_or(4545, -20))); try { var_dump(gmp_strval(gmp_or("test", "no test"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init("987657876543456"); @@ -25,17 +25,17 @@ var_dump(gmp_strval(gmp_or($n, $n1))); try { var_dump(gmp_or(array(), 1)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_or(1, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_or(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -46,10 +46,10 @@ string(6) "517363" string(10) "2342341163" string(2) "-1" string(3) "-19" -gmp_or(): Argument #1 ($num1) is not an integer string +ValueError: gmp_or(): Argument #1 ($num1) is not an integer string string(15) "987657876576252" string(21) "987658441719689394144" -gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_or(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_or(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_or(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_perfect_square.phpt b/ext/gmp/tests/gmp_perfect_square.phpt index 16fca508bff3..b9b31050e71a 100644 --- a/ext/gmp/tests/gmp_perfect_square.phpt +++ b/ext/gmp/tests/gmp_perfect_square.phpt @@ -24,7 +24,7 @@ var_dump(gmp_perfect_square($n)); try { var_dump(gmp_perfect_square(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -41,5 +41,5 @@ bool(false) bool(false) bool(true) bool(false) -gmp_perfect_square(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_perfect_square(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_popcount.phpt b/ext/gmp/tests/gmp_popcount.phpt index 3b61eec5b7aa..3b15a659c5ed 100644 --- a/ext/gmp/tests/gmp_popcount.phpt +++ b/ext/gmp/tests/gmp_popcount.phpt @@ -16,7 +16,7 @@ var_dump(gmp_popcount($n)); try { var_dump(gmp_popcount(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -28,5 +28,5 @@ int(10) int(31) int(-1) int(20) -gmp_popcount(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_popcount(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pow.phpt b/ext/gmp/tests/gmp_pow.phpt index 36d0d16d8ccc..ae206e3a7fcf 100644 --- a/ext/gmp/tests/gmp_pow.phpt +++ b/ext/gmp/tests/gmp_pow.phpt @@ -13,7 +13,7 @@ var_dump(gmp_strval(gmp_pow("2",0))); try { gmp_pow("2", -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(gmp_strval(gmp_pow("-2",10))); var_dump(gmp_strval(gmp_pow(20,10))); @@ -21,7 +21,7 @@ var_dump(gmp_strval(gmp_pow(50,10))); try { gmp_pow(50,-5); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $n = gmp_init("20"); @@ -32,13 +32,13 @@ var_dump(gmp_strval(gmp_pow($n,10))); try { var_dump(gmp_pow(2,array())); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gmp_pow(array(),10)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -49,13 +49,13 @@ string(4) "1024" string(5) "-2048" string(4) "1024" string(1) "1" -gmp_pow(): Argument #2 ($exponent) must be between 0 and %d +ValueError: gmp_pow(): Argument #2 ($exponent) must be between 0 and %d string(4) "1024" string(14) "10240000000000" string(17) "97656250000000000" -gmp_pow(): Argument #2 ($exponent) must be between 0 and %d +ValueError: gmp_pow(): Argument #2 ($exponent) must be between 0 and %d string(14) "10240000000000" string(14) "10240000000000" -gmp_pow(): Argument #2 ($exponent) must be of type int, array given -gmp_pow(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_pow(): Argument #2 ($exponent) must be of type int, array given +TypeError: gmp_pow(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_pow2.phpt b/ext/gmp/tests/gmp_pow2.phpt index 96f33e8c25ca..5902e00a3d2a 100644 --- a/ext/gmp/tests/gmp_pow2.phpt +++ b/ext/gmp/tests/gmp_pow2.phpt @@ -12,13 +12,13 @@ var_dump($n ** 10); try { pow($n, -10); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $n ** -10; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -31,5 +31,5 @@ object(GMP)#%d (1) { ["num"]=> string(4) "1024" } -Exponent must be between 0 and %d -Exponent must be between 0 and %d +ValueError: Exponent must be between 0 and %d +ValueError: Exponent must be between 0 and %d diff --git a/ext/gmp/tests/gmp_powm_sec.phpt b/ext/gmp/tests/gmp_powm_sec.phpt index 2c66ff25a5e5..1ec9bbb03198 100644 --- a/ext/gmp/tests/gmp_powm_sec.phpt +++ b/ext/gmp/tests/gmp_powm_sec.phpt @@ -18,20 +18,20 @@ foreach ([0, -1] as $exp) { try { var_dump(gmp_powm_sec(4, $exp, 497)); } catch (\ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } try { var_dump(gmp_powm_sec(4, 13, 0)); } catch (\DivisionByZeroError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_powm_sec(4, 13, 496)); } catch (\ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; diff --git a/ext/gmp/tests/gmp_pown.phpt b/ext/gmp/tests/gmp_pown.phpt index 79709f272715..92d20fd5ed7d 100644 --- a/ext/gmp/tests/gmp_pown.phpt +++ b/ext/gmp/tests/gmp_pown.phpt @@ -22,40 +22,40 @@ var_dump(gmp_strval(gmp_powm($n,$e,$m))); try { var_dump(gmp_powm(5, 11, 0)); } catch (\DivisionByZeroError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { var_dump(gmp_powm(5, "11", gmp_init(0))); } catch (\DivisionByZeroError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { var_dump(gmp_powm(array(),$e,$m)); } catch (\TypeError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { var_dump(gmp_powm($n,array(),$m)); } catch (\TypeError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { var_dump(gmp_powm($n,$error,array())); } catch (\TypeError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { var_dump(gmp_powm(array(),array(),array())); } catch (\TypeError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { $n = gmp_init("-5"); var_dump(gmp_powm(10, $n, 10)); } catch (\ValueError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } $n = gmp_init("0"); @@ -73,13 +73,13 @@ string(3) "533" string(3) "331" string(3) "171" string(3) "371" -gmp_powm(): Argument #3 ($modulus) Modulo by zero -gmp_powm(): Argument #3 ($modulus) Modulo by zero -gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, TypeError given -gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given -gmp_powm(): Argument #2 ($exponent) must be greater than or equal to 0 +DivisionByZeroError: gmp_powm(): Argument #3 ($modulus) Modulo by zero +DivisionByZeroError: gmp_powm(): Argument #3 ($modulus) Modulo by zero +TypeError: gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, array given +TypeError: gmp_powm(): Argument #2 ($exponent) must be of type GMP|string|int, TypeError given +TypeError: gmp_powm(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_powm(): Argument #2 ($exponent) must be greater than or equal to 0 object(GMP)#6 (1) { ["num"]=> string(1) "1" diff --git a/ext/gmp/tests/gmp_prevprime.phpt b/ext/gmp/tests/gmp_prevprime.phpt index 541a62f918d5..117d7573d83b 100644 --- a/ext/gmp/tests/gmp_prevprime.phpt +++ b/ext/gmp/tests/gmp_prevprime.phpt @@ -15,7 +15,7 @@ foreach ([-1, 0, 1, 2] as $value) { try { var_dump(gmp_prevprime($value)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -23,7 +23,7 @@ $definitelyPrime = null; try { var_dump(gmp_prevprime(2, $definitelyPrime)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($definitelyPrime); @@ -44,11 +44,11 @@ var_dump($definitelyPrime === (gmp_prob_prime($previousPrime) === 2)); ?> --EXPECT-- -gmp_prevprime(): Argument #1 ($num) must be greater than 2 -gmp_prevprime(): Argument #1 ($num) must be greater than 2 -gmp_prevprime(): Argument #1 ($num) must be greater than 2 -gmp_prevprime(): Argument #1 ($num) must be greater than 2 -gmp_prevprime(): Argument #1 ($num) must be greater than 2 +ValueError: gmp_prevprime(): Argument #1 ($num) must be greater than 2 +ValueError: gmp_prevprime(): Argument #1 ($num) must be greater than 2 +ValueError: gmp_prevprime(): Argument #1 ($num) must be greater than 2 +ValueError: gmp_prevprime(): Argument #1 ($num) must be greater than 2 +ValueError: gmp_prevprime(): Argument #1 ($num) must be greater than 2 NULL string(1) "2" string(1) "3" diff --git a/ext/gmp/tests/gmp_prob_prime.phpt b/ext/gmp/tests/gmp_prob_prime.phpt index 7c93a48bd935..9a962613b4dd 100644 --- a/ext/gmp/tests/gmp_prob_prime.phpt +++ b/ext/gmp/tests/gmp_prob_prime.phpt @@ -31,7 +31,7 @@ var_dump(gmp_prob_prime($n)); try { var_dump(gmp_prob_prime(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -75,5 +75,5 @@ int(0) int(0) int(0) int(0) -gmp_prob_prime(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_prob_prime(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_random_bits.phpt b/ext/gmp/tests/gmp_random_bits.phpt index 4e7f33798389..55693814fed4 100644 --- a/ext/gmp/tests/gmp_random_bits.phpt +++ b/ext/gmp/tests/gmp_random_bits.phpt @@ -8,12 +8,12 @@ gmp try { var_dump(gmp_random_bits(0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_random_bits(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // If these error the test fails. @@ -41,6 +41,6 @@ while (1) { echo "Done\n"; ?> --EXPECTF-- -gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d -gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d +ValueError: gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d +ValueError: gmp_random_bits(): Argument #1 ($bits) must be between 1 and %d Done diff --git a/ext/gmp/tests/gmp_random_range.phpt b/ext/gmp/tests/gmp_random_range.phpt index 59ac5762fce0..9882bf4ffa3b 100644 --- a/ext/gmp/tests/gmp_random_range.phpt +++ b/ext/gmp/tests/gmp_random_range.phpt @@ -12,18 +12,18 @@ $zero = gmp_init(0); try { var_dump(gmp_random_range(10, -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_random_range($plusTen, $minusTen)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_random_range($plusTen, $zero)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // If these error the test fails. @@ -74,7 +74,7 @@ while (1) { echo "Done\n"; ?> --EXPECT-- -gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) -gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) -gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) +ValueError: gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) +ValueError: gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) +ValueError: gmp_random_range(): Argument #1 ($min) must be less than argument #2 ($max) Done diff --git a/ext/gmp/tests/gmp_random_seed.phpt b/ext/gmp/tests/gmp_random_seed.phpt index bfb45739f54d..71b25dbf3729 100644 --- a/ext/gmp/tests/gmp_random_seed.phpt +++ b/ext/gmp/tests/gmp_random_seed.phpt @@ -110,7 +110,7 @@ var_dump(gmp_strval(gmp_random_range(-10000, 0))); try { var_dump(gmp_random_seed('not a number')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -173,5 +173,5 @@ string(301) "7240560133683902061389868703829443708354917824328579773726122219756 string(4) "9636" string(5) "-9848" string(5) "-9648" -gmp_random_seed(): Argument #1 ($seed) is not an integer string +ValueError: gmp_random_seed(): Argument #1 ($seed) is not an integer string Done diff --git a/ext/gmp/tests/gmp_remroot.phpt b/ext/gmp/tests/gmp_remroot.phpt index fe7a8316e596..8bf0a1b4a7f3 100644 --- a/ext/gmp/tests/gmp_remroot.phpt +++ b/ext/gmp/tests/gmp_remroot.phpt @@ -14,7 +14,7 @@ var_dump(gmp_rootrem(100, 4)); try { var_dump(gmp_rootrem(-100, 4)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_rootrem(0, 3)); @@ -22,12 +22,12 @@ var_dump(gmp_rootrem(0, 3)); try { var_dump(gmp_rootrem(100, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_rootrem(100, -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -92,7 +92,7 @@ array(2) { string(2) "19" } } -gmp_rootrem(): Argument #2 ($nth) must be odd if argument #1 ($num) is negative +ValueError: gmp_rootrem(): Argument #2 ($nth) must be odd if argument #1 ($num) is negative array(2) { [0]=> object(GMP)#%d (1) { @@ -105,5 +105,5 @@ array(2) { string(1) "0" } } -gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d -gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d +ValueError: gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d +ValueError: gmp_rootrem(): Argument #2 ($nth) must be between 1 and %d diff --git a/ext/gmp/tests/gmp_root.phpt b/ext/gmp/tests/gmp_root.phpt index b4a88405a211..3134d5b8e6ac 100644 --- a/ext/gmp/tests/gmp_root.phpt +++ b/ext/gmp/tests/gmp_root.phpt @@ -15,7 +15,7 @@ var_dump(gmp_root(100, 4)); try { var_dump(gmp_root(-100, 4)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_root(0, 3)); @@ -23,12 +23,12 @@ var_dump(gmp_root(0, 3)); try { var_dump(gmp_root(100, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_root(100, -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -53,10 +53,10 @@ object(GMP)#%d (1) { ["num"]=> string(1) "3" } -gmp_root(): Argument #2 ($nth) must be odd if argument #1 ($num) is negative +ValueError: gmp_root(): Argument #2 ($nth) must be odd if argument #1 ($num) is negative object(GMP)#%d (1) { ["num"]=> string(1) "0" } -gmp_root(): Argument #2 ($nth) must be between 1 and %d -gmp_root(): Argument #2 ($nth) must be between 1 and %d +ValueError: gmp_root(): Argument #2 ($nth) must be between 1 and %d +ValueError: gmp_root(): Argument #2 ($nth) must be between 1 and %d diff --git a/ext/gmp/tests/gmp_scan0.phpt b/ext/gmp/tests/gmp_scan0.phpt index 3accf37eee10..982f2b67410c 100644 --- a/ext/gmp/tests/gmp_scan0.phpt +++ b/ext/gmp/tests/gmp_scan0.phpt @@ -8,7 +8,7 @@ gmp try { var_dump(gmp_scan0("434234", -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_scan0("434234", 1)); @@ -22,17 +22,17 @@ var_dump(gmp_scan0($n, 10)); try { var_dump(gmp_scan0(array(), 200)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- -gmp_scan0(): Argument #2 ($start) must be between 0 and %d * %d +ValueError: gmp_scan0(): Argument #2 ($start) must be between 0 and %d * %d int(2) int(0) int(5) int(200) int(13) -gmp_scan0(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_scan0(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_scan1.phpt b/ext/gmp/tests/gmp_scan1.phpt index 8021f7e679d8..83a70bcba263 100644 --- a/ext/gmp/tests/gmp_scan1.phpt +++ b/ext/gmp/tests/gmp_scan1.phpt @@ -8,7 +8,7 @@ gmp try { var_dump(gmp_scan1("434234", -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_scan1("434234", 1)); @@ -22,17 +22,17 @@ var_dump(gmp_scan1($n, 10)); try { var_dump(gmp_scan1(array(), 200)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECTF-- -gmp_scan1(): Argument #2 ($start) must be between 0 and %d * %d +ValueError: gmp_scan1(): Argument #2 ($start) must be between 0 and %d * %d int(1) int(12) int(9) int(-1) int(10) -gmp_scan1(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_scan1(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_setbit.phpt b/ext/gmp/tests/gmp_setbit.phpt index 775042ef9737..09ce16ada7fe 100644 --- a/ext/gmp/tests/gmp_setbit.phpt +++ b/ext/gmp/tests/gmp_setbit.phpt @@ -13,7 +13,7 @@ $n = gmp_init(5); try { gmp_setbit($n, -20, false); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval($n)); @@ -39,26 +39,26 @@ $b = ""; try { gmp_setbit($b, 23); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $a = array(); try { gmp_setbit($a, array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- string(2) "-1" -gmp_setbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_setbit(): Argument #2 ($index) must be between 0 and %d * %d string(1) "5" string(1) "1" string(1) "7" string(12) "100008388608" string(12) "100000000000" string(12) "100000000008" -gmp_setbit(): Argument #1 ($num) must be of type GMP, string given -gmp_setbit(): Argument #1 ($num) must be of type GMP, array given +TypeError: gmp_setbit(): Argument #1 ($num) must be of type GMP, string given +TypeError: gmp_setbit(): Argument #1 ($num) must be of type GMP, array given Done diff --git a/ext/gmp/tests/gmp_setbit_long.phpt b/ext/gmp/tests/gmp_setbit_long.phpt index bbd472de967e..e6d2dc262d59 100644 --- a/ext/gmp/tests/gmp_setbit_long.phpt +++ b/ext/gmp/tests/gmp_setbit_long.phpt @@ -30,7 +30,7 @@ for($a = 1<<30; $a > 0 && $a < 0x8000000000; $a <<= 2) { try { gmp_setbit($n, $i, 1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } echo "Done\n"; @@ -41,5 +41,5 @@ FFFFFFFF 3FFFFFFFF FFFFFFFFF 3FFFFFFFFF -gmp_setbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_setbit(): Argument #2 ($index) must be between 0 and %d * %d Done diff --git a/ext/gmp/tests/gmp_sign.phpt b/ext/gmp/tests/gmp_sign.phpt index 56706b20eda1..7b1dba970fdc 100644 --- a/ext/gmp/tests/gmp_sign.phpt +++ b/ext/gmp/tests/gmp_sign.phpt @@ -14,18 +14,18 @@ var_dump(gmp_sign("-34535345345")); try { var_dump(gmp_sign("+34534573457345")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $n = gmp_init("098909878976786545"); var_dump(gmp_sign($n)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_sign(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -36,7 +36,7 @@ int(1) int(0) int(1) int(-1) -gmp_sign(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_sign(): Argument #1 ($num) must be of type GMP|string|int, array given +ValueError: gmp_sign(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +TypeError: gmp_sign(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_sqrt.phpt b/ext/gmp/tests/gmp_sqrt.phpt index 50da298161ce..52a13a3d3ffb 100644 --- a/ext/gmp/tests/gmp_sqrt.phpt +++ b/ext/gmp/tests/gmp_sqrt.phpt @@ -8,12 +8,12 @@ gmp try { var_dump(gmp_strval(gmp_sqrt(-2))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval(gmp_sqrt("-2"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval(gmp_sqrt("0"))); @@ -26,7 +26,7 @@ $n = gmp_init(-144); try { var_dump(gmp_strval(gmp_sqrt($n))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init(777); var_dump(gmp_strval(gmp_sqrt($n))); @@ -34,19 +34,19 @@ var_dump(gmp_strval(gmp_sqrt($n))); try { var_dump(gmp_sqrt(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 -gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 string(1) "0" string(1) "1" string(2) "12" string(1) "0" -gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: gmp_sqrt(): Argument #1 ($num) must be greater than or equal to 0 string(2) "27" -gmp_sqrt(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_sqrt(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_sqrtrem.phpt b/ext/gmp/tests/gmp_sqrtrem.phpt index 915fc4ed2f9e..a9602b64089d 100644 --- a/ext/gmp/tests/gmp_sqrtrem.phpt +++ b/ext/gmp/tests/gmp_sqrtrem.phpt @@ -9,7 +9,7 @@ try { $r = gmp_sqrtrem(-1); var_dump($r); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $r = gmp_sqrtrem("0"); @@ -49,7 +49,7 @@ try { $r = gmp_sqrtrem($n); var_dump($r); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init(1000001); @@ -60,13 +60,13 @@ var_dump(gmp_strval($r[1])); try { var_dump(gmp_sqrtrem(array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 string(1) "0" string(1) "0" string(1) "1" @@ -83,8 +83,8 @@ string(4) "1000" string(1) "0" string(4) "1000" string(1) "1" -gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 +ValueError: gmp_sqrtrem(): Argument #1 ($num) must be greater than or equal to 0 string(4) "1000" string(1) "1" -gmp_sqrtrem(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_sqrtrem(): Argument #1 ($num) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/gmp_strict_types.phpt b/ext/gmp/tests/gmp_strict_types.phpt index 006f06465c53..3e11b0d095ee 100644 --- a/ext/gmp/tests/gmp_strict_types.phpt +++ b/ext/gmp/tests/gmp_strict_types.phpt @@ -13,27 +13,27 @@ var_dump(gmp_abs("-1")); try { gmp_abs(1.0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { gmp_abs(false); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { gmp_abs(true); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { gmp_abs(null); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { gmp_abs([]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -50,8 +50,8 @@ object(GMP)#2 (1) { ["num"]=> string(1) "1" } -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, false given -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, true given -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, null given -gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, float given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, false given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, true given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, null given +TypeError: gmp_abs(): Argument #1 ($num) must be of type GMP|string|int, array given diff --git a/ext/gmp/tests/gmp_strval.phpt b/ext/gmp/tests/gmp_strval.phpt index 1221d04b3b1d..771c0e203012 100644 --- a/ext/gmp/tests/gmp_strval.phpt +++ b/ext/gmp/tests/gmp_strval.phpt @@ -8,19 +8,19 @@ gmp try { var_dump(gmp_strval("")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval("", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $fp = fopen(__FILE__, "r"); try { var_dump(gmp_strval($fp)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $g = gmp_init("9765456"); @@ -28,12 +28,12 @@ var_dump(gmp_strval($g)); try { var_dump(gmp_strval($g, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval($g, 100000)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval($g, 10)); @@ -42,40 +42,40 @@ var_dump(gmp_strval($g)); try { var_dump(gmp_strval($g, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval($g, 100000)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_strval($g, 10)); try { var_dump(gmp_strval(array(1,2))); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_strval(new stdclass)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -gmp_strval(): Argument #1 ($num) is not an integer string -gmp_strval(): Argument #1 ($num) is not an integer string -gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, resource given +ValueError: gmp_strval(): Argument #1 ($num) is not an integer string +ValueError: gmp_strval(): Argument #1 ($num) is not an integer string +TypeError: gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, resource given string(7) "9765456" -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 string(7) "9765456" string(8) "-3373333" -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 -gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 +ValueError: gmp_strval(): Argument #2 ($base) must be between 2 and 62, or -2 and -36 string(8) "-3373333" -gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, array given -gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given +TypeError: gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, array given +TypeError: gmp_strval(): Argument #1 ($num) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_sub.phpt b/ext/gmp/tests/gmp_sub.phpt index 5161bce10356..9cbf2097cc35 100644 --- a/ext/gmp/tests/gmp_sub.phpt +++ b/ext/gmp/tests/gmp_sub.phpt @@ -8,12 +8,12 @@ gmp try { var_dump(gmp_sub("", "")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_sub(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($g = gmp_sub(10000, 10001)); @@ -25,20 +25,20 @@ try { var_dump($g = gmp_sub(10000, new stdclass)); var_dump(gmp_strval($g)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($g = gmp_sub(new stdclass, 100)); var_dump(gmp_strval($g)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -gmp_sub(): Argument #1 ($num1) is not an integer string -gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, array given +ValueError: gmp_sub(): Argument #1 ($num1) is not an integer string +TypeError: gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, array given object(GMP)#1 (1) { ["num"]=> string(2) "-1" @@ -49,6 +49,6 @@ object(GMP)#3 (1) { string(5) "10001" } string(5) "10001" -gmp_sub(): Argument #2 ($num2) must be of type GMP|string|int, stdClass given -gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, stdClass given +TypeError: gmp_sub(): Argument #2 ($num2) must be of type GMP|string|int, stdClass given +TypeError: gmp_sub(): Argument #1 ($num1) must be of type GMP|string|int, stdClass given Done diff --git a/ext/gmp/tests/gmp_testbit.phpt b/ext/gmp/tests/gmp_testbit.phpt index 1cef8cd4166b..fb6497df5463 100644 --- a/ext/gmp/tests/gmp_testbit.phpt +++ b/ext/gmp/tests/gmp_testbit.phpt @@ -10,7 +10,7 @@ $n = gmp_init(0); try { var_dump(gmp_testbit($n, -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gmp_testbit($n, 0)); @@ -22,7 +22,7 @@ var_dump(gmp_testbit($n, 1)); try { var_dump(gmp_testbit($n, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init("1000000"); @@ -48,12 +48,12 @@ var_dump(gmp_strval($n)); echo "Done\n"; ?> --EXPECTF-- -gmp_testbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_testbit(): Argument #2 ($index) must be between 0 and %d * %d bool(false) bool(false) bool(false) bool(true) -gmp_testbit(): Argument #2 ($index) must be between 0 and %d * %d +ValueError: gmp_testbit(): Argument #2 ($index) must be between 0 and %d * %d bool(false) bool(true) string(7) "1000002" diff --git a/ext/gmp/tests/gmp_xor.phpt b/ext/gmp/tests/gmp_xor.phpt index fdc8a67562cf..a60500147ca1 100644 --- a/ext/gmp/tests/gmp_xor.phpt +++ b/ext/gmp/tests/gmp_xor.phpt @@ -14,7 +14,7 @@ var_dump(gmp_strval(gmp_xor(4545, -20))); try { var_dump(gmp_strval(gmp_xor("test", "no test"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $n = gmp_init("987657876543456"); @@ -25,17 +25,17 @@ var_dump(gmp_strval(gmp_xor($n, $n1))); try { var_dump(gmp_xor(array(), 1)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_xor(1, array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gmp_xor(array(), array())); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -46,10 +46,10 @@ string(6) "476369" string(10) "2342340648" string(5) "-3334" string(5) "-4563" -gmp_xor(): Argument #1 ($num1) is not an integer string +ValueError: gmp_xor(): Argument #1 ($num1) is not an integer string string(15) "987657876574716" string(21) "987658017016065701376" -gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given -gmp_xor(): Argument #2 ($num2) must be of type GMP|string|int, array given -gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given +TypeError: gmp_xor(): Argument #2 ($num2) must be of type GMP|string|int, array given +TypeError: gmp_xor(): Argument #1 ($num1) must be of type GMP|string|int, array given Done diff --git a/ext/gmp/tests/overloading.phpt b/ext/gmp/tests/overloading.phpt index f55a83f0bd5f..7d078784e2fa 100644 --- a/ext/gmp/tests/overloading.phpt +++ b/ext/gmp/tests/overloading.phpt @@ -26,7 +26,7 @@ var_dump(42 / $b); try { var_dump($a / 0); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($a % $b); @@ -35,7 +35,7 @@ var_dump(42 % $b); try { var_dump($a % 0); } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($a ** $b); @@ -64,13 +64,13 @@ var_dump(-$a >> 2); try { $a << -1; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $a >> -1; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(~$a); @@ -97,7 +97,7 @@ var_dump($a >= 42); try { var_dump($a == new stdClass); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $a += 1; @@ -172,7 +172,7 @@ object(GMP)#3 (1) { ["num"]=> string(1) "2" } -Division by zero +DivisionByZeroError: Division by zero object(GMP)#4 (1) { ["num"]=> string(1) "8" @@ -185,7 +185,7 @@ object(GMP)#4 (1) { ["num"]=> string(1) "8" } -Modulo by zero +DivisionByZeroError: Modulo by zero object(GMP)#3 (1) { ["num"]=> string(28) "3937657486715347520027492352" @@ -254,8 +254,8 @@ object(GMP)#5 (1) { ["num"]=> string(3) "-11" } -Shift must be between 0 and %d -Shift must be between 0 and %d +ValueError: Shift must be between 0 and %d +ValueError: Shift must be between 0 and %d object(GMP)#5 (1) { ["num"]=> string(3) "-43" @@ -282,7 +282,7 @@ bool(false) bool(true) bool(false) bool(true) -Number must be of type GMP|string|int, stdClass given +TypeError: Number must be of type GMP|string|int, stdClass given object(GMP)#4 (1) { ["num"]=> string(2) "43" diff --git a/ext/gmp/tests/serialize.phpt b/ext/gmp/tests/serialize.phpt index 84877459a9bc..3926a1eb284a 100644 --- a/ext/gmp/tests/serialize.phpt +++ b/ext/gmp/tests/serialize.phpt @@ -18,27 +18,27 @@ var_dump(unserialize('C:3:"GMP":15:{s:2:"42";a:0:{}}')); try { unserialize('C:3:"GMP":0:{}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('C:3:"GMP":9:{s:2:"42";}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:3:"GMP":0:{}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:3:"GMP":1:{i:0;i:0;}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:3:"GMP":1:{i:0;s:0:"";}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:3:"GMP":2:{i:0;s:1:"0";i:1;i:0;}'); -} catch (Exception $e) { var_dump($e->getMessage()); } +} catch (Exception $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -66,9 +66,9 @@ object(GMP)#1 (1) { ["num"]=> string(2) "42" } -string(28) "Could not unserialize number" -string(32) "Could not unserialize properties" -string(28) "Could not unserialize number" -string(28) "Could not unserialize number" -string(28) "Could not unserialize number" -string(32) "Could not unserialize properties" +Exception: Could not unserialize number +Exception: Could not unserialize properties +Exception: Could not unserialize number +Exception: Could not unserialize number +Exception: Could not unserialize number +Exception: Could not unserialize properties diff --git a/ext/gmp/tests/surprising_integer_literals.phpt b/ext/gmp/tests/surprising_integer_literals.phpt index a4578f7afb55..dd5a2540d07b 100644 --- a/ext/gmp/tests/surprising_integer_literals.phpt +++ b/ext/gmp/tests/surprising_integer_literals.phpt @@ -19,15 +19,15 @@ foreach ($values as $value) { try { var_dump(gmp_init($value)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string -gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string +ValueError: gmp_init(): Argument #1 ($num) is not an integer string diff --git a/ext/hash/tests/bug81714.phpt b/ext/hash/tests/bug81714.phpt index a151bda6884e..1f8557021a26 100644 --- a/ext/hash/tests/bug81714.phpt +++ b/ext/hash/tests/bug81714.phpt @@ -7,8 +7,8 @@ hash_final($h); try { serialize($h); } catch (Exception $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- -string(52) "HashContext for algorithm "md5" cannot be serialized" +Exception: HashContext for algorithm "md5" cannot be serialized diff --git a/ext/hash/tests/gh12186_1.phpt b/ext/hash/tests/gh12186_1.phpt index 5e34b1dd78e8..afdfe5f7dbfe 100644 --- a/ext/hash/tests/gh12186_1.phpt +++ b/ext/hash/tests/gh12186_1.phpt @@ -9,9 +9,9 @@ hash_final($c); try { hash_copy($c); } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- -hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext +TypeError: hash_copy(): Argument #1 ($context) must be a valid, non-finalized HashContext diff --git a/ext/hash/tests/gh12186_2.phpt b/ext/hash/tests/gh12186_2.phpt index 64a12b15c391..46dc1232642b 100644 --- a/ext/hash/tests/gh12186_2.phpt +++ b/ext/hash/tests/gh12186_2.phpt @@ -9,9 +9,9 @@ hash_final($c); try { clone $c; } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot clone a finalized HashContext +ValueError: Cannot clone a finalized HashContext diff --git a/ext/hash/tests/hash_equals.phpt b/ext/hash/tests/hash_equals.phpt index 69e23eea0fa3..c01e7be8c858 100644 --- a/ext/hash/tests/hash_equals.phpt +++ b/ext/hash/tests/hash_equals.phpt @@ -9,7 +9,7 @@ function trycatch_dump(...$tests) { var_dump($test()); } catch (\Error $e) { - echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -39,9 +39,9 @@ bool(false) bool(false) bool(false) bool(true) -[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given -[TypeError] hash_equals(): Argument #2 ($user_string) must be of type string, int given -[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, int given -[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given -[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given -[TypeError] hash_equals(): Argument #1 ($known_string) must be of type string, null given +TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, int given +TypeError: hash_equals(): Argument #2 ($user_string) must be of type string, int given +TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, int given +TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given +TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given +TypeError: hash_equals(): Argument #1 ($known_string) must be of type string, null given diff --git a/ext/hash/tests/hash_error.phpt b/ext/hash/tests/hash_error.phpt index b5c038809139..63e99de72932 100644 --- a/ext/hash/tests/hash_error.phpt +++ b/ext/hash/tests/hash_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing hash() function with invalid hash algorithm --\n"; try { hash('foo', ''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -17,4 +17,4 @@ try { *** Testing hash() : error conditions *** -- Testing hash() function with invalid hash algorithm -- -hash(): Argument #1 ($algo) must be a valid hashing algorithm +ValueError: hash(): Argument #1 ($algo) must be a valid hashing algorithm diff --git a/ext/hash/tests/hash_file_error.phpt b/ext/hash/tests/hash_file_error.phpt index 68ba55f4a373..a381d3bdd63c 100644 --- a/ext/hash/tests/hash_file_error.phpt +++ b/ext/hash/tests/hash_file_error.phpt @@ -16,7 +16,7 @@ echo "\n-- Testing hash_file() function with an unknown algorithm --\n"; try { hash_file('foobar', $filename); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Testing hash_file() function with a non-existent file --\n"; @@ -34,7 +34,7 @@ unlink( $filename ); *** Testing hash_file() : error conditions *** -- Testing hash_file() function with an unknown algorithm -- -hash_file(): Argument #1 ($algo) must be a valid hashing algorithm +ValueError: hash_file(): Argument #1 ($algo) must be a valid hashing algorithm -- Testing hash_file() function with a non-existent file -- diff --git a/ext/hash/tests/hash_hkdf_edges.phpt b/ext/hash/tests/hash_hkdf_edges.phpt index 89b3d8af6354..77481802470e 100644 --- a/ext/hash/tests/hash_hkdf_edges.phpt +++ b/ext/hash/tests/hash_hkdf_edges.phpt @@ -16,7 +16,7 @@ try { var_dump(hash_hkdf('jOaAt', $ikm)); } catch (\Error $e) { - echo '[Error] ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -26,4 +26,4 @@ Length < digestSize: 98b16391063ece Length % digestSize != 0: 98b16391063ecee006a3ca8ee5776b1e5f Algo name case-sensitivity: true Non-crypto algo name case-sensitivity: -[Error] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm diff --git a/ext/hash/tests/hash_hkdf_error.phpt b/ext/hash/tests/hash_hkdf_error.phpt index 86aa10a02f35..f68d7a62fca1 100644 --- a/ext/hash/tests/hash_hkdf_error.phpt +++ b/ext/hash/tests/hash_hkdf_error.phpt @@ -11,7 +11,7 @@ function trycatch_dump(...$tests) { var_dump($test()); } catch (\Error $e) { - echo '[' . get_class($e) . '] ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -48,19 +48,19 @@ trycatch_dump( *** Testing hash_hkdf(): error conditions *** -- Testing hash_hkdf() function with invalid hash algorithm -- -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hkdf() function with non-cryptographic hash algorithm -- -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -[ValueError] hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hkdf(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hkdf() function with invalid parameters -- -[ValueError] hash_hkdf(): Argument #2 ($key) must not be empty -[ValueError] hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0 -[ValueError] hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100 +ValueError: hash_hkdf(): Argument #2 ($key) must not be empty +ValueError: hash_hkdf(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: hash_hkdf(): Argument #3 ($length) must be less than or equal to 5100 diff --git a/ext/hash/tests/hash_hmac_error.phpt b/ext/hash/tests/hash_hmac_error.phpt index 81c28ee46c05..ad92d4a26ceb 100644 --- a/ext/hash/tests/hash_hmac_error.phpt +++ b/ext/hash/tests/hash_hmac_error.phpt @@ -16,7 +16,7 @@ try { var_dump(hash_hmac('foo', $data, $key)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_hmac() function with non-cryptographic hash algorithm --\n"; @@ -24,7 +24,7 @@ try { var_dump(hash_hmac('crc32', $data, $key)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -32,7 +32,7 @@ catch (\Error $e) { *** Testing hash_hmac() : error conditions *** -- Testing hash_hmac() function with invalid hash algorithm -- -hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hmac() function with non-cryptographic hash algorithm -- -hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hmac(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm diff --git a/ext/hash/tests/hash_hmac_file_error.phpt b/ext/hash/tests/hash_hmac_file_error.phpt index 3a4d85ee7e35..c882975fed24 100644 --- a/ext/hash/tests/hash_hmac_file_error.phpt +++ b/ext/hash/tests/hash_hmac_file_error.phpt @@ -13,7 +13,7 @@ try { var_dump(hash_hmac_file('foo', $file, $key, TRUE)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_hmac_file() function with non-cryptographic hash algorithm --\n"; @@ -21,7 +21,7 @@ try { var_dump(hash_hmac_file('crc32', $file, $key, TRUE)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_hmac_file() function with bad path --\n"; @@ -29,7 +29,7 @@ try { var_dump(hash_hmac_file('md5', $file.chr(0).$file, $key, TRUE)); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -37,10 +37,10 @@ catch (ValueError $e) { *** Testing hash() : error conditions *** -- Testing hash_hmac_file() function with invalid hash algorithm -- -hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hmac_file() function with non-cryptographic hash algorithm -- -hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_hmac_file(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_hmac_file() function with bad path -- -hash_hmac_file(): Argument #2 ($filename) must not contain any null bytes +ValueError: hash_hmac_file(): Argument #2 ($filename) must not contain any null bytes diff --git a/ext/hash/tests/hash_init_error.phpt b/ext/hash/tests/hash_init_error.phpt index 560ad4f8e9ae..76fa392f6b21 100644 --- a/ext/hash/tests/hash_init_error.phpt +++ b/ext/hash/tests/hash_init_error.phpt @@ -9,7 +9,7 @@ try { var_dump(hash_init('dummy')); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms --\n"; @@ -17,7 +17,7 @@ try { var_dump(hash_init('crc32', HASH_HMAC)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_init() function with HASH_HMAC and no key --\n"; @@ -25,14 +25,14 @@ try { var_dump(hash_init('md5', HASH_HMAC)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(hash_init('md5', HASH_HMAC, null)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -41,13 +41,13 @@ catch (\Error $e) { *** Testing hash_init(): error conditions *** -- Testing hash_init() function with unknown algorithms -- -hash_init(): Argument #1 ($algo) must be a valid hashing algorithm +ValueError: hash_init(): Argument #1 ($algo) must be a valid hashing algorithm -- Testing hash_init() function with HASH_HMAC and non-cryptographic algorithms -- -hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested +ValueError: hash_init(): Argument #1 ($algo) must be a cryptographic hashing algorithm if HMAC is requested -- Testing hash_init() function with HASH_HMAC and no key -- -hash_init(): Argument #3 ($key) must not be empty when HMAC is requested +ValueError: hash_init(): Argument #3 ($key) must not be empty when HMAC is requested Deprecated: hash_init(): Passing null to parameter #3 ($key) of type string is deprecated in %s on line %d -hash_init(): Argument #3 ($key) must not be empty when HMAC is requested +ValueError: hash_init(): Argument #3 ($key) must not be empty when HMAC is requested diff --git a/ext/hash/tests/hash_pbkdf2_error.phpt b/ext/hash/tests/hash_pbkdf2_error.phpt index 35cda2b52fc6..d07a8caa2344 100644 --- a/ext/hash/tests/hash_pbkdf2_error.phpt +++ b/ext/hash/tests/hash_pbkdf2_error.phpt @@ -16,7 +16,7 @@ try { var_dump(hash_pbkdf2('foo', $password, $salt, 1)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -25,7 +25,7 @@ try { var_dump(hash_pbkdf2('crc32', $password, $salt, 1)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_pbkdf2() function with invalid iterations --\n"; @@ -33,14 +33,14 @@ try { var_dump(hash_pbkdf2('md5', $password, $salt, 0)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(hash_pbkdf2('md5', $password, $salt, -1)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing hash_pbkdf2() function with invalid length --\n"; @@ -48,7 +48,7 @@ try { var_dump(hash_pbkdf2('md5', $password, $salt, 1, -1)); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -56,14 +56,14 @@ catch (\Error $e) { *** Testing hash_pbkdf2() : error conditions *** -- Testing hash_pbkdf2() function with invalid hash algorithm -- -hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_pbkdf2() function with non-cryptographic hash algorithm -- -hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm +ValueError: hash_pbkdf2(): Argument #1 ($algo) must be a valid cryptographic hashing algorithm -- Testing hash_pbkdf2() function with invalid iterations -- -hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0 -hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0 +ValueError: hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0 +ValueError: hash_pbkdf2(): Argument #4 ($iterations) must be greater than 0 -- Testing hash_pbkdf2() function with invalid length -- -hash_pbkdf2(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: hash_pbkdf2(): Argument #5 ($length) must be greater than or equal to 0 diff --git a/ext/hash/tests/hash_serialize_002.phpt b/ext/hash/tests/hash_serialize_002.phpt index 15ecf94c1e5e..40157bf3800c 100644 --- a/ext/hash/tests/hash_serialize_002.phpt +++ b/ext/hash/tests/hash_serialize_002.phpt @@ -18,7 +18,7 @@ foreach ($algos as $algo) { $serial = serialize($ctx0); assert(is_string($serial)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -26,91 +26,91 @@ echo "Done\n"; ?> --EXPECT-- string(3) "md2" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(3) "md4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(3) "md5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(4) "sha1" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(6) "sha224" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(6) "sha256" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(6) "sha384" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "sha512/224" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "sha512/256" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(6) "sha512" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(8) "sha3-224" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(8) "sha3-256" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(8) "sha3-384" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(8) "sha3-512" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "ripemd128" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "ripemd160" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "ripemd256" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "ripemd320" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "whirlpool" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger128,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger160,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger192,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger128,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger160,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "tiger192,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(6) "snefru" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(9) "snefru256" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(4) "gost" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(11) "gost-crypto" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval128,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval160,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval192,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval224,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval256,3" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval128,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval160,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval192,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval224,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval256,4" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval128,5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval160,5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval192,5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval224,5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized string(10) "haval256,5" -HashContext with HASH_HMAC option cannot be serialized +Exception: HashContext with HASH_HMAC option cannot be serialized Done diff --git a/ext/hash/tests/hash_serialize_003.phpt b/ext/hash/tests/hash_serialize_003.phpt index a687c2aeffbd..541a3169e53e 100644 --- a/ext/hash/tests/hash_serialize_003.phpt +++ b/ext/hash/tests/hash_serialize_003.phpt @@ -237,7 +237,7 @@ function test_serialization($serial, $hash, $algo) { } } catch (Throwable $e) { echo "$algo: problem with serialization {$serial}\n"; - echo " ", $e->getMessage(), "\n", $e->getTraceAsString(); + echo ' ', $e::class . ': ' . $e->getMessage(), "\n", $e->getTraceAsString(); } } diff --git a/ext/hash/tests/hash_serialize_004.phpt b/ext/hash/tests/hash_serialize_004.phpt index ee5c08f973e2..6c6f99365756 100644 --- a/ext/hash/tests/hash_serialize_004.phpt +++ b/ext/hash/tests/hash_serialize_004.phpt @@ -8,7 +8,7 @@ $ctx = hash_init("sha256"); try { $ctx->__unserialize($ctx->__serialize()); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // bad formats @@ -26,20 +26,20 @@ foreach ([ $ctx = unserialize(base64_decode($serial)); echo "Unexpected success\n"; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "Done\n"; ?> --EXPECT-- -HashContext::__unserialize called on initialized object -Incomplete or ill-formed serialization data -Incomplete or ill-formed serialization data -Incomplete or ill-formed serialization data -HashContext with HASH_HMAC option cannot be serialized -Incomplete or ill-formed serialization data ("sha1" code -1) -Incomplete or ill-formed serialization data ("sha1" code -1024) -Incomplete or ill-formed serialization data ("sha1" code -1) -Unknown hash algorithm +Exception: HashContext::__unserialize called on initialized object +Exception: Incomplete or ill-formed serialization data +Exception: Incomplete or ill-formed serialization data +Exception: Incomplete or ill-formed serialization data +Exception: HashContext with HASH_HMAC option cannot be serialized +Exception: Incomplete or ill-formed serialization data ("sha1" code -1) +Exception: Incomplete or ill-formed serialization data ("sha1" code -1024) +Exception: Incomplete or ill-formed serialization data ("sha1" code -1) +Exception: Unknown hash algorithm Done diff --git a/ext/hash/tests/new-context.phpt b/ext/hash/tests/new-context.phpt index dd8e92e029b6..345f53adfceb 100644 --- a/ext/hash/tests/new-context.phpt +++ b/ext/hash/tests/new-context.phpt @@ -6,8 +6,8 @@ Hash: Attempt to instantiate a HashContext directly try { new HashContext; } catch (Error $e) { - echo "Exception: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Call to private HashContext::__construct() from global scope +Error: Call to private HashContext::__construct() from global scope diff --git a/ext/hash/tests/reuse.phpt b/ext/hash/tests/reuse.phpt index b5cfc79c162d..9ca8f4ceda65 100644 --- a/ext/hash/tests/reuse.phpt +++ b/ext/hash/tests/reuse.phpt @@ -9,9 +9,9 @@ try { hash_update($h, 'foo'); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext +TypeError: hash_update(): Argument #1 ($context) must be a valid, non-finalized HashContext diff --git a/ext/hash/tests/xxhash_secret.phpt b/ext/hash/tests/xxhash_secret.phpt index 4cd6798ef769..768032169afa 100644 --- a/ext/hash/tests/xxhash_secret.phpt +++ b/ext/hash/tests/xxhash_secret.phpt @@ -18,19 +18,19 @@ foreach (["xxh3", "xxh128"] as $a) { try { $ctx = hash_init($a, options: ["seed" => 24, "secret" => $secret]); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ctx = hash_init($a, options: ["secret" => new StringableThrowingClass()]); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ctx = hash_init($a, options: ["secret" => str_repeat('a', 17)]); } catch (Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } $ctx = hash_init($a, options: ["secret" => $secret]); @@ -47,15 +47,15 @@ foreach (["xxh3", "xxh128"] as $a) { ?> --EXPECTF-- -string(67) "xxh3: Only one of seed or secret is to be passed for initialization" +Error: xxh3: Only one of seed or secret is to be passed for initialization Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d -string(23) "exception in __toString" -string(57) "xxh3: Secret length must be >= 136 bytes, 17 bytes passed" +Exception: exception in __toString +Error: xxh3: Secret length must be >= 136 bytes, 17 bytes passed 8028aa834c03557a == 8028aa834c03557a == true -string(69) "xxh128: Only one of seed or secret is to be passed for initialization" +Error: xxh128: Only one of seed or secret is to be passed for initialization Deprecated: hash_init(): Passing a secret of a type other than string is deprecated because it implicitly converts to a string, potentially hiding bugs in %s on line %d -string(23) "exception in __toString" -string(59) "xxh128: Secret length must be >= 136 bytes, 17 bytes passed" +Exception: exception in __toString +Error: xxh128: Secret length must be >= 136 bytes, 17 bytes passed 54279097795e7218093a05d4d781cbb9 == 54279097795e7218093a05d4d781cbb9 == true diff --git a/ext/hash/tests/xxhash_unserialize_memsize.phpt b/ext/hash/tests/xxhash_unserialize_memsize.phpt index 6de78ee0711e..d287f0a368fd 100644 --- a/ext/hash/tests/xxhash_unserialize_memsize.phpt +++ b/ext/hash/tests/xxhash_unserialize_memsize.phpt @@ -9,7 +9,7 @@ try { $hash = unserialize($str); hash_update($hash, ''); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -19,9 +19,9 @@ try { $hash = unserialize($str); hash_update($hash, ''); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Incomplete or ill-formed serialization data ("xxh32" code -2000) -Incomplete or ill-formed serialization data ("xxh64" code -2000) +Exception: Incomplete or ill-formed serialization data ("xxh32" code -2000) +Exception: Incomplete or ill-formed serialization data ("xxh64" code -2000) diff --git a/ext/iconv/tests/bug78069.phpt b/ext/iconv/tests/bug78069.phpt index 88cf6e35f82d..1c2fdd1a64c0 100644 --- a/ext/iconv/tests/bug78069.phpt +++ b/ext/iconv/tests/bug78069.phpt @@ -10,4 +10,4 @@ var_dump(count($hdr)); DONE --EXPECT-- int(1) -DONE \ No newline at end of file +DONE diff --git a/ext/iconv/tests/iconv_strpos.phpt b/ext/iconv/tests/iconv_strpos.phpt index c32fe921e624..e423c694b391 100644 --- a/ext/iconv/tests/iconv_strpos.phpt +++ b/ext/iconv/tests/iconv_strpos.phpt @@ -14,7 +14,7 @@ function foo($haystk, $needle, $offset, $to_charset = false, $from_charset = fal try { var_dump(strpos($haystk, $needle, $offset)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { if ($to_charset !== false) { @@ -23,7 +23,7 @@ function foo($haystk, $needle, $offset, $to_charset = false, $from_charset = fal var_dump(iconv_strpos($haystk, $needle, $offset)); } } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } foo("abecdbcdabef", "bcd", -1); @@ -48,8 +48,8 @@ int(5) int(5) bool(false) bool(false) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(7) int(7) int(16) diff --git a/ext/iconv/tests/iconv_strpos_variation5.phpt b/ext/iconv/tests/iconv_strpos_variation5.phpt index 2cf4b947616f..ae7487a19e9f 100644 --- a/ext/iconv/tests/iconv_strpos_variation5.phpt +++ b/ext/iconv/tests/iconv_strpos_variation5.phpt @@ -32,13 +32,13 @@ for ($i = -30; $i <= 60; $i += 10) { try { var_dump(iconv_strpos($string_ascii, $needle_ascii, $i)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--Multibyte String --\n"; try { var_dump(iconv_strpos($string_mb, $needle_mb, $i, 'UTF-8')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -49,9 +49,9 @@ echo "Done"; **-- Offset is: -30 --** -- ASCII String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: -20 --** -- ASCII String -- @@ -85,25 +85,25 @@ int(20) **-- Offset is: 30 --** -- ASCII String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 40 --** -- ASCII String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 50 --** -- ASCII String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 60 --** -- ASCII String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: iconv_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/intl/tests/breakiter_getPartsIterator_error.phpt b/ext/intl/tests/breakiter_getPartsIterator_error.phpt index f1a5c18c825a..f14bdadb3e48 100644 --- a/ext/intl/tests/breakiter_getPartsIterator_error.phpt +++ b/ext/intl/tests/breakiter_getPartsIterator_error.phpt @@ -10,9 +10,9 @@ $it = IntlBreakIterator::createWordInstance(NULL); try { var_dump($it->getPartsIterator(-1)); } catch(\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlBreakIterator::getPartsIterator(): Argument #1 ($type) must be one of IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, or IntlPartsIterator::KEY_RIGHT +ValueError: IntlBreakIterator::getPartsIterator(): Argument #1 ($type) must be one of IntlPartsIterator::KEY_SEQUENTIAL, IntlPartsIterator::KEY_LEFT, or IntlPartsIterator::KEY_RIGHT diff --git a/ext/intl/tests/bug48227.phpt b/ext/intl/tests/bug48227.phpt index 8371a872eaee..b9a9eddc2288 100644 --- a/ext/intl/tests/bug48227.phpt +++ b/ext/intl/tests/bug48227.phpt @@ -10,15 +10,15 @@ foreach (['', 1, NULL, $x] as $value) { try { var_dump($x->format($value)); } catch (TypeError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } } ?> --EXPECTF-- -NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given +TypeError: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, string given string(1) "1" Deprecated: NumberFormatter::format(): Passing null to parameter #1 ($num) of type int|float is deprecated in %s on line %d string(1) "0" -NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given +TypeError: NumberFormatter::format(): Argument #1 ($num) must be of type int|float, NumberFormatter given diff --git a/ext/intl/tests/bug61487.phpt b/ext/intl/tests/bug61487.phpt index c31738d29b9a..f60b7fb15f2a 100644 --- a/ext/intl/tests/bug61487.phpt +++ b/ext/intl/tests/bug61487.phpt @@ -10,15 +10,15 @@ intl try { grapheme_stripos(1,1,2147483648); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { grapheme_strpos(1,1,2147483648); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/intl/tests/bug62083.phpt b/ext/intl/tests/bug62083.phpt index cedab74d43a0..4c46a74e4252 100644 --- a/ext/intl/tests/bug62083.phpt +++ b/ext/intl/tests/bug62083.phpt @@ -8,8 +8,8 @@ $arr1 = array(); try { grapheme_extract(-1, -1, -1,-1, $arr1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS +ValueError: grapheme_extract(): Argument #3 ($type) must be one of GRAPHEME_EXTR_COUNT, GRAPHEME_EXTR_MAXBYTES, or GRAPHEME_EXTR_MAXCHARS diff --git a/ext/intl/tests/bug74063.phpt b/ext/intl/tests/bug74063.phpt index b563dea40117..d7fa4e207884 100644 --- a/ext/intl/tests/bug74063.phpt +++ b/ext/intl/tests/bug74063.phpt @@ -8,8 +8,8 @@ $formatter = new NumberFormatter("en_GB", NumberFormatter::CURRENCY); try { serialize($formatter); } catch (Exception $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -Serialization of 'NumberFormatter' is not allowed +Exception: Serialization of 'NumberFormatter' is not allowed diff --git a/ext/intl/tests/calendar_clear_error.phpt b/ext/intl/tests/calendar_clear_error.phpt index 8f1695564e94..c1760ce65167 100644 --- a/ext/intl/tests/calendar_clear_error.phpt +++ b/ext/intl/tests/calendar_clear_error.phpt @@ -10,15 +10,15 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->clear(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_clear($c, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::clear(): Argument #1 ($field) must be a valid field -intlcal_clear(): Argument #2 ($field) must be a valid field +ValueError: IntlCalendar::clear(): Argument #1 ($field) must be a valid field +ValueError: intlcal_clear(): Argument #2 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_createInstance_error.phpt b/ext/intl/tests/calendar_createInstance_error.phpt index 28ade19b8fc8..54e8c5afc920 100644 --- a/ext/intl/tests/calendar_createInstance_error.phpt +++ b/ext/intl/tests/calendar_createInstance_error.phpt @@ -12,8 +12,8 @@ function __construct() {} try { intlcal_create_instance(new X, NULL); } catch (IntlException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -intlcal_create_instance(): passed IntlTimeZone is not properly constructed +IntlException: intlcal_create_instance(): passed IntlTimeZone is not properly constructed diff --git a/ext/intl/tests/calendar_getDayOfWeekType_error.phpt b/ext/intl/tests/calendar_getDayOfWeekType_error.phpt index fdea44c17fa8..8725ca146be0 100644 --- a/ext/intl/tests/calendar_getDayOfWeekType_error.phpt +++ b/ext/intl/tests/calendar_getDayOfWeekType_error.phpt @@ -9,9 +9,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->getDayOfWeekType(0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week +ValueError: IntlCalendar::getDayOfWeekType(): Argument #1 ($dayOfWeek) must be a valid day of the week diff --git a/ext/intl/tests/calendar_getWeekendTransition_error.phpt b/ext/intl/tests/calendar_getWeekendTransition_error.phpt index a5e020a6803a..bf15eae336da 100644 --- a/ext/intl/tests/calendar_getWeekendTransition_error.phpt +++ b/ext/intl/tests/calendar_getWeekendTransition_error.phpt @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->getWeekendTransition(0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week +ValueError: IntlCalendar::getWeekendTransition(): Argument #1 ($dayOfWeek) must be a valid day of the week diff --git a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt index 30365162820c..23634db6bf9c 100644 --- a/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt +++ b/ext/intl/tests/calendar_get_Least_Greatest_Minimum_Maximum_error.phpt @@ -10,52 +10,52 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->getLeastMaximum(-1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->getMaximum(-1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->getGreatestMinimum(-1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->getMinimum(-1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_least_maximum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_maximum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_greatest_minimum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_minimum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ValueError: 0, IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field -ValueError: 0, IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field -ValueError: 0, IntlCalendar::getGreatestMinimum(): Argument #1 ($field) must be a valid field -ValueError: 0, IntlCalendar::getMinimum(): Argument #1 ($field) must be a valid field -ValueError: 0, intlcal_get_least_maximum(): Argument #2 ($field) must be a valid field -ValueError: 0, intlcal_get_maximum(): Argument #2 ($field) must be a valid field -ValueError: 0, intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field -ValueError: 0, intlcal_get_minimum(): Argument #2 ($field) must be a valid field +ValueError: 0: IntlCalendar::getLeastMaximum(): Argument #1 ($field) must be a valid field +ValueError: 0: IntlCalendar::getMaximum(): Argument #1 ($field) must be a valid field +ValueError: 0: IntlCalendar::getGreatestMinimum(): Argument #1 ($field) must be a valid field +ValueError: 0: IntlCalendar::getMinimum(): Argument #1 ($field) must be a valid field +ValueError: 0: intlcal_get_least_maximum(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get_maximum(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get_greatest_minimum(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get_minimum(): Argument #2 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt index 475c06402225..908da9047c36 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error.phpt @@ -10,21 +10,21 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->get(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->getActualMaximum(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->getActualMinimum(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::get(): Argument #1 ($field) must be a valid field -IntlCalendar::getActualMaximum(): Argument #1 ($field) must be a valid field -IntlCalendar::getActualMinimum(): Argument #1 ($field) must be a valid field +ValueError: IntlCalendar::get(): Argument #1 ($field) must be a valid field +ValueError: IntlCalendar::getActualMaximum(): Argument #1 ($field) must be a valid field +ValueError: IntlCalendar::getActualMinimum(): Argument #1 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt index 10eb7f8029b8..0d87e2d1a756 100644 --- a/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt +++ b/ext/intl/tests/calendar_get_getActualMaximum_Minumum_error2.phpt @@ -10,21 +10,21 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump(intlcal_get($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_actual_maximum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_get_actual_minimum($c, -1)); } catch (Error $e) { - echo get_class($e) . ': ' . $e->getCode() . ', ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getCode(), ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ValueError: 0, intlcal_get(): Argument #2 ($field) must be a valid field -ValueError: 0, intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field -ValueError: 0, intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get_actual_maximum(): Argument #2 ($field) must be a valid field +ValueError: 0: intlcal_get_actual_minimum(): Argument #2 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_isSet_error.phpt b/ext/intl/tests/calendar_isSet_error.phpt index 7f289f073ae0..cde6efa7ea2a 100644 --- a/ext/intl/tests/calendar_isSet_error.phpt +++ b/ext/intl/tests/calendar_isSet_error.phpt @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->isSet(-1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::isSet(): Argument #1 ($field) must be a valid field +ValueError: IntlCalendar::isSet(): Argument #1 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_roll_error.phpt b/ext/intl/tests/calendar_roll_error.phpt index 4c05c17a5f81..cfad2e10d215 100644 --- a/ext/intl/tests/calendar_roll_error.phpt +++ b/ext/intl/tests/calendar_roll_error.phpt @@ -10,9 +10,9 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->roll(-1, 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::roll(): Argument #1 ($field) must be a valid field +ValueError: IntlCalendar::roll(): Argument #1 ($field) must be a valid field diff --git a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt index 6e85207f28d7..d695b66282d9 100644 --- a/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt +++ b/ext/intl/tests/calendar_setFirstDayOfWeek_error.phpt @@ -12,16 +12,16 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->setFirstDayOfWeek(0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_set_first_day_of_week($c, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week -intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week +ValueError: IntlCalendar::setFirstDayOfWeek(): Argument #1 ($dayOfWeek) must be a valid day of the week +ValueError: intlcal_set_first_day_of_week(): Argument #2 ($dayOfWeek) must be a valid day of the week diff --git a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt index dc3bbc9f3ace..fc66632da305 100644 --- a/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt +++ b/ext/intl/tests/calendar_setMinimalDaysInFirstWeek_error.phpt @@ -10,16 +10,16 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->setMinimalDaysInFirstWeek(0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_set_minimal_days_in_first_week($c, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7 -intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7 +ValueError: IntlCalendar::setMinimalDaysInFirstWeek(): Argument #1 ($days) must be between 1 and 7 +ValueError: intlcal_set_minimal_days_in_first_week(): Argument #2 ($days) must be between 1 and 7 diff --git a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt index 8019c81870da..26faba5bc63e 100644 --- a/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt +++ b/ext/intl/tests/calendar_setSkipped_RepeatedWallTimeOption_error.phpt @@ -10,15 +10,15 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { var_dump($c->setSkippedWallTimeOption(3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($c->setRepeatedWallTimeOption(2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID -IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST +ValueError: IntlCalendar::setSkippedWallTimeOption(): Argument #1 ($option) must be one of IntlCalendar::WALLTIME_FIRST, IntlCalendar::WALLTIME_LAST, or IntlCalendar::WALLTIME_NEXT_VALID +ValueError: IntlCalendar::setRepeatedWallTimeOption(): Argument #1 ($option) must be either IntlCalendar::WALLTIME_FIRST or IntlCalendar::WALLTIME_LAST diff --git a/ext/intl/tests/calendar_set_date_out_of_bounds.phpt b/ext/intl/tests/calendar_set_date_out_of_bounds.phpt index db9d18275ae8..b63620e03a7a 100644 --- a/ext/intl/tests/calendar_set_date_out_of_bounds.phpt +++ b/ext/intl/tests/calendar_set_date_out_of_bounds.phpt @@ -11,22 +11,22 @@ $cal = IntlCalendar::createInstance(); try { $cal->setDate(99999999999, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDate(1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDate(1, 1, 99999999999); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IntlCalendar::setDate(): Argument #1 ($year) must be between -2147483648 and 2147483647 -IntlCalendar::setDate(): Argument #2 ($month) must be between -2147483648 and 2147483647 -IntlCalendar::setDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDate(): Argument #1 ($year) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDate(): Argument #2 ($month) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt b/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt index 798ab1ebb01f..6bfecc0d09b6 100644 --- a/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt +++ b/ext/intl/tests/calendar_set_date_time_out_of_bounds.phpt @@ -11,43 +11,43 @@ $cal = IntlCalendar::createInstance(); try { $cal->setDateTime(99999999999, 1, 1, 1, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDateTime(1, 99999999999, 1, 1, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDateTime(1, 1, 99999999999, 1, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDateTime(1, 1, 1, 99999999999, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDateTime(1, 1, 1, 1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->setDateTime(1, 1, 1, 1, 1, 99999999999); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IntlCalendar::setDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647 -IntlCalendar::setDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647 -IntlCalendar::setDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 -IntlCalendar::setDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647 -IntlCalendar::setDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647 -IntlCalendar::setDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::setDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/calendar_set_error.phpt b/ext/intl/tests/calendar_set_error.phpt index d29442f51950..9a57eed2eb43 100644 --- a/ext/intl/tests/calendar_set_error.phpt +++ b/ext/intl/tests/calendar_set_error.phpt @@ -10,35 +10,35 @@ $c = new IntlGregorianCalendar(NULL, 'pt_PT'); try { $c->set(1, 2, 3, 4, 5, 6, 7); } catch (ArgumentCountError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $c->set(1, 2, 3, 4); } catch (ArgumentCountError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump($c->set(-1, 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(intlcal_set($c, -1, 2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d -IntlCalendar::set() expects at most 6 arguments, 7 given +ArgumentCountError: IntlCalendar::set() expects at most 6 arguments, 7 given Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d -IntlCalendar::set() has no variant with exactly 4 parameters -IntlCalendar::set(): Argument #1 ($year) must be a valid field +ArgumentCountError: IntlCalendar::set() has no variant with exactly 4 parameters +ValueError: IntlCalendar::set(): Argument #1 ($year) must be a valid field Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d -intlcal_set(): Argument #2 ($year) must be a valid field +ValueError: intlcal_set(): Argument #2 ($year) must be a valid field diff --git a/ext/intl/tests/calendar_set_out_of_bounds.phpt b/ext/intl/tests/calendar_set_out_of_bounds.phpt index 1ca407d3f713..be246dcaf3ca 100644 --- a/ext/intl/tests/calendar_set_out_of_bounds.phpt +++ b/ext/intl/tests/calendar_set_out_of_bounds.phpt @@ -11,45 +11,45 @@ $cal = IntlCalendar::createInstance(); try { $cal->set(99999999999, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { intlcal_set($cal, 1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->set(1, 1, 1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cal->set(1, 1, 1, 1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { intlcal_set($cal, 1, 1, 1, 1, 1, 99999999999); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d -IntlCalendar::set(): Argument #1 ($year) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::set(): Argument #1 ($year) must be between -2147483648 and 2147483647 Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d -intlcal_set(): Argument #3 ($month) must be between -2147483648 and 2147483647 +ValueError: intlcal_set(): Argument #3 ($month) must be between -2147483648 and 2147483647 Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d -IntlCalendar::set(): Argument #4 ($hour) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::set(): Argument #4 ($hour) must be between -2147483648 and 2147483647 Deprecated: Calling IntlCalendar::set() with more than 2 arguments is deprecated, use either IntlCalendar::setDate() or IntlCalendar::setDateTime() instead in %s on line %d -IntlCalendar::set(): Argument #5 ($minute) must be between -2147483648 and 2147483647 +ValueError: IntlCalendar::set(): Argument #5 ($minute) must be between -2147483648 and 2147483647 Deprecated: Function intlcal_set() is deprecated since 8.4, use IntlCalendar::set(), IntlCalendar::setDate(), or IntlCalendar::setDateTime() instead in %s on line %d -intlcal_set(): Argument #7 ($second) must be between -2147483648 and 2147483647 +ValueError: intlcal_set(): Argument #7 ($second) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/calendar_uninitialized_argument_position.phpt b/ext/intl/tests/calendar_uninitialized_argument_position.phpt index f92367180549..115fecbfa47d 100644 --- a/ext/intl/tests/calendar_uninitialized_argument_position.phpt +++ b/ext/intl/tests/calendar_uninitialized_argument_position.phpt @@ -12,7 +12,7 @@ foreach (['equals', 'before', 'after', 'isEquivalentTo'] as $method) { try { $calendar->$method($uninitialized); } catch (Error $e) { - echo $method, ': ', $e->getMessage(), PHP_EOL; + echo $method, ': ', $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -20,17 +20,17 @@ foreach (['intlcal_equals', 'intlcal_before', 'intlcal_after', 'intlcal_is_equiv try { $function($calendar, $uninitialized); } catch (Error $e) { - echo $function, ': ', $e->getMessage(), PHP_EOL; + echo $function, ': ', $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -equals: IntlCalendar::equals(): Argument #1 ($other) is uninitialized -before: IntlCalendar::before(): Argument #1 ($other) is uninitialized -after: IntlCalendar::after(): Argument #1 ($other) is uninitialized -isEquivalentTo: IntlCalendar::isEquivalentTo(): Argument #1 ($other) is uninitialized -intlcal_equals: intlcal_equals(): Argument #2 ($other) is uninitialized -intlcal_before: intlcal_before(): Argument #2 ($other) is uninitialized -intlcal_after: intlcal_after(): Argument #2 ($other) is uninitialized -intlcal_is_equivalent_to: intlcal_is_equivalent_to(): Argument #2 ($other) is uninitialized +equals: Error: IntlCalendar::equals(): Argument #1 ($other) is uninitialized +before: Error: IntlCalendar::before(): Argument #1 ($other) is uninitialized +after: Error: IntlCalendar::after(): Argument #1 ($other) is uninitialized +isEquivalentTo: Error: IntlCalendar::isEquivalentTo(): Argument #1 ($other) is uninitialized +intlcal_equals: Error: intlcal_equals(): Argument #2 ($other) is uninitialized +intlcal_before: Error: intlcal_before(): Argument #2 ($other) is uninitialized +intlcal_after: Error: intlcal_after(): Argument #2 ($other) is uninitialized +intlcal_is_equivalent_to: Error: intlcal_is_equivalent_to(): Argument #2 ($other) is uninitialized diff --git a/ext/intl/tests/collator_double_ctor.phpt b/ext/intl/tests/collator_double_ctor.phpt index 93b72f7392b3..f77642a9c876 100644 --- a/ext/intl/tests/collator_double_ctor.phpt +++ b/ext/intl/tests/collator_double_ctor.phpt @@ -9,8 +9,8 @@ $collator = new Collator('en_US'); try { $collator->__construct('en_US'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Collator object is already constructed +Error: Collator object is already constructed diff --git a/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt b/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt index 5c3d03cd4f65..adb45efad503 100644 --- a/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt +++ b/ext/intl/tests/datefmt_parse_localtime_offset_type_error.phpt @@ -12,33 +12,33 @@ $offset = 'offset'; try { $fmt->parse('America/Los_Angeles', $offset); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $offset = 'offset'; try { datefmt_parse($fmt, 'America/Los_Angeles', $offset); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $offset = 'offset'; try { $fmt->localtime('America/Los_Angeles', $offset); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $offset = 'offset'; try { datefmt_localtime($fmt, 'America/Los_Angeles', $offset); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlDateFormatter::parse(): Argument #2 ($offset) must be of type int, string given -datefmt_parse(): Argument #3 ($offset) must be of type int, string given -IntlDateFormatter::localtime(): Argument #2 ($offset) must be of type int, string given -datefmt_localtime(): Argument #3 ($offset) must be of type int, string given +TypeError: IntlDateFormatter::parse(): Argument #2 ($offset) must be of type int, string given +TypeError: datefmt_parse(): Argument #3 ($offset) must be of type int, string given +TypeError: IntlDateFormatter::localtime(): Argument #2 ($offset) must be of type int, string given +TypeError: datefmt_localtime(): Argument #3 ($offset) must be of type int, string given diff --git a/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt index e33464a40a44..480074dbd822 100644 --- a/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt +++ b/ext/intl/tests/dateformat___construct_bad_tz_cal.phpt @@ -25,4 +25,3 @@ try { IntlException: IntlDateFormatter::__construct(): No such time zone: "bad timezone" IntlException: IntlDateFormatter::__construct(): Invalid value for calendar type; it must be one of IntlDateFormatter::TRADITIONAL (locale's default calendar) or IntlDateFormatter::GREGORIAN. Alternatively, it can be an IntlCalendar object TypeError: IntlDateFormatter::__construct(): Argument #5 ($calendar) must be of type IntlCalendar|int|null, stdClass given - diff --git a/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt b/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt index d34c93bfb369..b2b4cbf9030c 100644 --- a/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt +++ b/ext/intl/tests/dateformat_get_set_calendar_variant_icu70.phpt @@ -52,4 +52,3 @@ dimanche 1 janvier 2012 ap. J.-C. à 00:00:00 temps universel coordonné bool(false) string(9) "gregorian" string(3) "UTC" - diff --git a/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt b/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt index 428e67fc24e3..8c5d9c32961b 100644 --- a/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt +++ b/ext/intl/tests/dateformat_get_set_timezone_variant5.phpt @@ -55,4 +55,3 @@ string(12) "Europe/Paris" domingo, 1 de janeiro de 2012 às 01:00:00 Hor%s padrão %Sda Europa Central string(16) "Europe/Amsterdam" string(16) "Europe/Amsterdam" - diff --git a/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt b/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt index 6424ba1e6b40..c26327c1f9d5 100644 --- a/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt +++ b/ext/intl/tests/dateformat_set_timezone_id_icu72-1.phpt @@ -37,7 +37,7 @@ function ut_main() try { ut_datefmt_set_timezone_id( $fmt , $timezone_id_entry ); } catch (IntlException $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $timezone_id = ut_datefmt_get_timezone_id( $fmt ); $res_str .= "\nAfter call to set_timezone_id : timezone_id= $timezone_id"; diff --git a/ext/intl/tests/formatter_format_and_parse_errors.phpt b/ext/intl/tests/formatter_format_and_parse_errors.phpt index e2d1cde89133..a99df84f7242 100644 --- a/ext/intl/tests/formatter_format_and_parse_errors.phpt +++ b/ext/intl/tests/formatter_format_and_parse_errors.phpt @@ -13,61 +13,61 @@ $str = "string"; try { numfmt_format($o, $num, -20); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->format($num, -20); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { numfmt_parse($o, $str, -20); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->parse($str, -20); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* With NumberFormatter::TYPE_CURRENCY */ try { numfmt_format($o, $num, NumberFormatter::TYPE_CURRENCY); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->format($num, NumberFormatter::TYPE_CURRENCY); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { numfmt_parse($o, $str, NumberFormatter::TYPE_CURRENCY); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->parse($str, NumberFormatter::TYPE_CURRENCY); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant -NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant -numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant -NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant +ValueError: numfmt_format(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant +ValueError: NumberFormatter::format(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant +ValueError: numfmt_parse(): Argument #3 ($type) must be a NumberFormatter::TYPE_* constant +ValueError: NumberFormatter::parse(): Argument #2 ($type) must be a NumberFormatter::TYPE_* constant Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d -numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead +ValueError: numfmt_format(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_format_currency() function instead Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d -NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead +ValueError: NumberFormatter::format(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::formatCurrency() method instead Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d -numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead +ValueError: numfmt_parse(): Argument #3 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use numfmt_parse_currency() function instead Deprecated: Constant NumberFormatter::TYPE_CURRENCY is deprecated since 8.3 in %s on line %d -NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead +ValueError: NumberFormatter::parse(): Argument #2 ($type) cannot be NumberFormatter::TYPE_CURRENCY constant, use NumberFormatter::parseCurrency() method instead diff --git a/ext/intl/tests/formatter_format_decimal_compact.phpt b/ext/intl/tests/formatter_format_decimal_compact.phpt index 2c78f8787e0f..cb2d88f1181c 100644 --- a/ext/intl/tests/formatter_format_decimal_compact.phpt +++ b/ext/intl/tests/formatter_format_decimal_compact.phpt @@ -54,4 +54,4 @@ uk: long = 1,2 мільйона en: short = 1.2M en: long = 1.2 million bg: short = 1,2 млн. -bg: long = 1,2 милиона \ No newline at end of file +bg: long = 1,2 милиона diff --git a/ext/intl/tests/gh12243.phpt b/ext/intl/tests/gh12243.phpt index 324ed9a65661..b1b1014c5d8f 100644 --- a/ext/intl/tests/gh12243.phpt +++ b/ext/intl/tests/gh12243.phpt @@ -16,9 +16,9 @@ try { timezone: $datetime->getTimezone(), ); } catch (\IntlException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlDateFormatter::__construct(): datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN +IntlException: IntlDateFormatter::__construct(): datefmt_create: time format must be IntlDateFormatter::PATTERN if date format is IntlDateFormatter::PATTERN diff --git a/ext/intl/tests/gh12282.phpt b/ext/intl/tests/gh12282.phpt index b12dc655f705..421e6abb188d 100644 --- a/ext/intl/tests/gh12282.phpt +++ b/ext/intl/tests/gh12282.phpt @@ -15,15 +15,15 @@ try { 'w' ); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } Locale::setDefault('xx'); try { new IntlDateFormatter(Locale::getDefault()); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --EXPECT-- -IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid -IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid +ValueError: IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid +ValueError: IntlDateFormatter::__construct(): Argument #1 ($locale) "xx" is invalid diff --git a/ext/intl/tests/gh12727.phpt b/ext/intl/tests/gh12727.phpt index e04b5eb26a12..61746a9374b7 100644 --- a/ext/intl/tests/gh12727.phpt +++ b/ext/intl/tests/gh12727.phpt @@ -8,8 +8,8 @@ intl try { new NumberFormatter('xx', NumberFormatter::DECIMAL); } catch (ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -NumberFormatter::__construct(): Argument #1 ($locale) "%s" is invalid +ValueError: NumberFormatter::__construct(): Argument #1 ($locale) "%s" is invalid diff --git a/ext/intl/tests/gh13766.phpt b/ext/intl/tests/gh13766.phpt index 9ed8d985de47..f9119c4abc0b 100644 --- a/ext/intl/tests/gh13766.phpt +++ b/ext/intl/tests/gh13766.phpt @@ -17,19 +17,19 @@ $offset3 = "offset"; try { $oIntlDateFormatter->parseToCalendar('America/Los_Angeles', $offset3); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $offset3 = PHP_INT_MAX * 16; try { $oIntlDateFormatter->parseToCalendar('America/Los_Angeles', $offset3); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --EXPECTF-- int(%d) string(13) "Europe/Berlin" int(%d) string(19) "America/Los_Angeles" -IntlDateFormatter::parseToCalendar(): Argument #2 ($offset) must be of type int, string given +TypeError: IntlDateFormatter::parseToCalendar(): Argument #2 ($offset) must be of type int, string given Warning: The float %r(1\.4757395258967641E\+20|34359738352)%r is not representable as an int, cast occurred in %s on line %d diff --git a/ext/intl/tests/gh17469.phpt b/ext/intl/tests/gh17469.phpt index 5a2263684422..13108a7a140f 100644 --- a/ext/intl/tests/gh17469.phpt +++ b/ext/intl/tests/gh17469.phpt @@ -19,12 +19,12 @@ ini_set("intl.use_exceptions", 1); try { UConverter::transcode("\x0a", 'nein!!', 'UTF-8'); } catch (IntlException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { UConverter::transcode("\x0a", 'UTF-16BE', 'da!'); } catch (IntlException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -33,5 +33,5 @@ Deprecated: ini_set(): Using a value different than 0 for intl.error_level is de Warning: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR in %s on line %d Warning: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR in %s on line %d -UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR -UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR +IntlException: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR +IntlException: UConverter::transcode(): Error setting encoding: 4 - U_FILE_ACCESS_ERROR diff --git a/ext/intl/tests/grapheme_levenshtein.phpt b/ext/intl/tests/grapheme_levenshtein.phpt index 37978f422363..5c8bce5d5d50 100644 --- a/ext/intl/tests/grapheme_levenshtein.phpt +++ b/ext/intl/tests/grapheme_levenshtein.phpt @@ -74,19 +74,19 @@ echo '--- Corner case ---' . PHP_EOL; try { grapheme_levenshtein($nabe, $nabe_E0100, 0, 1, 1); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { grapheme_levenshtein($nabe, $nabe_E0100, 1, 0, 1); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { grapheme_levenshtein($nabe, $nabe_E0100, 1, 1, 0); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "--- Invalid locales ---\n"; @@ -138,9 +138,9 @@ int(0) int(1) int(0) --- Corner case --- -grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to %d -grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to %d -grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to %d +ValueError: grapheme_levenshtein(): Argument #3 ($insertion_cost) must be greater than 0 and less than or equal to %d +ValueError: grapheme_levenshtein(): Argument #4 ($replacement_cost) must be greater than 0 and less than or equal to %d +ValueError: grapheme_levenshtein(): Argument #5 ($deletion_cost) must be greater than 0 and less than or equal to %d --- Invalid locales --- bool(false) int(%d) diff --git a/ext/intl/tests/grapheme_out_of_bounds.phpt b/ext/intl/tests/grapheme_out_of_bounds.phpt index 286cb68b7d34..0279a9d1ef76 100644 --- a/ext/intl/tests/grapheme_out_of_bounds.phpt +++ b/ext/intl/tests/grapheme_out_of_bounds.phpt @@ -38,42 +38,42 @@ echo "\n"; try { var_dump(grapheme_strpos("foo", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("foo", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("foo", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("foo", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strpos("äöü", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("äöü", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("äöü", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("äöü", "bar", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -81,42 +81,42 @@ echo "\n"; try { var_dump(grapheme_strpos("foo", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("foo", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("foo", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("foo", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strpos("äöü", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("äöü", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("äöü", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("äöü", "bar", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -124,42 +124,42 @@ echo "\n"; try { var_dump(grapheme_strpos("äöü", "", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("äöü", "", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("äöü", "", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("äöü", "", 4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strpos("äöü", "", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_stripos("äöü", "", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strrpos("äöü", "", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(grapheme_strripos("äöü", "", -4)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -208,32 +208,32 @@ bool(false) bool(false) bool(false) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: grapheme_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) string(0) "" string(3) "foo" diff --git a/ext/intl/tests/gregoriancalendar___construct_error.phpt b/ext/intl/tests/gregoriancalendar___construct_error.phpt index 6922b7cadd8c..b8459ef5d10b 100644 --- a/ext/intl/tests/gregoriancalendar___construct_error.phpt +++ b/ext/intl/tests/gregoriancalendar___construct_error.phpt @@ -8,49 +8,49 @@ intl try { var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(intlgregcal_create_instance(1,2,3,4,5,6,7,8)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(intlgregcal_create_instance(1,2,3,4)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new IntlGregorianCalendar(1,2,NULL,4)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new IntlGregorianCalendar(1,2,3,4,5,array())); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $cal = new IntlGregorianCalendar(); try { $cal->__construct(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -Too many arguments +ArgumentCountError: Too many arguments Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -Too many arguments +ArgumentCountError: Too many arguments Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -No variant with 4 arguments (excluding trailing NULLs) +ArgumentCountError: No variant with 4 arguments (excluding trailing NULLs) Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -No variant with 4 arguments (excluding trailing NULLs) +ArgumentCountError: No variant with 4 arguments (excluding trailing NULLs) Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given -IntlGregorianCalendar object is already constructed +TypeError: IntlGregorianCalendar::__construct(): Argument #6 ($second) must be of type int, array given +Error: IntlGregorianCalendar object is already constructed diff --git a/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt b/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt index 5b084b25d869..f2d2e2611bf3 100644 --- a/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt +++ b/ext/intl/tests/gregoriancalendar___construct_out_of_bounds.phpt @@ -9,45 +9,45 @@ intl try { new IntlGregorianCalendar(99999999999, 1, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { intlgregcal_create_instance(1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new IntlGregorianCalendar(1, 1, 1, 99999999999, 1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new IntlGregorianCalendar(1, 1, 1, 1, 99999999999); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { intlgregcal_create_instance(1, 1, 1, 1, 1, 99999999999); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -IntlGregorianCalendar::__construct(): Argument #1 ($timezoneOrYear) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::__construct(): Argument #1 ($timezoneOrYear) must be between -2147483648 and 2147483647 Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -intlgregcal_create_instance(): Argument #2 ($localeOrMonth) must be between -2147483648 and 2147483647 +ValueError: intlgregcal_create_instance(): Argument #2 ($localeOrMonth) must be between -2147483648 and 2147483647 Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -IntlGregorianCalendar::__construct(): Argument #4 ($hour) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::__construct(): Argument #4 ($hour) must be between -2147483648 and 2147483647 Deprecated: Calling IntlGregorianCalendar::__construct() with more than 2 arguments is deprecated, use either IntlGregorianCalendar::createFromDate() or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -IntlGregorianCalendar::__construct(): Argument #5 ($minute) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::__construct(): Argument #5 ($minute) must be between -2147483648 and 2147483647 Deprecated: Function intlgregcal_create_instance() is deprecated since 8.4, use IntlGregorianCalendar::__construct(), IntlGregorianCalendar::createFromDate(), or IntlGregorianCalendar::createFromDateTime() instead in %s on line %d -intlgregcal_create_instance(): Argument #6 ($second) must be between -2147483648 and 2147483647 +ValueError: intlgregcal_create_instance(): Argument #6 ($second) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/gregoriancalendar_set_date_error.phpt b/ext/intl/tests/gregoriancalendar_set_date_error.phpt index 154f598d8dff..9c2c0da0361c 100644 --- a/ext/intl/tests/gregoriancalendar_set_date_error.phpt +++ b/ext/intl/tests/gregoriancalendar_set_date_error.phpt @@ -9,23 +9,23 @@ intl try { var_dump(IntlGregorianCalendar::createFromDate(99999999999, 1, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDate(1, 99999999999, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDate(1, 1, 99999999999)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IntlGregorianCalendar::createFromDate(): Argument #1 ($year) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDate(): Argument #2 ($month) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDate(): Argument #1 ($year) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDate(): Argument #2 ($month) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDate(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt b/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt index 4fcfa4a1ffbc..2d5a67aafc0a 100644 --- a/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt +++ b/ext/intl/tests/gregoriancalendar_set_date_time_error.phpt @@ -9,44 +9,44 @@ intl try { var_dump(IntlGregorianCalendar::createFromDateTime(99999999999, 1, 1, 1, 1, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDateTime(1, 99999999999, 1, 1, 1, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 99999999999, 1, 1, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 99999999999, 1, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 1, 99999999999, 1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(IntlGregorianCalendar::createFromDateTime(1, 1, 1, 1, 1, 99999999999)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IntlGregorianCalendar::createFromDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647 -IntlGregorianCalendar::createFromDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #1 ($year) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #2 ($month) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #3 ($dayOfMonth) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #4 ($hour) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #5 ($minute) must be between -2147483648 and 2147483647 +ValueError: IntlGregorianCalendar::createFromDateTime(): Argument #6 ($second) must be between -2147483648 and 2147483647 diff --git a/ext/intl/tests/ini_use_exceptions_basic.phpt b/ext/intl/tests/ini_use_exceptions_basic.phpt index e03c991ae05f..710da8ddc4e0 100644 --- a/ext/intl/tests/ini_use_exceptions_basic.phpt +++ b/ext/intl/tests/ini_use_exceptions_basic.phpt @@ -9,14 +9,14 @@ $t = transliterator_create('any-hex'); try { var_dump($t->transliterate('a', 3)); } catch (IntlException $intlE) { - var_dump($intlE->getMessage()); + echo $intlE::class, ': ', $intlE->getMessage(), "\n"; } ini_set("intl.use_exceptions", false); ini_set("intl.error_level", E_NOTICE); var_dump($t->transliterate('a', 3)); ?> --EXPECTF-- -string(133) "Transliterator::transliterate(): Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1)" +IntlException: Transliterator::transliterate(): Neither "start" nor the "end" arguments can exceed the number of UTF-16 code units (in this case, 1) Deprecated: ini_set(): Using a value different than 0 for intl.error_level is deprecated, as the intl.error_level INI setting is deprecated. Instead the intl.use_exceptions INI setting should be enabled to throw exceptions on errors or intl_get_error_code()/intl_get_error_message() should be used to manually deal with errors in %s on line %d diff --git a/ext/intl/tests/listformatter/listformatter_clone.phpt b/ext/intl/tests/listformatter/listformatter_clone.phpt index ce7ce99aef45..e80fd4ff4981 100644 --- a/ext/intl/tests/listformatter/listformatter_clone.phpt +++ b/ext/intl/tests/listformatter/listformatter_clone.phpt @@ -14,8 +14,8 @@ $formatter = new IntlListFormatter('en_US', IntlListFormatter::TYPE_AND, IntlLis try { $clonedFormatter = clone $formatter; } catch(Error $error) { - echo $error->getMessage(); + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } ?> --EXPECT-- -Trying to clone an uncloneable object of class IntlListFormatter +Error: Trying to clone an uncloneable object of class IntlListFormatter diff --git a/ext/intl/tests/listformatter/listformatter_double_ctor.phpt b/ext/intl/tests/listformatter/listformatter_double_ctor.phpt index f8b0ca1e1633..443326b5e54d 100644 --- a/ext/intl/tests/listformatter/listformatter_double_ctor.phpt +++ b/ext/intl/tests/listformatter/listformatter_double_ctor.phpt @@ -9,8 +9,8 @@ $formatter = new IntlListFormatter('en_US'); try { $formatter->__construct('en_US'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IntlListFormatter object is already constructed +Error: IntlListFormatter object is already constructed diff --git a/ext/intl/tests/listformatter/listformatter_error.phpt b/ext/intl/tests/listformatter/listformatter_error.phpt index 4ca22136943e..db065456d02c 100644 --- a/ext/intl/tests/listformatter/listformatter_error.phpt +++ b/ext/intl/tests/listformatter/listformatter_error.phpt @@ -8,13 +8,13 @@ intl try { $formatter = new IntlListFormatter('f', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE); } catch(ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } try { $formatter = new IntlListFormatter('ro_thisiswaytooooooooooooooooooooooooooooooooooooooooooooolongtobevaliditneedstobeatleast157characterstofailthevalidationinthelistformattercodeimplementation', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE); } catch(ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } $formatter = new IntlListFormatter('ro', IntlListFormatter::TYPE_AND, IntlListFormatter::WIDTH_WIDE); @@ -22,17 +22,17 @@ $formatter = new IntlListFormatter('ro', IntlListFormatter::TYPE_AND, IntlListFo try { echo $formatter->format([new stdClass()]); } catch(Error $error) { - echo $error->getMessage() . PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { echo $formatter->format([1, 2, new stdClass(), 4]); } catch(Error $error) { - echo $error->getMessage() . PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlListFormatter::__construct(): Argument #1 ($locale) "f" is invalid -IntlListFormatter::__construct(): Argument #1 ($locale) must be less than or equal to 156 characters -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +ValueError: IntlListFormatter::__construct(): Argument #1 ($locale) "f" is invalid +ValueError: IntlListFormatter::__construct(): Argument #1 ($locale) must be less than or equal to 156 characters +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt b/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt index bfa75e7399bb..1ae3ba6c8d1d 100644 --- a/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt +++ b/ext/intl/tests/listformatter/listformatter_with_parameters_error.phpt @@ -10,17 +10,17 @@ intl try { $formatter = new IntlListFormatter('ro', 23232323); } catch(ValueError $exception) { - echo $exception->getMessage(); + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } -echo PHP_EOL; + try { $formatter = new IntlListFormatter('ro', IntlListFormatter::TYPE_AND, 2323232); } catch(ValueError $exception) { - echo $exception->getMessage(); + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlListFormatter::__construct(): Argument #2 ($type) must be one of IntlListFormatter::TYPE_AND, IntlListFormatter::TYPE_OR, or IntlListFormatter::TYPE_UNITS -IntlListFormatter::__construct(): Argument #3 ($width) must be one of IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT, or IntlListFormatter::WIDTH_NARROW +ValueError: IntlListFormatter::__construct(): Argument #2 ($type) must be one of IntlListFormatter::TYPE_AND, IntlListFormatter::TYPE_OR, or IntlListFormatter::TYPE_UNITS +ValueError: IntlListFormatter::__construct(): Argument #3 ($width) must be one of IntlListFormatter::WIDTH_WIDE, IntlListFormatter::WIDTH_SHORT, or IntlListFormatter::WIDTH_NARROW diff --git a/ext/intl/tests/locale_filter_matches_icu70.phpt b/ext/intl/tests/locale_filter_matches_icu70.phpt index 0e0b16af1760..cc7cb0c302f4 100644 --- a/ext/intl/tests/locale_filter_matches_icu70.phpt +++ b/ext/intl/tests/locale_filter_matches_icu70.phpt @@ -72,13 +72,13 @@ function ut_main() try { ut_loc_locale_filter_matches("de\0-DE", "de-DE", false); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ut_loc_locale_filter_matches("de-DE", "d\0e-DE", false); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $res_str .= "\n"; @@ -91,10 +91,10 @@ ut_run(); ?> --EXPECT-- -Locale::filterMatches(): Argument #1 ($languageTag) must not contain any null bytes -Locale::filterMatches(): Argument #2 ($locale) must not contain any null bytes -locale_filter_matches(): Argument #1 ($languageTag) must not contain any null bytes -locale_filter_matches(): Argument #2 ($locale) must not contain any null bytes +ValueError: Locale::filterMatches(): Argument #1 ($languageTag) must not contain any null bytes +ValueError: Locale::filterMatches(): Argument #2 ($locale) must not contain any null bytes +ValueError: locale_filter_matches(): Argument #1 ($languageTag) must not contain any null bytes +ValueError: locale_filter_matches(): Argument #2 ($locale) must not contain any null bytes -------------- loc_range:de-de matches lang_tag de-DEVA ? NO loc_range:de_DE canonically matches lang_tag de_Deva ? NO diff --git a/ext/intl/tests/locale_get_all_variants.phpt b/ext/intl/tests/locale_get_all_variants.phpt index 12bf82cacac0..ea2ebc432e02 100644 --- a/ext/intl/tests/locale_get_all_variants.phpt +++ b/ext/intl/tests/locale_get_all_variants.phpt @@ -42,7 +42,7 @@ function ut_main() try { ut_loc_locale_get_all_variants("i-\0tay"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $res_str .= "\n"; @@ -55,8 +55,8 @@ ut_run(); ?> --EXPECT-- -Locale::getAllVariants(): Argument #1 ($locale) must not contain any null bytes -locale_get_all_variants(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getAllVariants(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_all_variants(): Argument #1 ($locale) must not contain any null bytes sl_IT_nedis_KIRTI : variants 'NEDIS','KIRTI', sl_IT_nedis-a-kirti-x-xyz : variants 'NEDIS', sl_IT_rozaj : variants 'ROZAJ', diff --git a/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt b/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt index fe83ac1b731f..1f316787cd40 100644 --- a/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt +++ b/ext/intl/tests/locale_get_display_keyword_null_bytes.phpt @@ -19,7 +19,7 @@ function ut_main() try { $call(); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -28,13 +28,13 @@ include_once 'ut_common.inc'; ut_run(); ?> --EXPECT-- -Locale::getDisplayKeyword(): Argument #1 ($keyword) must not contain any null bytes -Locale::getDisplayKeyword(): Argument #2 ($displayLocale) must not contain any null bytes -Locale::getDisplayKeywordValue(): Argument #1 ($locale) must not contain any null bytes -Locale::getDisplayKeywordValue(): Argument #2 ($keyword) must not contain any null bytes -Locale::getDisplayKeywordValue(): Argument #3 ($displayLocale) must not contain any null bytes -locale_get_display_keyword(): Argument #1 ($keyword) must not contain any null bytes -locale_get_display_keyword(): Argument #2 ($displayLocale) must not contain any null bytes -locale_get_display_keyword_value(): Argument #1 ($locale) must not contain any null bytes -locale_get_display_keyword_value(): Argument #2 ($keyword) must not contain any null bytes -locale_get_display_keyword_value(): Argument #3 ($displayLocale) must not contain any null bytes +ValueError: Locale::getDisplayKeyword(): Argument #1 ($keyword) must not contain any null bytes +ValueError: Locale::getDisplayKeyword(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: Locale::getDisplayKeywordValue(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getDisplayKeywordValue(): Argument #2 ($keyword) must not contain any null bytes +ValueError: Locale::getDisplayKeywordValue(): Argument #3 ($displayLocale) must not contain any null bytes +ValueError: locale_get_display_keyword(): Argument #1 ($keyword) must not contain any null bytes +ValueError: locale_get_display_keyword(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: locale_get_display_keyword_value(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_display_keyword_value(): Argument #2 ($keyword) must not contain any null bytes +ValueError: locale_get_display_keyword_value(): Argument #3 ($displayLocale) must not contain any null bytes diff --git a/ext/intl/tests/locale_get_display_language4.phpt b/ext/intl/tests/locale_get_display_language4.phpt index 1273c4a99968..bf3c76709358 100644 --- a/ext/intl/tests/locale_get_display_language4.phpt +++ b/ext/intl/tests/locale_get_display_language4.phpt @@ -10,20 +10,20 @@ function ut_main() try { ut_loc_get_display_language("a-D\0E", "locale=a-DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ut_loc_get_display_language("a-DE", "locale=a\0-DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } include_once 'ut_common.inc'; ut_run(); ?> --EXPECT-- -Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes -Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes -locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes -locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: Locale::getDisplayLanguage(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getDisplayLanguage(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: locale_get_display_language(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_display_language(): Argument #2 ($displayLocale) must not contain any null bytes diff --git a/ext/intl/tests/locale_get_display_script4.phpt b/ext/intl/tests/locale_get_display_script4.phpt index 533052933026..c26b67a8d982 100644 --- a/ext/intl/tests/locale_get_display_script4.phpt +++ b/ext/intl/tests/locale_get_display_script4.phpt @@ -86,13 +86,13 @@ function ut_main() try { ut_loc_get_display_script("a-D\0E", "locale=a-DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ut_loc_get_display_script("a-DE", "locale=a\0-DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } return $res_str; @@ -104,10 +104,10 @@ ut_run(); ?> --EXPECT-- -Locale::getDisplayScript(): Argument #1 ($locale) must not contain any null bytes -Locale::getDisplayScript(): Argument #2 ($displayLocale) must not contain any null bytes -locale_get_display_script(): Argument #1 ($locale) must not contain any null bytes -locale_get_display_script(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: Locale::getDisplayScript(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getDisplayScript(): Argument #2 ($displayLocale) must not contain any null bytes +ValueError: locale_get_display_script(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_display_script(): Argument #2 ($displayLocale) must not contain any null bytes locale='uk-ua_CALIFORNIA@currency=;currency=GRN' disp_locale=en : display_script= disp_locale=fr : display_script= diff --git a/ext/intl/tests/locale_get_region.phpt b/ext/intl/tests/locale_get_region.phpt index 0c3c1655deb3..a6c26e899029 100644 --- a/ext/intl/tests/locale_get_region.phpt +++ b/ext/intl/tests/locale_get_region.phpt @@ -79,7 +79,7 @@ function ut_main() try { ut_loc_get_region("a-\0DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } return $res_str; @@ -91,8 +91,8 @@ ut_run(); ?> --EXPECTF-- -Locale::getRegion(): Argument #1 ($locale) must not contain any null bytes -locale_get_region(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getRegion(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_region(): Argument #1 ($locale) must not contain any null bytes uk-ua_CALIFORNIA@currency=;currency=GRN: region='UA' root: region='' uk@currency=EURO: region='' diff --git a/ext/intl/tests/locale_get_script.phpt b/ext/intl/tests/locale_get_script.phpt index 52e0a4155a97..efd67b2550e9 100644 --- a/ext/intl/tests/locale_get_script.phpt +++ b/ext/intl/tests/locale_get_script.phpt @@ -77,7 +77,7 @@ function ut_main() try { ut_loc_get_script("de\0-419-DE"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } return $res_str; @@ -89,8 +89,8 @@ ut_run(); ?> --EXPECT-- -Locale::getScript(): Argument #1 ($locale) must not contain any null bytes -locale_get_script(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::getScript(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_get_script(): Argument #1 ($locale) must not contain any null bytes uk-ua_CALIFORNIA@currency=;currency=GRN: script='' root: script='' uk@currency=EURO: script='' diff --git a/ext/intl/tests/locale_is_right_to_left.phpt b/ext/intl/tests/locale_is_right_to_left.phpt index c9e4323ff744..d1dfd1c50f67 100644 --- a/ext/intl/tests/locale_is_right_to_left.phpt +++ b/ext/intl/tests/locale_is_right_to_left.phpt @@ -11,7 +11,7 @@ var_dump(Locale::isRightToLeft("ar")); try { Locale::isRightToLeft("a\0r"); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -19,4 +19,4 @@ bool(false) bool(false) bool(false) bool(true) -Locale::isRightToLeft(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::isRightToLeft(): Argument #1 ($locale) must not contain any null bytes diff --git a/ext/intl/tests/locale_lookup_invalid_language_tag.phpt b/ext/intl/tests/locale_lookup_invalid_language_tag.phpt index 3ba48f61334b..2891617e2601 100644 --- a/ext/intl/tests/locale_lookup_invalid_language_tag.phpt +++ b/ext/intl/tests/locale_lookup_invalid_language_tag.phpt @@ -16,13 +16,13 @@ ini_set('intl.use_exceptions', '1'); try { Locale::lookup([''], 'de-DE', false, 'en-US'); } catch (IntlException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { locale_lookup([''], 'de-DE', false, 'en-US'); } catch (IntlException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -31,5 +31,5 @@ NULL string(75) "Locale::lookup(): unable to canonicalize lang_tag: U_ILLEGAL_ARGUMENT_ERROR" NULL string(74) "locale_lookup(): unable to canonicalize lang_tag: U_ILLEGAL_ARGUMENT_ERROR" -Locale::lookup(): unable to canonicalize lang_tag -locale_lookup(): unable to canonicalize lang_tag +IntlException: Locale::lookup(): unable to canonicalize lang_tag +IntlException: locale_lookup(): unable to canonicalize lang_tag diff --git a/ext/intl/tests/locale_lookup_variant3.phpt b/ext/intl/tests/locale_lookup_variant3.phpt index b13a54139f44..b2f3d4af7bb4 100644 --- a/ext/intl/tests/locale_lookup_variant3.phpt +++ b/ext/intl/tests/locale_lookup_variant3.phpt @@ -62,19 +62,19 @@ function ut_main() try { ut_loc_locale_lookup(["de\0-DE"], "de-DE", false, "en-US"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ut_loc_locale_lookup(["de-DE"], "de-D\0E", true, "en-US"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ut_loc_locale_lookup(["de-DE"], "de-DE", true, "e\0n-US"); } catch (\ValueError $e) { - echo $e->getMessage(). PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $res_str .= "\n"; @@ -87,12 +87,12 @@ ut_run(); ?> --EXPECT-- -Locale::lookup(): Argument #2 ($locale) must not contain any null bytes -Locale::lookup(): Argument #2 ($locale) must not contain any null bytes -Locale::lookup(): Argument #4 ($defaultLocale) must not contain any null bytes -locale_lookup(): Argument #2 ($locale) must not contain any null bytes -locale_lookup(): Argument #2 ($locale) must not contain any null bytes -locale_lookup(): Argument #4 ($defaultLocale) must not contain any null bytes +ValueError: Locale::lookup(): Argument #2 ($locale) must not contain any null bytes +ValueError: Locale::lookup(): Argument #2 ($locale) must not contain any null bytes +ValueError: Locale::lookup(): Argument #4 ($defaultLocale) must not contain any null bytes +ValueError: locale_lookup(): Argument #2 ($locale) must not contain any null bytes +ValueError: locale_lookup(): Argument #2 ($locale) must not contain any null bytes +ValueError: locale_lookup(): Argument #4 ($defaultLocale) must not contain any null bytes -------------- loc_range:de-de lang_tags: de-DEVA,de-DE-1996,de-DE,zh_Hans,de-CH-1996,sl_IT,sl_IT_nedis-a-kirti-x-xyz,sl_IT_rozaj,sl_IT_NEDIS_ROJAZ_1901,i-enochian,sgn-CH-de,art-lojban,i-lux,art-lojban,jbo,en_sl_IT,zh-Hant-CN-x-prv1-prv2 diff --git a/ext/intl/tests/locale_set_default.phpt b/ext/intl/tests/locale_set_default.phpt index 6108f370274b..c4aaf824bcab 100644 --- a/ext/intl/tests/locale_set_default.phpt +++ b/ext/intl/tests/locale_set_default.phpt @@ -89,7 +89,7 @@ function ut_main() try { ut_loc_set_default("a-\0DE"); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } return $res_str; @@ -101,8 +101,8 @@ ut_run(); ?> --EXPECT-- -Locale::setDefault(): Argument #1 ($locale) must not contain any null bytes -locale_set_default(): Argument #1 ($locale) must not contain any null bytes +ValueError: Locale::setDefault(): Argument #1 ($locale) must not contain any null bytes +ValueError: locale_set_default(): Argument #1 ($locale) must not contain any null bytes uk-ua_CALIFORNIA@currency=;currency=GRN: set locale 'uk-ua_CALIFORNIA@currency=;currency=GRN' root: set locale 'root' uk@currency=EURO: set locale 'uk@currency=EURO' diff --git a/ext/intl/tests/msgfmt_bug70484.phpt b/ext/intl/tests/msgfmt_bug70484.phpt index 91d346743641..9b5cfa198982 100644 --- a/ext/intl/tests/msgfmt_bug70484.phpt +++ b/ext/intl/tests/msgfmt_bug70484.phpt @@ -88,4 +88,3 @@ string(11) "42,42-other" string(22) "2 147 483 643-other" string(26) "2 147 483 643,123-other" string(4) "five" - diff --git a/ext/intl/tests/numfmt_parse_currency_references.phpt b/ext/intl/tests/numfmt_parse_currency_references.phpt index 06427a736930..76c8f534f9bf 100644 --- a/ext/intl/tests/numfmt_parse_currency_references.phpt +++ b/ext/intl/tests/numfmt_parse_currency_references.phpt @@ -13,8 +13,8 @@ $num = "1\xc2\xa0$"; try { numfmt_parse_currency($fmt, $num, $test->prop); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign string to reference held by property Test::$prop of type int +TypeError: Cannot assign string to reference held by property Test::$prop of type int diff --git a/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt index 83c993d7fc98..3cbaa02c85c7 100644 --- a/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt +++ b/ext/intl/tests/rangeformatter/rangeformatter_errors.phpt @@ -19,7 +19,7 @@ try { IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE ); } catch (IntlException $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } echo intl_get_error_code() . PHP_EOL; @@ -28,7 +28,7 @@ echo intl_get_error_message() . PHP_EOL; try { new IntlNumberRangeFormatter(); } catch(Error $error) { - echo $error->getMessage() . PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } try { @@ -39,7 +39,7 @@ try { IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE ); } catch (ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } try { @@ -50,7 +50,7 @@ try { 343 ); } catch (ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } try { @@ -61,7 +61,7 @@ try { IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE ); } catch (ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } try { @@ -72,16 +72,16 @@ try { IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE ); } catch (ValueError $exception) { - echo $exception->getMessage() . PHP_EOL; + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } ?> --EXPECT-- -IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton +IntlException: IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton 65811 IntlNumberRangeFormatter::createFromSkeleton(): Failed to create the number skeleton: U_NUMBER_SKELETON_SYNTAX_ERROR -Call to private IntlNumberRangeFormatter::__construct() from global scope -IntlNumberRangeFormatter::createFromSkeleton(): Argument #3 ($collapse) must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL -IntlNumberRangeFormatter::createFromSkeleton(): Argument #4 ($identityFallback) must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE -IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) "invalid-language" is invalid -IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) must be no longer than 156 characters +Error: Call to private IntlNumberRangeFormatter::__construct() from global scope +ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #3 ($collapse) must be one of IntlNumberRangeFormatter::COLLAPSE_AUTO, IntlNumberRangeFormatter::COLLAPSE_NONE, IntlNumberRangeFormatter::COLLAPSE_UNIT, or IntlNumberRangeFormatter::COLLAPSE_ALL +ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #4 ($identityFallback) must be one of IntlNumberRangeFormatter::IDENTITY_FALLBACK_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY_OR_SINGLE_VALUE, IntlNumberRangeFormatter::IDENTITY_FALLBACK_APPROXIMATELY, or IntlNumberRangeFormatter::IDENTITY_FALLBACK_RANGE +ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) "invalid-language" is invalid +ValueError: IntlNumberRangeFormatter::createFromSkeleton(): Argument #2 ($locale) must be no longer than 156 characters diff --git a/ext/intl/tests/rbbiter___construct_basic.phpt b/ext/intl/tests/rbbiter___construct_basic.phpt index e749442daa9f..25f12c0a8dbb 100644 --- a/ext/intl/tests/rbbiter___construct_basic.phpt +++ b/ext/intl/tests/rbbiter___construct_basic.phpt @@ -26,10 +26,10 @@ var_dump(get_class($rbbi)); try { $obj = new IntlRuleBasedBreakIterator('[\p{Letter}\uFFFD]+;[:number:]+', 'aoeu'); } catch (IntlException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(26) "IntlRuleBasedBreakIterator" -IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules +IntlException: IntlRuleBasedBreakIterator::__construct(): unable to create instance from compiled rules diff --git a/ext/intl/tests/resourcebundle_double_ctor.phpt b/ext/intl/tests/resourcebundle_double_ctor.phpt index 331d3d503b0f..a85fb8a3e232 100644 --- a/ext/intl/tests/resourcebundle_double_ctor.phpt +++ b/ext/intl/tests/resourcebundle_double_ctor.phpt @@ -10,9 +10,9 @@ $r = new ResourceBundle('en_US', BUNDLE); try { $r->__construct('en_US', BUNDLE); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ResourceBundle object is already constructed +Error: ResourceBundle object is already constructed diff --git a/ext/intl/tests/spoofchecker_008.phpt b/ext/intl/tests/spoofchecker_008.phpt index 66e39967c788..3f6fd39777b6 100644 --- a/ext/intl/tests/spoofchecker_008.phpt +++ b/ext/intl/tests/spoofchecker_008.phpt @@ -19,19 +19,19 @@ var_dump($s->isSuspicious("ABC")); try { $s->setAllowedChars('[a-z]', 1024); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $s->setAllowedChars("A-Z]"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $s->setAllowedChars("[A-Z"); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -39,6 +39,6 @@ try { bool(true) bool(false) bool(false) -Spoofchecker::setAllowedChars(): Argument #2 ($patternOptions) must be a valid pattern option, 0 or (SpoofChecker::IGNORE_SPACE|( or SpoofChecker::CASE_INSENSITIVE%s)) -Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern -Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern +ValueError: Spoofchecker::setAllowedChars(): Argument #2 ($patternOptions) must be a valid pattern option, 0 or (SpoofChecker::IGNORE_SPACE|( or SpoofChecker::CASE_INSENSITIVE%s)) +ValueError: Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern +ValueError: Spoofchecker::setAllowedChars(): Argument #1 ($pattern) must be a valid regular expression character set pattern diff --git a/ext/intl/tests/spoofchecker_double_ctor.phpt b/ext/intl/tests/spoofchecker_double_ctor.phpt index 01dae5ab4bc5..138a9cbffbb1 100644 --- a/ext/intl/tests/spoofchecker_double_ctor.phpt +++ b/ext/intl/tests/spoofchecker_double_ctor.phpt @@ -11,8 +11,8 @@ $checker = new Spoofchecker(); try { $checker->__construct(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Spoofchecker object is already constructed +Error: Spoofchecker object is already constructed diff --git a/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt index 187be350f594..f3078e8969f2 100644 --- a/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt +++ b/ext/intl/tests/spoofchecker_unknown_restriction_level.phpt @@ -13,9 +13,9 @@ $x = new Spoofchecker(); try { $x->setRestrictionLevel(Spoofchecker::SINGLE_SCRIPT); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Spoofchecker::setRestrictionLevel(): Argument #1 ($level) must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE +ValueError: Spoofchecker::setRestrictionLevel(): Argument #1 ($level) must be one of Spoofchecker::ASCII, Spoofchecker::SINGLE_SCRIPT_RESTRICTIVE, Spoofchecker::HIGHLY_RESTRICTIVE, Spoofchecker::MODERATELY_RESTRICTIVE, Spoofchecker::MINIMALLY_RESTRICTIVE, or Spoofchecker::UNRESTRICTIVE diff --git a/ext/json/tests/009.phpt b/ext/json/tests/009.phpt index ec9d9dd0f0ee..86ff78cb045c 100644 --- a/ext/json/tests/009.phpt +++ b/ext/json/tests/009.phpt @@ -11,4 +11,3 @@ echo "Done\n"; --EXPECT-- string(7) "[1,2,3]" Done - diff --git a/ext/json/tests/bug72787.phpt b/ext/json/tests/bug72787.phpt index c08bd18ec9b1..90cdc340a0c8 100644 --- a/ext/json/tests/bug72787.phpt +++ b/ext/json/tests/bug72787.phpt @@ -8,9 +8,9 @@ Bug #72787 (json_decode reads out of bounds) try { var_dump(json_decode('[]', false, 0x100000000)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -json_decode(): Argument #3 ($depth) must be less than %d +ValueError: json_decode(): Argument #3 ($depth) must be less than %d diff --git a/ext/json/tests/bug73113.phpt b/ext/json/tests/bug73113.phpt index d22b0c23f71b..570c099dd03c 100644 --- a/ext/json/tests/bug73113.phpt +++ b/ext/json/tests/bug73113.phpt @@ -16,8 +16,8 @@ $obj = new JsonSerializableObject(); try { echo json_encode($obj); } catch (\Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -This error is expected +Exception: This error is expected diff --git a/ext/json/tests/json_decode_error.phpt b/ext/json/tests/json_decode_error.phpt index 93306a58b39d..3ab2a4b653bc 100644 --- a/ext/json/tests/json_decode_error.phpt +++ b/ext/json/tests/json_decode_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing json_decode() function with depth below 0 --\n"; try { var_dump(json_decode('"abc"', true, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -17,4 +17,4 @@ try { *** Testing json_decode() : error conditions *** -- Testing json_decode() function with depth below 0 -- -json_decode(): Argument #3 ($depth) must be greater than 0 +ValueError: json_decode(): Argument #3 ($depth) must be greater than 0 diff --git a/ext/json/tests/json_last_error_error.phpt b/ext/json/tests/json_last_error_error.phpt index d98d1988dbac..f40106a110e6 100644 --- a/ext/json/tests/json_last_error_error.phpt +++ b/ext/json/tests/json_last_error_error.phpt @@ -8,10 +8,10 @@ var_dump(json_last_error()); try { var_dump(json_last_error(true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- int(0) -json_last_error() expects exactly 0 arguments, 1 given +ArgumentCountError: json_last_error() expects exactly 0 arguments, 1 given diff --git a/ext/json/tests/json_last_error_msg_error.phpt b/ext/json/tests/json_last_error_msg_error.phpt index f34cdbbe624c..5412ff312ed5 100644 --- a/ext/json/tests/json_last_error_msg_error.phpt +++ b/ext/json/tests/json_last_error_msg_error.phpt @@ -8,10 +8,10 @@ var_dump(json_last_error_msg()); try { var_dump(json_last_error_msg(true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(8) "No error" -json_last_error_msg() expects exactly 0 arguments, 1 given +ArgumentCountError: json_last_error_msg() expects exactly 0 arguments, 1 given diff --git a/ext/json/tests/json_last_error_msg_error_location_003.phpt b/ext/json/tests/json_last_error_msg_error_location_003.phpt index ec5e6b9b4d65..702ba1f43889 100644 --- a/ext/json/tests/json_last_error_msg_error_location_003.phpt +++ b/ext/json/tests/json_last_error_msg_error_location_003.phpt @@ -69,4 +69,3 @@ Error on line 7, column 1: bool(false) int(4) string(30) "Syntax error near location 7:1" - diff --git a/ext/json/tests/json_validate_003.phpt b/ext/json/tests/json_validate_003.phpt index cd0545b9a7f9..98d8b8d994f2 100644 --- a/ext/json/tests/json_validate_003.phpt +++ b/ext/json/tests/json_validate_003.phpt @@ -8,12 +8,12 @@ json_validate() - Error handling for max depth try { var_dump(json_validate("-", PHP_INT_MAX)); } catch (ValueError $error) { - echo $error->getMessage() . PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; var_dump(json_last_error(), json_last_error_msg()); } ?> --EXPECTF-- -json_validate(): Argument #2 ($depth) must be less than %d +ValueError: json_validate(): Argument #2 ($depth) must be less than %d int(0) string(8) "No error" diff --git a/ext/ldap/tests/gh18902.phpt b/ext/ldap/tests/gh18902.phpt index 329cbb59c1b1..0df0543a8f75 100644 --- a/ext/ldap/tests/gh18902.phpt +++ b/ext/ldap/tests/gh18902.phpt @@ -9,22 +9,22 @@ $conn = ldap_connect(); try { ldap_exop($conn,"\0"); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ldap_exop_sync($conn,""); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ldap_exop_sync($conn,"test\0"); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ldap_exop(): Argument #2 ($request_oid) must not contain any null bytes -ldap_exop_sync(): Argument #2 ($request_oid) must not be empty -ldap_exop_sync(): Argument #2 ($request_oid) must not contain any null bytes +ValueError: ldap_exop(): Argument #2 ($request_oid) must not contain any null bytes +ValueError: ldap_exop_sync(): Argument #2 ($request_oid) must not be empty +ValueError: ldap_exop_sync(): Argument #2 ($request_oid) must not contain any null bytes diff --git a/ext/ldap/tests/gh21262.phpt b/ext/ldap/tests/gh21262.phpt index 3e414a9cbb12..52336ee070d1 100644 --- a/ext/ldap/tests/gh21262.phpt +++ b/ext/ldap/tests/gh21262.phpt @@ -17,14 +17,14 @@ $entry_with_empty_array = [ try { ldap_add($ldap, $valid_dn, $entry_with_empty_array); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // ldap_mod_add() should still reject empty arrays try { ldap_mod_add($ldap, $valid_dn, $entry_with_empty_array); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // ldap_modify() should accept empty arrays (delete attribute) @@ -32,7 +32,7 @@ try { @ldap_modify($ldap, $valid_dn, $entry_with_empty_array); echo "ldap_modify: no ValueError thrown", PHP_EOL; } catch (ValueError $e) { - echo "ldap_modify: UNEXPECTED ValueError: ", $e->getMessage(), PHP_EOL; + echo 'ldap_modify: UNEXPECTED: ', $e::class, ': ', $e->getMessage(), PHP_EOL; } // ldap_mod_del() should accept empty arrays (delete attribute) @@ -40,11 +40,11 @@ try { @ldap_mod_del($ldap, $valid_dn, $entry_with_empty_array); echo "ldap_mod_del: no ValueError thrown", PHP_EOL; } catch (ValueError $e) { - echo "ldap_mod_del: UNEXPECTED ValueError: ", $e->getMessage(), PHP_EOL; + echo 'ldap_mod_del: UNEXPECTED: ', $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values -ldap_mod_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values +ValueError: ldap_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values +ValueError: ldap_mod_add(): Argument #3 ($entry) attribute "attribute2" must be a non-empty list of attribute values ldap_modify: no ValueError thrown ldap_mod_del: no ValueError thrown diff --git a/ext/ldap/tests/ldap_connect_port_error.phpt b/ext/ldap/tests/ldap_connect_port_error.phpt index 55d41d395b13..8809b84d8a0e 100644 --- a/ext/ldap/tests/ldap_connect_port_error.phpt +++ b/ext/ldap/tests/ldap_connect_port_error.phpt @@ -10,15 +10,15 @@ require "connect.inc"; try { ldap_connect("nope://$host", 65536); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ldap_connect("nope://$host", 0); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ldap_connect(): Argument #2 ($port) must be between 1 and 65535 -ldap_connect(): Argument #2 ($port) must be between 1 and 65535 +ValueError: ldap_connect(): Argument #2 ($port) must be between 1 and 65535 +ValueError: ldap_connect(): Argument #2 ($port) must be between 1 and 65535 diff --git a/ext/ldap/tests/ldap_constructor.phpt b/ext/ldap/tests/ldap_constructor.phpt index d405bd33d903..f48d14dfa983 100644 --- a/ext/ldap/tests/ldap_constructor.phpt +++ b/ext/ldap/tests/ldap_constructor.phpt @@ -8,8 +8,8 @@ ldap try { new LDAP\Connection(); } catch (Error $ex) { - echo "Exception: ", $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Cannot directly construct LDAP\Connection, use ldap_connect() instead +Error: Cannot directly construct LDAP\Connection, use ldap_connect() instead diff --git a/ext/ldap/tests/ldap_first_attribute_error.phpt b/ext/ldap/tests/ldap_first_attribute_error.phpt index 2776838501d3..c84ca8607b7b 100644 --- a/ext/ldap/tests/ldap_first_attribute_error.phpt +++ b/ext/ldap/tests/ldap_first_attribute_error.phpt @@ -13,8 +13,8 @@ $link = ldap_connect($uri); try { var_dump(ldap_first_attribute($link, $link)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ldap_first_attribute(): Argument #2 ($entry) must be of type LDAP\ResultEntry, LDAP\Connection given +TypeError: ldap_first_attribute(): Argument #2 ($entry) must be of type LDAP\ResultEntry, LDAP\Connection given diff --git a/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt b/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt index 2079353e48c9..dacaa9c9836e 100644 --- a/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt +++ b/ext/ldap/tests/ldap_get_set_invalid_option_error.phpt @@ -9,12 +9,12 @@ $ldap = ldap_connect('ldap://127.0.0.1:3333'); try { var_dump(ldap_set_option($ldap, 999999, "bogus")); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(ldap_get_option($ldap, 999999, $value)); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt b/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt index 4f3567d9e00b..286b44706aa5 100644 --- a/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt +++ b/ext/ldap/tests/ldap_list_read_search_parallel_programming_errors.phpt @@ -110,4 +110,4 @@ ValueError: ldap_list(): Argument #3 ($filter) must be the same size as argument TypeError: ldap_list(): Argument #2 ($base) must be a list of strings, int given TypeError: ldap_list(): Argument #3 ($filter) must be a list of strings, int given ValueError: ldap_list(): Argument #2 ($base) must not contain null bytes -ValueError: ldap_list(): Argument #3 ($filter) must not contain null bytes \ No newline at end of file +ValueError: ldap_list(): Argument #3 ($filter) must not contain null bytes diff --git a/ext/ldap/tests/ldap_set_option_error.phpt b/ext/ldap/tests/ldap_set_option_error.phpt index eda3dc512173..92b84a2e9174 100644 --- a/ext/ldap/tests/ldap_set_option_error.phpt +++ b/ext/ldap/tests/ldap_set_option_error.phpt @@ -29,7 +29,7 @@ foreach ($controls as $control) { try { var_dump(ldap_set_option($link, LDAP_OPT_SERVER_CONTROLS, $control)); } catch (Error $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } diff --git a/ext/ldap/tests/ldap_sort_control_missing_attr.phpt b/ext/ldap/tests/ldap_sort_control_missing_attr.phpt index 0d6c3921f008..606894b7f374 100644 --- a/ext/ldap/tests/ldap_sort_control_missing_attr.phpt +++ b/ext/ldap/tests/ldap_sort_control_missing_attr.phpt @@ -20,11 +20,11 @@ try { ], ]); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok\n"; ?> --EXPECT-- -ldap_search(): Sort key list must have an "attr" key +ValueError: ldap_search(): Sort key list must have an "attr" key ok diff --git a/ext/libxml/tests/004.phpt b/ext/libxml/tests/004.phpt index 718f8cbdc202..e77ef7e357eb 100644 --- a/ext/libxml/tests/004.phpt +++ b/ext/libxml/tests/004.phpt @@ -18,7 +18,7 @@ foreach ($ctxs as $ctx) { try { var_dump(libxml_set_streams_context($ctx)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dom = new DOMDocument(); var_dump($dom->load(__DIR__.'/test.xml')); @@ -28,15 +28,15 @@ echo "Done\n"; ?> --EXPECT-- -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, null given +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, null given bool(true) -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given bool(true) -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, int given +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, int given bool(true) -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, stdClass given +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, stdClass given bool(true) -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, array given +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, array given bool(true) NULL bool(true) diff --git a/ext/libxml/tests/bug63389.phpt b/ext/libxml/tests/bug63389.phpt index 90a209e7be12..d870f6bdd2fb 100644 --- a/ext/libxml/tests/bug63389.phpt +++ b/ext/libxml/tests/bug63389.phpt @@ -7,17 +7,17 @@ libxml try { libxml_set_streams_context("a"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $fp = fopen("php://input", "r"); try { libxml_set_streams_context($fp); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "okey"; ?> --EXPECT-- -libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given -libxml_set_streams_context(): supplied resource is not a valid Stream-Context resource +TypeError: libxml_set_streams_context(): Argument #1 ($context) must be of type resource, string given +TypeError: libxml_set_streams_context(): supplied resource is not a valid Stream-Context resource okey diff --git a/ext/libxml/tests/libxml_get_external_entity_loader_error_callback_name.phpt b/ext/libxml/tests/libxml_get_external_entity_loader_error_callback_name.phpt index 3dca273d5959..d37ada1ab2b3 100644 --- a/ext/libxml/tests/libxml_get_external_entity_loader_error_callback_name.phpt +++ b/ext/libxml/tests/libxml_get_external_entity_loader_error_callback_name.phpt @@ -32,9 +32,9 @@ $r = $dd->loadXML($xml); try { var_dump($dd->validate()); } catch (\Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(122) "DOMDocument::validate(): The user entity loader callback "Handler::handle" has returned a resource, but it is not a stream" +TypeError: DOMDocument::validate(): The user entity loader callback "Handler::handle" has returned a resource, but it is not a stream diff --git a/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt b/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt index 050aa7830680..1bfc64da26ee 100644 --- a/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt +++ b/ext/libxml/tests/libxml_set_external_entity_loader_error1.phpt @@ -16,12 +16,12 @@ var_dump(libxml_set_external_entity_loader(function($a, $b, $c, $d) {})); try { var_dump($dd->validate()); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done.\n"; ?> --EXPECTF-- bool(true) -Exception: Too few arguments to function {closure:%s:%d}(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 3 passed and exactly 4 expected Done. diff --git a/ext/libxml/tests/libxml_set_external_entity_loader_error2.phpt b/ext/libxml/tests/libxml_set_external_entity_loader_error2.phpt index 053551f5ff3e..d8c574e86da8 100644 --- a/ext/libxml/tests/libxml_set_external_entity_loader_error2.phpt +++ b/ext/libxml/tests/libxml_set_external_entity_loader_error2.phpt @@ -7,8 +7,8 @@ libxml try { libxml_set_external_entity_loader('nonexistent_function'); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, function "nonexistent_function" not found or invalid function name +TypeError: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, function "nonexistent_function" not found or invalid function name diff --git a/ext/mbstring/tests/bug43840.phpt b/ext/mbstring/tests/bug43840.phpt index 887ff96f97be..04d7f8170d99 100644 --- a/ext/mbstring/tests/bug43840.phpt +++ b/ext/mbstring/tests/bug43840.phpt @@ -21,13 +21,13 @@ foreach($offsets as $i) { try { var_dump( mb_strpos($string_mb, $needle, $i, 'UTF-8') ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo"--ASCII String:--\n"; try { var_dump(mb_strpos('This is na English ta', 'a', $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> @@ -46,18 +46,18 @@ bool(false) -- Offset is 22 -- --Multibyte String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --ASCII String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset is 53 -- --Multibyte String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --ASCII String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset is 54 -- --Multibyte String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --ASCII String:-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/bug43841.phpt b/ext/mbstring/tests/bug43841.phpt index 62e8cdcefbec..a608666c2d2b 100644 --- a/ext/mbstring/tests/bug43841.phpt +++ b/ext/mbstring/tests/bug43841.phpt @@ -19,41 +19,41 @@ foreach ($offsets as $i) { try { var_dump( mb_strrpos($string_mb, $needle, $i, 'UTF-8') ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "ASCII String:\n"; echo "mb_strrpos:\n"; try { var_dump(mb_strrpos('This is na English ta', 'a', $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "strrpos:\n"; try { var_dump(strrpos('This is na English ta', 'a', $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -- Offset is -25 -- Multibyte String: -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ASCII String: mb_strrpos: -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) strrpos: -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset is -24 -- Multibyte String: -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ASCII String: mb_strrpos: -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) strrpos: -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset is -13 -- Multibyte String: diff --git a/ext/mbstring/tests/bug43994.phpt b/ext/mbstring/tests/bug43994.phpt index cc6953808cc6..5f8653708b67 100644 --- a/ext/mbstring/tests/bug43994.phpt +++ b/ext/mbstring/tests/bug43994.phpt @@ -19,14 +19,14 @@ echo "Without \$regs arg:\n"; try { var_dump( mb_ereg($input, 'hello, world') ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "With \$regs arg:\n"; try { var_dump(mb_ereg($input, 'hello, world', $mb_regs)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($mb_regs); @@ -35,9 +35,9 @@ var_dump($mb_regs); Without $regs arg: Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg(): Argument #1 ($pattern) must not be empty +ValueError: mb_ereg(): Argument #1 ($pattern) must not be empty With $regs arg: Deprecated: Function mb_ereg() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg(): Argument #1 ($pattern) must not be empty +ValueError: mb_ereg(): Argument #1 ($pattern) must not be empty NULL diff --git a/ext/mbstring/tests/bug43998.phpt b/ext/mbstring/tests/bug43998.phpt index 5be1bd2cc9ff..a3352cef269b 100644 --- a/ext/mbstring/tests/bug43998.phpt +++ b/ext/mbstring/tests/bug43998.phpt @@ -15,15 +15,15 @@ $input = ""; try { var_dump( mb_strtolower($sourcestring, $input) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_strtoupper($sourcestring, $input) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given -mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "" given +ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "" given +ValueError: mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "" given diff --git a/ext/mbstring/tests/bug45923.phpt b/ext/mbstring/tests/bug45923.phpt index a1e3a35a2c09..772572a5be34 100644 --- a/ext/mbstring/tests/bug45923.phpt +++ b/ext/mbstring/tests/bug45923.phpt @@ -13,7 +13,7 @@ function section($func, $haystack, $needle) try { var_dump($func($haystack, $needle, $offset)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -44,7 +44,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 bool(false) > Offset: -3 @@ -52,7 +52,7 @@ int(8) > Offset: -6 int(8) > Offset: -20 -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- mb_strpos ----------- @@ -67,7 +67,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 bool(false) > Offset: -3 @@ -75,7 +75,7 @@ int(8) > Offset: -6 int(8) > Offset: -20 -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- stripos ----------- @@ -90,7 +90,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 bool(false) > Offset: -3 @@ -98,7 +98,7 @@ int(8) > Offset: -6 int(8) > Offset: -20 -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- mb_stripos ----------- @@ -113,7 +113,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 bool(false) > Offset: -3 @@ -121,7 +121,7 @@ int(8) > Offset: -6 int(8) > Offset: -20 -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- strrpos ----------- @@ -136,7 +136,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 int(8) > Offset: -3 @@ -144,7 +144,7 @@ int(8) > Offset: -6 int(4) > Offset: -20 -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- mb_strrpos ----------- @@ -159,7 +159,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 int(8) > Offset: -3 @@ -167,7 +167,7 @@ int(8) > Offset: -6 int(4) > Offset: -20 -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- strripos ----------- @@ -182,7 +182,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 int(8) > Offset: -3 @@ -190,7 +190,7 @@ int(8) > Offset: -6 int(4) > Offset: -20 -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) ------- mb_strripos ----------- @@ -205,7 +205,7 @@ bool(false) > Offset: 11 bool(false) > Offset: 12 -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) > Offset: -1 int(8) > Offset: -3 @@ -213,4 +213,4 @@ int(8) > Offset: -6 int(4) > Offset: -20 -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/bug69079.phpt b/ext/mbstring/tests/bug69079.phpt index b16e82525ef1..dc8c2f6fc5b0 100644 --- a/ext/mbstring/tests/bug69079.phpt +++ b/ext/mbstring/tests/bug69079.phpt @@ -12,7 +12,7 @@ mb_substitute_character(0x3f); // Reset to '?', as the next call will fail try { var_dump(mb_substitute_character(0xD800)); // Surrogate (illegal) } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(bin2hex(mb_scrub("\xff"))); @@ -22,7 +22,7 @@ mb_substitute_character(0x63); // Reset to '?', as the next call will fail try { mb_substitute_character(0x8fa1ef); // EUC-JP-2004 encoding of U+50AA (illegal) } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(bin2hex(mb_scrub("\x8d"))); @@ -33,8 +33,8 @@ var_dump(bin2hex(mb_scrub("\x8d"))); --EXPECT-- bool(true) string(8) "f09f9880" -mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint +ValueError: mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint string(2) "3f" -mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint +ValueError: mb_substitute_character(): Argument #1 ($substitute_character) is not a valid codepoint string(2) "63" string(6) "8fa1ef" diff --git a/ext/mbstring/tests/bug72164.phpt b/ext/mbstring/tests/bug72164.phpt index 2b8f3950d92c..bf5ab64d9038 100644 --- a/ext/mbstring/tests/bug72164.phpt +++ b/ext/mbstring/tests/bug72164.phpt @@ -15,10 +15,10 @@ try { $var8 = mb_ereg_replace($var2,$var3,$var3,$var0); var_dump($var8); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Function mb_ereg_replace() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -Option "e" is not supported +ValueError: Option "e" is not supported diff --git a/ext/mbstring/tests/bug72399.phpt b/ext/mbstring/tests/bug72399.phpt index bf9880c0ab42..87406a076612 100644 --- a/ext/mbstring/tests/bug72399.phpt +++ b/ext/mbstring/tests/bug72399.phpt @@ -16,7 +16,7 @@ var_dump($var6); try { $var13 = mb_ereg_search_pos(); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -27,4 +27,4 @@ Deprecated: Function mb_eregi_replace() is deprecated since 8.6, because the und string(0) "" Deprecated: Function mb_ereg_search_pos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -No pattern was provided +Error: No pattern was provided diff --git a/ext/mbstring/tests/bug76704.phpt b/ext/mbstring/tests/bug76704.phpt index 433dcdfa6cc0..60de8e48ae25 100644 --- a/ext/mbstring/tests/bug76704.phpt +++ b/ext/mbstring/tests/bug76704.phpt @@ -7,14 +7,14 @@ mbstring try { var_dump(mb_detect_order('Foo, UTF-8')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_detect_order(['Foo', 'UTF-8'])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo" -mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo" +ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo" +ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "Foo" diff --git a/ext/mbstring/tests/bug76999.phpt b/ext/mbstring/tests/bug76999.phpt index 5c6dc442573f..ed5cdb372813 100644 --- a/ext/mbstring/tests/bug76999.phpt +++ b/ext/mbstring/tests/bug76999.phpt @@ -15,7 +15,7 @@ var_dump(mb_regex_set_options("m")); try { var_dump(mb_regex_set_options("a")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_regex_set_options()); ?> @@ -32,7 +32,7 @@ Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the string(3) "imd" Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -Option "a" is not supported +ValueError: Option "a" is not supported Deprecated: Function mb_regex_set_options() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(2) "mr" diff --git a/ext/mbstring/tests/bug79149.phpt b/ext/mbstring/tests/bug79149.phpt index 02a705b9d3f2..4c0225bc22e4 100644 --- a/ext/mbstring/tests/bug79149.phpt +++ b/ext/mbstring/tests/bug79149.phpt @@ -7,23 +7,23 @@ mbstring try { var_dump(mb_convert_encoding("", "UTF-8", [0])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_convert_encoding('foo', 'UTF-8', array(['bar'], ['baz']))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_convert_encoding('foo', 'UTF-8', array("foo\0bar"))); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "0" +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "0" Warning: Array to string conversion in %s on line %d -mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "Array" -mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "foo" +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "Array" +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "foo" diff --git a/ext/mbstring/tests/bug79441.phpt b/ext/mbstring/tests/bug79441.phpt index 7d89dd03ef27..2e77c289c925 100644 --- a/ext/mbstring/tests/bug79441.phpt +++ b/ext/mbstring/tests/bug79441.phpt @@ -10,9 +10,9 @@ internal_encoding=utf-7 try { mb_chr(0xd800); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_chr() does not support the "UTF-7" encoding +ValueError: mb_chr() does not support the "UTF-7" encoding diff --git a/ext/mbstring/tests/empty_pattern.phpt b/ext/mbstring/tests/empty_pattern.phpt index c7a2ca285c29..11482b14524c 100644 --- a/ext/mbstring/tests/empty_pattern.phpt +++ b/ext/mbstring/tests/empty_pattern.phpt @@ -12,7 +12,7 @@ if (!function_exists('mb_ereg')) die('skip mbregex support not available'); try { mb_ereg_search_init("","",""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } mb_split("",""); @@ -20,15 +20,15 @@ mb_split("",""); try { mb_ereg_search_regs(); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Function mb_ereg_search_init() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg_search_init(): Argument #2 ($pattern) must not be empty +ValueError: mb_ereg_search_init(): Argument #2 ($pattern) must not be empty Deprecated: Function mb_split() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d Deprecated: Function mb_ereg_search_regs() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -No pattern was provided +Error: No pattern was provided diff --git a/ext/mbstring/tests/gh16360.phpt b/ext/mbstring/tests/gh16360.phpt index 4e2e8fb4bfc6..5cbbbe0563b9 100644 --- a/ext/mbstring/tests/gh16360.phpt +++ b/ext/mbstring/tests/gh16360.phpt @@ -7,17 +7,16 @@ mbstring try { mb_substr("abcd", PHP_INT_MIN, 4, "UTF-8"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_substr("abcd", 0, PHP_INT_MIN, "UTF-8"); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_substr("abcd", PHP_INT_MAX, PHP_INT_MAX, "UTF-8")); ?> --EXPECTF-- -mb_substr(): Argument #2 ($start) must be between %s and %s -mb_substr(): Argument #3 ($length) must be between %s and %s +ValueError: mb_substr(): Argument #2 ($start) must be between %s and %s +ValueError: mb_substr(): Argument #3 ($length) must be between %s and %s string(0) "" - diff --git a/ext/mbstring/tests/gh20833.phpt b/ext/mbstring/tests/gh20833.phpt index 099aa3379238..6ebb798eee79 100644 --- a/ext/mbstring/tests/gh20833.phpt +++ b/ext/mbstring/tests/gh20833.phpt @@ -9,7 +9,7 @@ $utf32 = mb_convert_encoding($utf8, 'UTF-32', 'UTF-8'); try { mb_str_pad($utf32, 5, "1" /* invalid for encoding */, STR_PAD_RIGHT, "UTF-32"); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/mbstring/tests/mb_check_encoding_invalid_encodings.phpt b/ext/mbstring/tests/mb_check_encoding_invalid_encodings.phpt index 1e9b11e18b47..27586ec6c158 100644 --- a/ext/mbstring/tests/mb_check_encoding_invalid_encodings.phpt +++ b/ext/mbstring/tests/mb_check_encoding_invalid_encodings.phpt @@ -12,31 +12,31 @@ echo 'Using "BAD" as encoding' . \PHP_EOL; try { var_dump(mb_check_encoding($str, 'BAD')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_check_encoding($arr, 'BAD')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Using "pass" as encoding' . \PHP_EOL; try { var_dump(mb_check_encoding($str, 'pass')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_check_encoding($arr, 'pass')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Using "BAD" as encoding -mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "BAD" given -mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "BAD" given +ValueError: mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "BAD" given +ValueError: mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "BAD" given Using "pass" as encoding -mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "pass" given -mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "pass" given +ValueError: mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "pass" given +ValueError: mb_check_encoding(): Argument #2 ($encoding) must be a valid encoding, "pass" given diff --git a/ext/mbstring/tests/mb_chr.phpt b/ext/mbstring/tests/mb_chr.phpt index fd9a4eebbf62..b2f23b29753b 100644 --- a/ext/mbstring/tests/mb_chr.phpt +++ b/ext/mbstring/tests/mb_chr.phpt @@ -15,34 +15,34 @@ var_dump( try { var_dump( mb_chr(0xd800, "typo") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_chr(0xd800, "pass") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_chr(0xd800, "jis") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_chr(0xd800, "cp50222") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_chr(0xd800, "utf-7") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } mb_internal_encoding("utf-7"); try { var_dump( mb_chr(0xd800) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -51,9 +51,9 @@ bool(true) bool(true) bool(true) bool(true) -mb_chr(): Argument #2 ($encoding) must be a valid encoding, "typo" given -mb_chr(): Argument #2 ($encoding) must be a valid encoding, "pass" given -mb_chr() does not support the "JIS" encoding -mb_chr() does not support the "CP50222" encoding -mb_chr() does not support the "UTF-7" encoding -mb_chr() does not support the "UTF-7" encoding +ValueError: mb_chr(): Argument #2 ($encoding) must be a valid encoding, "typo" given +ValueError: mb_chr(): Argument #2 ($encoding) must be a valid encoding, "pass" given +ValueError: mb_chr() does not support the "JIS" encoding +ValueError: mb_chr() does not support the "CP50222" encoding +ValueError: mb_chr() does not support the "UTF-7" encoding +ValueError: mb_chr() does not support the "UTF-7" encoding diff --git a/ext/mbstring/tests/mb_convert_case_various_mode.phpt b/ext/mbstring/tests/mb_convert_case_various_mode.phpt index 70dcbfcd66a2..51411deec9c7 100644 --- a/ext/mbstring/tests/mb_convert_case_various_mode.phpt +++ b/ext/mbstring/tests/mb_convert_case_various_mode.phpt @@ -18,7 +18,7 @@ var_dump(mb_convert_case('foo BAR Spaß', MB_CASE_FOLD_SIMPLE)); try { var_dump(mb_convert_case('foo BAR Spaß', 100)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Greek letter sigma --\n"; @@ -64,7 +64,7 @@ string(13) "FOO BAR SPAß" string(13) "foo bar spaß" string(13) "Foo Bar Spaß" string(13) "foo bar spaß" -mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants +ValueError: mb_convert_case(): Argument #2 ($mode) must be one of the MB_CASE_* constants -- Greek letter sigma -- string(2) "Σ" diff --git a/ext/mbstring/tests/mb_convert_encoding.phpt b/ext/mbstring/tests/mb_convert_encoding.phpt index bb460961e9ad..f57ef80340c8 100644 --- a/ext/mbstring/tests/mb_convert_encoding.phpt +++ b/ext/mbstring/tests/mb_convert_encoding.phpt @@ -89,7 +89,7 @@ function tryBadConversion($str, $encoding) { try { var_dump(mb_convert_encoding($str, $encoding)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -122,7 +122,7 @@ JIS: GyRCRnxLXDhsJUYlLSU5JUgkRyQ5ISMbKEIwMTIzNBskQiM1IzYjNyM4IzkhIxsoQg== == INVALID PARAMETER == INT: 1234 EUC-JP: -mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "BAD" given +ValueError: mb_convert_encoding(): Argument #2 ($to_encoding) must be a valid encoding, "BAD" given Deprecated: mb_convert_encoding(): Handling QPrint via mbstring is deprecated; use quoted_printable_encode/quoted_printable_decode instead in %s on line %d string(3) "abc" diff --git a/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt b/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt index 520681809358..8ac50eb902a1 100644 --- a/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_convert_encoding_empty_encoding_list.phpt @@ -10,15 +10,15 @@ $string = 'Hello'; try { var_dump( mb_convert_encoding($string, 'UTF-8', '')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_convert_encoding($string, 'UTF-8', [])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding -mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_convert_kana.phpt b/ext/mbstring/tests/mb_convert_kana.phpt index b263fec0f1b6..38762255c15c 100644 --- a/ext/mbstring/tests/mb_convert_kana.phpt +++ b/ext/mbstring/tests/mb_convert_kana.phpt @@ -101,7 +101,7 @@ function tryBadFlags($flags) { mb_convert_kana('abc', $flags, 'UTF-8'); echo "BAD! mb_convert_kana should have thrown an exception for flags: $flags\n"; } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } function tryIncompatibleFlags($flag1, $flag2) { @@ -129,7 +129,7 @@ tryIncompatibleFlags('k', 'c'); try { mb_convert_kana($zenKakuA, 'Z', 'UTF-8'); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Regression test: Two codepoints collapsed into one, just one position @@ -220,37 +220,37 @@ Convert full-width katakana to full-width hiragana: 0000 -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'r' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'r' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'n' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'n' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'a' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'r' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'r' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'n' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'n' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'M' and 'm' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'M' and 'm' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'C' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'C' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'C' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'C' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'c' flags -mb_convert_kana(): Argument #2 ($mode) contains invalid flag: 'Z' +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'r' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'r' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'n' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'A' and 'n' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'a' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'r' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'R' and 'r' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'n' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'N' and 'n' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'S' and 's' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'H' and 'K' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'C' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'M' and 'm' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'M' and 'm' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'C' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'C' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'h' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'C' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'C' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) must not combine 'k' and 'c' flags +ValueError: mb_convert_kana(): Argument #2 ($mode) contains invalid flag: 'Z' --CREDITS-- Jason Easter PHPUG Würzburg diff --git a/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt b/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt index 6134d7cd2164..31d9c2265e03 100644 --- a/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_convert_variables_empty_encoding_list.phpt @@ -10,15 +10,15 @@ $string = 'Hello'; try { var_dump( mb_convert_variables('UTF-8', '', $string)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_convert_variables('UTF-8', [], $string)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding -mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding +ValueError: mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding +ValueError: mb_convert_variables(): Argument #2 ($from_encoding) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_decode_numericentity_errors.phpt b/ext/mbstring/tests/mb_decode_numericentity_errors.phpt index 5c08fec890d6..ad81401c9d67 100644 --- a/ext/mbstring/tests/mb_decode_numericentity_errors.phpt +++ b/ext/mbstring/tests/mb_decode_numericentity_errors.phpt @@ -8,16 +8,16 @@ try { $convmap = array(0xFF, 0x2FFFF, 0); // 3 elements echo mb_decode_numericentity('str', $convmap, "UTF-8") . "\n"; } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { $convmap = array(0xFF, "not an int", 0, 0); // 3 elements echo mb_decode_numericentity('str', $convmap, "UTF-8") . "\n"; } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -mb_decode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements -mb_decode_numericentity(): Argument #2 ($map) must only be composed of values of type int +ValueError: mb_decode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements +ValueError: mb_decode_numericentity(): Argument #2 ($map) must only be composed of values of type int diff --git a/ext/mbstring/tests/mb_detect_encoding.phpt b/ext/mbstring/tests/mb_detect_encoding.phpt index 2721ec3c83c6..9a3e908ec615 100644 --- a/ext/mbstring/tests/mb_detect_encoding.phpt +++ b/ext/mbstring/tests/mb_detect_encoding.phpt @@ -134,7 +134,7 @@ print("EUC-JP: " . mb_detect_encoding('', 'EUC-JP') . "\n"); // SJIS try { var_dump(mb_detect_encoding($euc_jp, 'BAD')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "== BOM TEST ==\n"; @@ -450,7 +450,7 @@ UTF-8 == INVALID PARAMETER == INT: EUC-JP EUC-JP: EUC-JP -mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "BAD" +ValueError: mb_detect_encoding(): Argument #2 ($encodings) contains invalid encoding "BAD" == BOM TEST == string(5) "UTF-8" string(8) "UTF-16BE" diff --git a/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt b/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt index bb5f02964e83..6d40f94d434b 100644 --- a/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_detect_encoding_empty_encoding_list.phpt @@ -10,15 +10,15 @@ $string = 'Hello'; try { var_dump( mb_detect_encoding($string, '')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_detect_encoding($string, [])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding -mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding +ValueError: mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding +ValueError: mb_detect_encoding(): Argument #2 ($encodings) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_detect_order.phpt b/ext/mbstring/tests/mb_detect_order.phpt index a6a9c179a6c5..daaf42c883bc 100644 --- a/ext/mbstring/tests/mb_detect_order.phpt +++ b/ext/mbstring/tests/mb_detect_order.phpt @@ -38,7 +38,7 @@ print "== INVALID PARAMETER ==\n"; try { var_dump(mb_detect_order('BAD_NAME')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_detect_order()); @@ -46,7 +46,7 @@ $a[] = 'BAD_NAME'; try { var_dump(mb_detect_order($a)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_detect_order()); @@ -59,7 +59,7 @@ SJIS, EUC-JP, JIS, UTF-8 OK_ARRAY ASCII, JIS, EUC-JP, UTF-8 == INVALID PARAMETER == -mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "BAD_NAME" +ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "BAD_NAME" array(4) { [0]=> string(5) "ASCII" @@ -70,7 +70,7 @@ array(4) { [3]=> string(5) "UTF-8" } -mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "BAD_NAME" +ValueError: mb_detect_order(): Argument #1 ($encoding) contains invalid encoding "BAD_NAME" array(4) { [0]=> string(5) "ASCII" diff --git a/ext/mbstring/tests/mb_detect_order_empty_encoding_list.phpt b/ext/mbstring/tests/mb_detect_order_empty_encoding_list.phpt index 2094fde2b6f7..b214121b768b 100644 --- a/ext/mbstring/tests/mb_detect_order_empty_encoding_list.phpt +++ b/ext/mbstring/tests/mb_detect_order_empty_encoding_list.phpt @@ -8,15 +8,15 @@ mbstring try { var_dump( mb_detect_order('')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_detect_order([])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_detect_order(): Argument #1 ($encoding) must specify at least one encoding -mb_detect_order(): Argument #1 ($encoding) must specify at least one encoding +ValueError: mb_detect_order(): Argument #1 ($encoding) must specify at least one encoding +ValueError: mb_detect_order(): Argument #1 ($encoding) must specify at least one encoding diff --git a/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt b/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt index ba59f3388b85..8030bf5c2b5a 100644 --- a/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt +++ b/ext/mbstring/tests/mb_detect_order_with_ini_set.phpt @@ -57,4 +57,3 @@ array(1) { [0]=> string(5) "UTF-8" } - diff --git a/ext/mbstring/tests/mb_encode_mimeheader_basic4.phpt b/ext/mbstring/tests/mb_encode_mimeheader_basic4.phpt index 02206efab358..bab56a3179b4 100644 --- a/ext/mbstring/tests/mb_encode_mimeheader_basic4.phpt +++ b/ext/mbstring/tests/mb_encode_mimeheader_basic4.phpt @@ -134,7 +134,7 @@ try { mb_internal_encoding('Quoted-Printable'); var_dump(mb_encode_mimeheader("=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=00=00=00=00=00=00=00=01=00=00=00=00=00=00=00850r=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=0D=00=00=00=0050r=08=0DCP850r850r0r", "Quoted-Printable", "B", "", 184)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done"; @@ -182,5 +182,5 @@ string(135) "=?UTF-8?B?LDk4Njg5NDksOTg2ODk3OCw5ODY5MDE1LDk2ODkxMDAsOTg2OTEyMSw5O string(142) "xx =?UTF-8?B?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFB?= =?UTF-8?B?QUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBIA==?=" string(690) "=?ISO-2022-JP?B?bmU/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/cxskQiFEGyhCPw==?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/MRskQiFEGyhCPxskQiFEGyhCPw==?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/GyRCIUQbKEI/?=A =?ISO-2022-JP?B?GyRCIUQbKEI/GyRCIUQbKEI/MQ==?=" -mb_encode_mimeheader(): Argument #2 ($charset) "Quoted-Printable" cannot be used for MIME header encoding +ValueError: mb_encode_mimeheader(): Argument #2 ($charset) "Quoted-Printable" cannot be used for MIME header encoding Done diff --git a/ext/mbstring/tests/mb_encode_mimeheader_crash.phpt b/ext/mbstring/tests/mb_encode_mimeheader_crash.phpt index 2505d4c4ad99..63a7830b30a0 100644 --- a/ext/mbstring/tests/mb_encode_mimeheader_crash.phpt +++ b/ext/mbstring/tests/mb_encode_mimeheader_crash.phpt @@ -11,11 +11,11 @@ function_exists('mb_encode_mimeheader') or die("skip mb_encode_mimeheader() is n try { var_dump(mb_encode_mimeheader("abc", "UTF7-IMAP", "Q")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> --EXPECT-- -mb_encode_mimeheader(): Argument #2 ($charset) "UTF7-IMAP" cannot be used for MIME header encoding +ValueError: mb_encode_mimeheader(): Argument #2 ($charset) "UTF7-IMAP" cannot be used for MIME header encoding Done diff --git a/ext/mbstring/tests/mb_encode_numericentity_errors.phpt b/ext/mbstring/tests/mb_encode_numericentity_errors.phpt index 8b41bb87e0c8..bd5df37a3b9c 100644 --- a/ext/mbstring/tests/mb_encode_numericentity_errors.phpt +++ b/ext/mbstring/tests/mb_encode_numericentity_errors.phpt @@ -8,16 +8,16 @@ try { $convmap = array(0xFF, 0x2FFFF, 0); // 3 elements echo mb_encode_numericentity('str', $convmap, "UTF-8") . "\n"; } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { $convmap = array(0xFF, "not an int", 0, 0); // 3 elements echo mb_encode_numericentity('str', $convmap, "UTF-8") . "\n"; } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -mb_encode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements -mb_encode_numericentity(): Argument #2 ($map) must only be composed of values of type int +ValueError: mb_encode_numericentity(): Argument #2 ($map) must have a multiple of 4 elements +ValueError: mb_encode_numericentity(): Argument #2 ($map) must only be composed of values of type int diff --git a/ext/mbstring/tests/mb_encoding_aliases.phpt b/ext/mbstring/tests/mb_encoding_aliases.phpt index 0c95d87e3abd..2fd3f7d363e0 100644 --- a/ext/mbstring/tests/mb_encoding_aliases.phpt +++ b/ext/mbstring/tests/mb_encoding_aliases.phpt @@ -13,7 +13,7 @@ var_dump(mb_encoding_aliases("8bit")); try { var_dump(mb_encoding_aliases("BAD")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -47,4 +47,4 @@ array(1) { [0]=> string(6) "binary" } -mb_encoding_aliases(): Argument #1 ($encoding) must be a valid encoding, "BAD" given +ValueError: mb_encoding_aliases(): Argument #1 ($encoding) must be a valid encoding, "BAD" given diff --git a/ext/mbstring/tests/mb_ereg1.phpt b/ext/mbstring/tests/mb_ereg1.phpt index a92b796423de..47de5bfa73da 100644 --- a/ext/mbstring/tests/mb_ereg1.phpt +++ b/ext/mbstring/tests/mb_ereg1.phpt @@ -19,7 +19,7 @@ foreach ($a as $args) { try { var_dump(mb_ereg($args[0], $args[1], $args[2])); } catch (\TypeError|\ValueError $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($args); } diff --git a/ext/mbstring/tests/mb_ereg_search_setpos.phpt b/ext/mbstring/tests/mb_ereg_search_setpos.phpt index 6153d86282df..8a8bc906846e 100644 --- a/ext/mbstring/tests/mb_ereg_search_setpos.phpt +++ b/ext/mbstring/tests/mb_ereg_search_setpos.phpt @@ -15,7 +15,7 @@ var_dump(mb_ereg_search_setpos(50)); // OK try { var_dump(mb_ereg_search_setpos(-1)); // Error } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } mb_ereg_search_init($test_str); @@ -26,12 +26,12 @@ foreach($positions as $pos) { try { var_dump(mb_ereg_search_setpos($pos)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_ereg_search_getpos()); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> @@ -42,7 +42,7 @@ Deprecated: Function mb_ereg_search_setpos() is deprecated since 8.6, because th bool(true) Deprecated: Function mb_ereg_search_setpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg_search_setpos(): Argument #1 ($offset) is out of range +ValueError: mb_ereg_search_setpos(): Argument #1 ($offset) is out of range Deprecated: Function mb_ereg_search_init() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d @@ -65,7 +65,7 @@ int(20) * Position: 21 : Deprecated: Function mb_ereg_search_setpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg_search_setpos(): Argument #1 ($offset) is out of range +ValueError: mb_ereg_search_setpos(): Argument #1 ($offset) is out of range Deprecated: Function mb_ereg_search_getpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d int(20) @@ -73,7 +73,7 @@ int(20) * Position: 25 : Deprecated: Function mb_ereg_search_setpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg_search_setpos(): Argument #1 ($offset) is out of range +ValueError: mb_ereg_search_setpos(): Argument #1 ($offset) is out of range Deprecated: Function mb_ereg_search_getpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d int(20) @@ -105,7 +105,7 @@ int(0) * Position: -30 : Deprecated: Function mb_ereg_search_setpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_ereg_search_setpos(): Argument #1 ($offset) is out of range +ValueError: mb_ereg_search_setpos(): Argument #1 ($offset) is out of range Deprecated: Function mb_ereg_search_getpos() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d int(0) diff --git a/ext/mbstring/tests/mb_http_input_errors.phpt b/ext/mbstring/tests/mb_http_input_errors.phpt index 88b3984c6bb5..8c1367641c16 100644 --- a/ext/mbstring/tests/mb_http_input_errors.phpt +++ b/ext/mbstring/tests/mb_http_input_errors.phpt @@ -8,15 +8,15 @@ mbstring try { var_dump(mb_http_input('PN')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(mb_http_input('Q')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" -mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" +ValueError: mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" +ValueError: mb_http_input(): Argument #1 ($type) must be one of "G", "P", "C", "S", "I", or "L" diff --git a/ext/mbstring/tests/mb_http_output.phpt b/ext/mbstring/tests/mb_http_output.phpt index 9857e37e0a8b..2351b618c90a 100644 --- a/ext/mbstring/tests/mb_http_output.phpt +++ b/ext/mbstring/tests/mb_http_output.phpt @@ -46,7 +46,7 @@ try { $r = mb_http_output('BAD_NAME'); print 'NG_BAD_SET' . \PHP_EOL; } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $enc = mb_http_output(); print "$enc\n"; @@ -64,5 +64,5 @@ UTF-8 OK_EUC-JP_SET EUC-JP == INVALID PARAMETER == -mb_http_output(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given +ValueError: mb_http_output(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given EUC-JP diff --git a/ext/mbstring/tests/mb_internal_encoding.phpt b/ext/mbstring/tests/mb_internal_encoding.phpt index 8e5356e2ada8..9636e74b8d3f 100644 --- a/ext/mbstring/tests/mb_internal_encoding.phpt +++ b/ext/mbstring/tests/mb_internal_encoding.phpt @@ -34,7 +34,7 @@ try { $r = mb_internal_encoding('BAD_NAME'); print 'NG_BAD_SET' . \PHP_EOL; } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $enc = mb_internal_encoding(); @@ -49,5 +49,5 @@ UTF-8 OK_ASCII_SET ASCII == INVALID PARAMETER == -mb_internal_encoding(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given +ValueError: mb_internal_encoding(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given ASCII diff --git a/ext/mbstring/tests/mb_internal_encoding_error2.phpt b/ext/mbstring/tests/mb_internal_encoding_error2.phpt index 300525a1c2a4..a81e73758b2c 100644 --- a/ext/mbstring/tests/mb_internal_encoding_error2.phpt +++ b/ext/mbstring/tests/mb_internal_encoding_error2.phpt @@ -13,10 +13,10 @@ echo "*** Testing mb_internal_encoding() : error conditions ***\n"; try { var_dump(mb_internal_encoding('unknown-encoding')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_internal_encoding() : error conditions *** -mb_internal_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_internal_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_language.phpt b/ext/mbstring/tests/mb_language.phpt index 3966c5d439e1..b828a4388cbc 100644 --- a/ext/mbstring/tests/mb_language.phpt +++ b/ext/mbstring/tests/mb_language.phpt @@ -23,7 +23,7 @@ echo "Try changing to a non-existent language:\n"; try { var_dump(mb_language('Pig Latin')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_language()); ?> @@ -37,5 +37,5 @@ bool(true) Confirm language was changed: string(7) "English" Try changing to a non-existent language: -mb_language(): Argument #1 ($language) must be a valid language, "Pig Latin" given +ValueError: mb_language(): Argument #1 ($language) must be a valid language, "Pig Latin" given string(7) "neutral" diff --git a/ext/mbstring/tests/mb_ord.phpt b/ext/mbstring/tests/mb_ord.phpt index a42cb9497fab..ddf602d9ab6a 100644 --- a/ext/mbstring/tests/mb_ord.phpt +++ b/ext/mbstring/tests/mb_ord.phpt @@ -14,41 +14,41 @@ var_dump( try { var_dump( mb_ord("") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // Invalid try { var_dump( mb_ord("\u{d800}", "typo") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_ord("\u{d800}", "pass") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_ord("\u{d800}", "jis") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_ord("\u{d800}", "cp50222") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_ord("\u{d800}", "utf-7") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } mb_internal_encoding("utf-7"); try { var_dump( mb_ord("\u{d800}") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -56,10 +56,10 @@ try { bool(true) bool(true) bool(true) -mb_ord(): Argument #1 ($string) must not be empty -mb_ord(): Argument #2 ($encoding) must be a valid encoding, "typo" given -mb_ord(): Argument #2 ($encoding) must be a valid encoding, "pass" given -mb_ord() does not support the "JIS" encoding -mb_ord() does not support the "CP50222" encoding -mb_ord() does not support the "UTF-7" encoding -mb_ord() does not support the "UTF-7" encoding +ValueError: mb_ord(): Argument #1 ($string) must not be empty +ValueError: mb_ord(): Argument #2 ($encoding) must be a valid encoding, "typo" given +ValueError: mb_ord(): Argument #2 ($encoding) must be a valid encoding, "pass" given +ValueError: mb_ord() does not support the "JIS" encoding +ValueError: mb_ord() does not support the "CP50222" encoding +ValueError: mb_ord() does not support the "UTF-7" encoding +ValueError: mb_ord() does not support the "UTF-7" encoding diff --git a/ext/mbstring/tests/mb_preferred_mime_name.phpt b/ext/mbstring/tests/mb_preferred_mime_name.phpt index 80680ed1f84b..4c76bf1d9d3f 100644 --- a/ext/mbstring/tests/mb_preferred_mime_name.phpt +++ b/ext/mbstring/tests/mb_preferred_mime_name.phpt @@ -38,7 +38,7 @@ echo "== INVALID PARAMETER ==\n"; try { var_dump(mb_preferred_mime_name('BAD_NAME')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -53,4 +53,4 @@ ISO-8859-1 UCS-2 UCS-4 == INVALID PARAMETER == -mb_preferred_mime_name(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given +ValueError: mb_preferred_mime_name(): Argument #1 ($encoding) must be a valid encoding, "BAD_NAME" given diff --git a/ext/mbstring/tests/mb_regex_encoding_error2.phpt b/ext/mbstring/tests/mb_regex_encoding_error2.phpt index ee665e5aa8bd..ea50d11eea00 100644 --- a/ext/mbstring/tests/mb_regex_encoding_error2.phpt +++ b/ext/mbstring/tests/mb_regex_encoding_error2.phpt @@ -17,7 +17,7 @@ echo "*** Testing mb_regex_encoding() : error conditions ***\n"; try { var_dump(mb_regex_encoding('unknown')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -25,4 +25,4 @@ try { *** Testing mb_regex_encoding() : error conditions *** Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line 9 -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "unknown" given diff --git a/ext/mbstring/tests/mb_regex_encoding_variation2.phpt b/ext/mbstring/tests/mb_regex_encoding_variation2.phpt index 55d139eb3ad7..3867bbd86a5b 100644 --- a/ext/mbstring/tests/mb_regex_encoding_variation2.phpt +++ b/ext/mbstring/tests/mb_regex_encoding_variation2.phpt @@ -80,7 +80,7 @@ foreach($encoding as $enc) { try { var_dump(mb_regex_encoding($enc)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(mb_regex_encoding()); $iterator++; @@ -107,7 +107,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(5) "UCS-4" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-4BE" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-4BE" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(5) "UCS-4" @@ -129,7 +129,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(7) "UCS-4LE" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(7) "UCS-4LE" @@ -140,7 +140,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(7) "UCS-4LE" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2BE" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2BE" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(7) "UCS-4LE" @@ -151,7 +151,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(7) "UCS-4LE" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2LE" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UCS-2LE" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(7) "UCS-4LE" @@ -228,7 +228,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(8) "UTF-16LE" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UTF-7" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UTF-7" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(8) "UTF-16LE" @@ -239,7 +239,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(8) "UTF-16LE" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UTF7-IMAP" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UTF7-IMAP" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(8) "UTF-16LE" @@ -316,7 +316,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(4) "SJIS" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "ISO-2022-JP" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "ISO-2022-JP" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(4) "SJIS" @@ -327,7 +327,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(4) "SJIS" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "JIS" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "JIS" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(4) "SJIS" @@ -481,7 +481,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte2be" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte2be" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -492,7 +492,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte2le" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte2le" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -503,7 +503,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte4be" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte4be" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -514,7 +514,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte4le" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "byte4le" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -525,7 +525,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "BASE64" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "BASE64" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -536,7 +536,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "HTML-ENTITIES" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "HTML-ENTITIES" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -547,7 +547,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "7bit" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "7bit" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -558,7 +558,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(11) "ISO-8859-15" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "8bit" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "8bit" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(11) "ISO-8859-15" @@ -580,7 +580,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-CN" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP936" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP936" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-CN" @@ -591,7 +591,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-CN" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "HZ" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "HZ" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-CN" @@ -613,7 +613,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-TW" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP950" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP950" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-TW" @@ -646,7 +646,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-KR" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UHC" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "UHC" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-KR" @@ -657,7 +657,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-KR" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "ISO-2022-KR" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "ISO-2022-KR" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-KR" @@ -668,7 +668,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-KR" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "Windows-1251" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "Windows-1251" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-KR" @@ -679,7 +679,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-KR" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "Windows-1252" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "Windows-1252" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-KR" @@ -690,7 +690,7 @@ Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the un string(6) "EUC-KR" Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d -mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP866" given +ValueError: mb_regex_encoding(): Argument #1 ($encoding) must be a valid encoding, "CP866" given Deprecated: Function mb_regex_encoding() is deprecated since 8.6, because the underlying library is no longer maintained in %s on line %d string(6) "EUC-KR" diff --git a/ext/mbstring/tests/mb_send_mail_null_bytes.phpt b/ext/mbstring/tests/mb_send_mail_null_bytes.phpt index 572a2932e369..b31afdc07dab 100644 --- a/ext/mbstring/tests/mb_send_mail_null_bytes.phpt +++ b/ext/mbstring/tests/mb_send_mail_null_bytes.phpt @@ -8,33 +8,33 @@ mbstring try { mb_send_mail("foo\0bar", "x", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mb_send_mail("x", "foo\0bar", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mb_send_mail("x", "y", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mb_send_mail("x", "y", "z", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mb_send_mail("x", "y", "z", "q", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -mb_send_mail(): Argument #1 ($to) must not contain any null bytes -mb_send_mail(): Argument #2 ($subject) must not contain any null bytes -mb_send_mail(): Argument #3 ($message) must not contain any null bytes -mb_send_mail(): Argument #4 ($additional_headers) must not contain any null bytes -mb_send_mail(): Argument #5 ($additional_params) must not contain any null bytes +ValueError: mb_send_mail(): Argument #1 ($to) must not contain any null bytes +ValueError: mb_send_mail(): Argument #2 ($subject) must not contain any null bytes +ValueError: mb_send_mail(): Argument #3 ($message) must not contain any null bytes +ValueError: mb_send_mail(): Argument #4 ($additional_headers) must not contain any null bytes +ValueError: mb_send_mail(): Argument #5 ($additional_params) must not contain any null bytes diff --git a/ext/mbstring/tests/mb_str_split_error_conditions.phpt b/ext/mbstring/tests/mb_str_split_error_conditions.phpt index bb307e16fa41..3bd65309ee02 100644 --- a/ext/mbstring/tests/mb_str_split_error_conditions.phpt +++ b/ext/mbstring/tests/mb_str_split_error_conditions.phpt @@ -11,19 +11,19 @@ $string = "日本"; /* 2 chars */ try { mb_str_split($string, 0); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_str_split($string, -5); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } //Invalid Encoding try { mb_str_split($string, 1, "BAD_ENCODING"); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // For UTF-8, error markers are not inserted @@ -48,9 +48,9 @@ echo "[", implode(', ', array_map('bin2hex', $array)), "]\n"; ?> --EXPECT-- -mb_str_split(): Argument #2 ($length) must be greater than 0 -mb_str_split(): Argument #2 ($length) must be greater than 0 -mb_str_split(): Argument #3 ($encoding) must be a valid encoding, "BAD_ENCODING" given +ValueError: mb_str_split(): Argument #2 ($length) must be greater than 0 +ValueError: mb_str_split(): Argument #2 ($length) must be greater than 0 +ValueError: mb_str_split(): Argument #3 ($encoding) must be a valid encoding, "BAD_ENCODING" given == INVALID UTF-8 == [6162, 63ff, 6162, 63] == INVALID HZ == diff --git a/ext/mbstring/tests/mb_str_split_other.phpt b/ext/mbstring/tests/mb_str_split_other.phpt index 4b0f901a9038..2689fb3f316b 100644 --- a/ext/mbstring/tests/mb_str_split_other.phpt +++ b/ext/mbstring/tests/mb_str_split_other.phpt @@ -67,7 +67,7 @@ echo "[", implode(', ', array_map('bin2hex', $array)), "]\n"; try { mb_str_split("abc", 1234567890, "UTF-8"); } catch (ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -124,4 +124,4 @@ try { == Regression tests == [1b28494a4a1b2842, 1b28494a4a1b2842] [5a] -mb_str_split(): Argument #2 ($length) is too large +ValueError: mb_str_split(): Argument #2 ($length) is too large diff --git a/ext/mbstring/tests/mb_str_unknown_encoding.phpt b/ext/mbstring/tests/mb_str_unknown_encoding.phpt index 8092c71ff7d3..e96c81cc85c3 100644 --- a/ext/mbstring/tests/mb_str_unknown_encoding.phpt +++ b/ext/mbstring/tests/mb_str_unknown_encoding.phpt @@ -11,156 +11,156 @@ mbstring try { mb_chr(1, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_convert_case('coudenys', MB_CASE_UPPER, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_convert_encoding('coudenys', 'UTF-8', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_convert_kana('coudenys', 'KV', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_decode_numericentity('coudenys', [], 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_ord('coudenys', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strcut('coudenys', 0, 4, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strimwidth('coudenys', 0, 4, '', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_stripos('coudenys', 'cou', 0, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_stristr('coudenys', 'cou', false, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strlen('coudenys', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strpos('coudenys', 'cou', 0, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strrchr('coudenys', 'cou', false, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strrichr('coudenys', 'cou', false, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strripos('coudenys', 'cou', 0, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strrpos('coudenys', 'cou', 0, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strstr('coudenys', 'cou', false, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strtolower('coudenys', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strtoupper('coudenys', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_strwidth('coudenys', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_substr('coudenys', 0, null, 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { mb_substr_count('coudenys', 'c', 'UTF-0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_chr(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_convert_case(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given -mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "UTF-0" -mb_convert_kana(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given -mb_decode_numericentity(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given -mb_ord(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_strcut(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strimwidth(): Argument #5 ($encoding) must be a valid encoding, "UTF-0" given -mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_stristr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_strpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strrchr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strrichr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strrpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strstr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_strwidth(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given -mb_substr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given -mb_substr_count(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_chr(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_convert_case(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_convert_encoding(): Argument #3 ($from_encoding) contains invalid encoding "UTF-0" +ValueError: mb_convert_kana(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_decode_numericentity(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_ord(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strcut(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strimwidth(): Argument #5 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_stristr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strrchr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strrichr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strripos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strrpos(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strstr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_strwidth(): Argument #2 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_substr(): Argument #4 ($encoding) must be a valid encoding, "UTF-0" given +ValueError: mb_substr_count(): Argument #3 ($encoding) must be a valid encoding, "UTF-0" given diff --git a/ext/mbstring/tests/mb_strimwidth.phpt b/ext/mbstring/tests/mb_strimwidth.phpt index 90c073b32625..77da5d890ff4 100644 --- a/ext/mbstring/tests/mb_strimwidth.phpt +++ b/ext/mbstring/tests/mb_strimwidth.phpt @@ -125,23 +125,23 @@ try { // We also suppress the deprecation for negative width as of PHP 8.3 var_dump(@mb_strimwidth($euc_jp, 0, -100,'...','EUC-JP')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strimwidth($euc_jp, 100, 10,'...','EUC-JP')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strimwidth($euc_jp, -100, 10,'...','EUC-JP')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // We also suppress the deprecation for negative width as of PHP 8.3 var_dump(@mb_strimwidth($euc_jp, -10, -21,'...','EUC-JP')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n== Other ==\n"; @@ -254,10 +254,10 @@ start=15 width=-5 result=[a1a3 45 55 43 2d 4a 50 a4f2 bbc8 a4c3 a4c6 a4a4 a4de a start=-30 width=-25 result=[a4cf c6fc cbdc b8ec a4c7 a4b9 a1a3 45 55 43 2d 4a 50 a4f2 bbc8 a4c3 2e 2e 2e] length=19 width=29 start=39 width=10 result=[] length=0 width=0 start=-10 width=-12 result=[a1a3 c6fc 2e 2e 2e] length=5 width=7 -mb_strimwidth(): Argument #3 ($width) is out of range -mb_strimwidth(): Argument #2 ($start) is out of range -mb_strimwidth(): Argument #2 ($start) is out of range -mb_strimwidth(): Argument #3 ($width) is out of range +ValueError: mb_strimwidth(): Argument #3 ($width) is out of range +ValueError: mb_strimwidth(): Argument #2 ($start) is out of range +ValueError: mb_strimwidth(): Argument #2 ($start) is out of range +ValueError: mb_strimwidth(): Argument #3 ($width) is out of range == Other == start=1 width=0 result=[2e 2e 2e] length=3 width=3 diff --git a/ext/mbstring/tests/mb_stripos_empty_needle.phpt b/ext/mbstring/tests/mb_stripos_empty_needle.phpt index b9155b2d9eeb..ed5a0bb2f623 100644 --- a/ext/mbstring/tests/mb_stripos_empty_needle.phpt +++ b/ext/mbstring/tests/mb_stripos_empty_needle.phpt @@ -24,14 +24,14 @@ echo "\n-- ASCII string with out of bound positive offset --\n"; try { var_dump(mb_stripos($string_ascii, '', 150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- ASCII string with out of bound negative offset --\n"; try { var_dump(mb_stripos($string_ascii, '', -150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -48,14 +48,14 @@ echo "\n-- Multi-byte string with out of bound positive offset --\n"; try { var_dump(mb_stripos($string_mb, '', 150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Multi-byte string with out of bound negative offset --\n"; try { var_dump(mb_stripos($string_mb, '', -150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -70,10 +70,10 @@ int(2) int(5) -- ASCII string with out of bound positive offset -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- ASCII string with out of bound negative offset -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string without offset -- int(0) @@ -85,7 +85,7 @@ int(2) int(19) -- Multi-byte string with out of bound positive offset -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string with out of bound negative offset -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_stripos_error2.phpt b/ext/mbstring/tests/mb_stripos_error2.phpt index 27c516df35dd..832ab879cb5d 100644 --- a/ext/mbstring/tests/mb_stripos_error2.phpt +++ b/ext/mbstring/tests/mb_stripos_error2.phpt @@ -17,10 +17,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_stripos($haystack, $needle, $offset, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_stripos() : error conditions *** -mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_stripos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_stripos_invalid_offset.phpt b/ext/mbstring/tests/mb_stripos_invalid_offset.phpt index d70a38b96544..ad7b847c28d0 100644 --- a/ext/mbstring/tests/mb_stripos_invalid_offset.phpt +++ b/ext/mbstring/tests/mb_stripos_invalid_offset.phpt @@ -21,74 +21,74 @@ print ("== INVALID OFFSET ==\n"); try { var_dump( mb_stripos($string, '日本語', 44)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_stripos($string, '日本語', 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_stripos($string, '0', 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, 3, 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, 0, 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, '日本語', -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, '0', -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, 3, -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, 0, -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos($string, 0, -44)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- String len: 42 == INVALID OFFSET == -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt b/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt index eb8aa862a528..becc1447e07e 100644 --- a/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt +++ b/ext/mbstring/tests/mb_stripos_variation5_Bug45923.phpt @@ -31,13 +31,13 @@ for ($i = -30; $i <= 60; $i += 10) { try { var_dump(mb_stripos($string_ascii, $needle_ascii, $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "--Multibyte String --\n"; try { var_dump(mb_stripos($string_mb, $needle_mb, $i, 'UTF-8')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -47,9 +47,9 @@ for ($i = -30; $i <= 60; $i += 10) { **-- Offset is: -30 --** -- ASCII String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: -20 --** -- ASCII String -- @@ -83,24 +83,24 @@ int(20) **-- Offset is: 30 --** -- ASCII String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 40 --** -- ASCII String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 50 --** -- ASCII String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 60 --** -- ASCII String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_stristr_error2.phpt b/ext/mbstring/tests/mb_stristr_error2.phpt index 3efbe2218520..d8c777d3cf31 100644 --- a/ext/mbstring/tests/mb_stristr_error2.phpt +++ b/ext/mbstring/tests/mb_stristr_error2.phpt @@ -16,7 +16,7 @@ $part = true; try { var_dump( mb_stristr($haystack, $needle, $part, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -24,4 +24,4 @@ try { *** Testing mb_stristr() : error conditions *** -- Testing mb_stristr() with unknown encoding -- -mb_stristr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_stristr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strlen.phpt b/ext/mbstring/tests/mb_strlen.phpt index c8279a3c8bfd..550ad6ceb466 100644 --- a/ext/mbstring/tests/mb_strlen.phpt +++ b/ext/mbstring/tests/mb_strlen.phpt @@ -97,7 +97,7 @@ mb_internal_encoding('EUC-JP'); try { var_dump( mb_strlen($euc_jp, 'BAD_NAME') ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -147,4 +147,4 @@ try { 2300 2048 == WRONG PARAMETERS == -mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "BAD_NAME" given +ValueError: mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "BAD_NAME" given diff --git a/ext/mbstring/tests/mb_strlen_error2.phpt b/ext/mbstring/tests/mb_strlen_error2.phpt index fc680a4d46b0..bf3394767138 100644 --- a/ext/mbstring/tests/mb_strlen_error2.phpt +++ b/ext/mbstring/tests/mb_strlen_error2.phpt @@ -17,10 +17,10 @@ $encoding = 'unknown-encoding'; try { var_dump(mb_strlen($string, $encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strlen() : error *** -mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strlen(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strpos_empty_needle.phpt b/ext/mbstring/tests/mb_strpos_empty_needle.phpt index 0cabbf805079..060153361558 100644 --- a/ext/mbstring/tests/mb_strpos_empty_needle.phpt +++ b/ext/mbstring/tests/mb_strpos_empty_needle.phpt @@ -24,14 +24,14 @@ echo "\n-- ASCII string with out of bound positive offset --\n"; try { var_dump(mb_strpos($string_ascii, '', 15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- ASCII string with out of bound negative offset --\n"; try { var_dump(mb_strpos($string_ascii, '', -15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Multi-byte string without offset --\n"; @@ -47,14 +47,14 @@ echo "\n-- Multi-byte string with out of bound positive offset --\n"; try { var_dump(mb_strpos($string_mb, '', 150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Multi-byte string with out of bound negative offset --\n"; try { var_dump(mb_strpos($string_mb, '', -150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -69,10 +69,10 @@ int(2) int(5) -- ASCII string with out of bound positive offset -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- ASCII string with out of bound negative offset -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string without offset -- int(0) @@ -84,7 +84,7 @@ int(2) int(19) -- Multi-byte string with out of bound positive offset -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string with out of bound negative offset -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strpos_error2.phpt b/ext/mbstring/tests/mb_strpos_error2.phpt index ceabe285acff..7424e4c1b076 100644 --- a/ext/mbstring/tests/mb_strpos_error2.phpt +++ b/ext/mbstring/tests/mb_strpos_error2.phpt @@ -17,10 +17,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_strpos($haystack, $needle, $offset, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strpos() : error conditions *** -mb_strpos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strpos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strpos_invalid_offset.phpt b/ext/mbstring/tests/mb_strpos_invalid_offset.phpt index fd5b7ba61e87..5cafe623718b 100644 --- a/ext/mbstring/tests/mb_strpos_invalid_offset.phpt +++ b/ext/mbstring/tests/mb_strpos_invalid_offset.phpt @@ -21,74 +21,74 @@ print ("== INVALID OFFSET ==\n"); try { var_dump( mb_strpos($string, '日本語', 44)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_strpos($string, '日本語', 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( mb_strpos($string, '0', 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, 3, 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, 0, 50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, '日本語', -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, '0', -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, 3, -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, 0, -50)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos($string, 0, -44)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- String len: 42 == INVALID OFFSET == -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strpos_offset_errors.phpt b/ext/mbstring/tests/mb_strpos_offset_errors.phpt index 21fd260c3d3f..98667b769625 100644 --- a/ext/mbstring/tests/mb_strpos_offset_errors.phpt +++ b/ext/mbstring/tests/mb_strpos_offset_errors.phpt @@ -8,51 +8,51 @@ mbstring try { var_dump(mb_strpos("f", "bar", 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strpos("f", "bar", -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strrpos("f", "bar", 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strrpos("f", "bar", -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos("f", "bar", 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_stripos("f", "bar", -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strripos("f", "bar", 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_strripos("f", "bar", -3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strpos_variation5.phpt b/ext/mbstring/tests/mb_strpos_variation5.phpt index bb2072aa36cd..4b837277c763 100644 --- a/ext/mbstring/tests/mb_strpos_variation5.phpt +++ b/ext/mbstring/tests/mb_strpos_variation5.phpt @@ -30,14 +30,14 @@ for ($i = -30; $i <= 60; $i += 10) { try { var_dump(mb_strpos($string_ascii, $needle_ascii, $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "--Multibyte String --\n"; try { var_dump(mb_strpos($string_mb, $needle_mb, $i, 'UTF-8')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -47,9 +47,9 @@ for ($i = -30; $i <= 60; $i += 10) { **-- Offset is: -30 --** -- ASCII String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: -20 --** -- ASCII String -- @@ -83,24 +83,24 @@ int(20) **-- Offset is: 30 --** -- ASCII String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 40 --** -- ASCII String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 50 --** -- ASCII String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 60 --** -- ASCII String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strrchr_error2.phpt b/ext/mbstring/tests/mb_strrchr_error2.phpt index 453b319a2049..a9cef8acf820 100644 --- a/ext/mbstring/tests/mb_strrchr_error2.phpt +++ b/ext/mbstring/tests/mb_strrchr_error2.phpt @@ -16,7 +16,7 @@ $part = true; try { var_dump( mb_strrchr($haystack, $needle, $part, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -24,4 +24,4 @@ try { *** Testing mb_strrchr() : error conditions *** -- Testing mb_strrchr() with unknown encoding -- -mb_strrchr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strrchr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strrichr_error2.phpt b/ext/mbstring/tests/mb_strrichr_error2.phpt index a0caa222bb9f..a699e0789b0d 100644 --- a/ext/mbstring/tests/mb_strrichr_error2.phpt +++ b/ext/mbstring/tests/mb_strrichr_error2.phpt @@ -16,7 +16,7 @@ $part = true; try { var_dump( mb_strrichr($haystack, $needle, $part, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -24,4 +24,4 @@ try { *** Testing mb_strrichr() : error conditions *** -- Testing mb_strrichr() with unknown encoding -- -mb_strrichr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strrichr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strripos_empty_needle.phpt b/ext/mbstring/tests/mb_strripos_empty_needle.phpt index 96de7ca6b207..4e3b38bf021f 100644 --- a/ext/mbstring/tests/mb_strripos_empty_needle.phpt +++ b/ext/mbstring/tests/mb_strripos_empty_needle.phpt @@ -24,14 +24,14 @@ echo "\n-- ASCII string with out of bound positive offset --\n"; try { var_dump(mb_strripos($string_ascii, '', 15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- ASCII string with out of bound negative offset --\n"; try { var_dump(mb_strripos($string_ascii, '', -15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -48,14 +48,14 @@ echo "\n-- Multi-byte string with out of bound positive offset --\n"; try { var_dump(mb_strripos($string_mb, '', 150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Multi-byte string with out of bound negative offset --\n"; try { var_dump(mb_strripos($string_mb, '', -150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -70,10 +70,10 @@ int(7) int(5) -- ASCII string with out of bound positive offset -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- ASCII string with out of bound negative offset -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string without offset -- int(21) @@ -85,7 +85,7 @@ int(21) int(19) -- Multi-byte string with out of bound positive offset -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string with out of bound negative offset -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strripos_error2.phpt b/ext/mbstring/tests/mb_strripos_error2.phpt index 8525a1b90bf2..cd736de7cc87 100644 --- a/ext/mbstring/tests/mb_strripos_error2.phpt +++ b/ext/mbstring/tests/mb_strripos_error2.phpt @@ -17,10 +17,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_strripos($haystack, $needle, $offset, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strripos() : error conditions *** -mb_strripos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strripos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt b/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt index e8bbcff1fb30..0a0acf715b53 100644 --- a/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt +++ b/ext/mbstring/tests/mb_strripos_variation5_Bug45923.phpt @@ -31,14 +31,14 @@ for ($i = -10; $i <= 60; $i += 10) { try { var_dump(mb_strripos($string_ascii, $needle_ascii, $i)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "--Multibyte String --\n"; try { var_dump(mb_strripos($string_mb, $needle_mb, $i, 'UTF-8')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -72,24 +72,24 @@ int(20) **-- Offset is: 30 --** -- ASCII String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 40 --** -- ASCII String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 50 --** -- ASCII String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) **-- Offset is: 60 --** -- ASCII String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) --Multibyte String -- -mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strrpos_empty_needle.phpt b/ext/mbstring/tests/mb_strrpos_empty_needle.phpt index 7c762d028bdb..4d69b4f1295d 100644 --- a/ext/mbstring/tests/mb_strrpos_empty_needle.phpt +++ b/ext/mbstring/tests/mb_strrpos_empty_needle.phpt @@ -24,14 +24,14 @@ echo "\n-- ASCII string with out of bound positive offset --\n"; try { var_dump(mb_strrpos($string_ascii, '', 15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- ASCII string with out of bound negative offset --\n"; try { var_dump(mb_strrpos($string_ascii, '', -15)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -48,14 +48,14 @@ echo "\n-- Multi-byte string with out of bound positive offset --\n"; try { var_dump(mb_strrpos($string_mb, '', 150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Multi-byte string with out of bound negative offset --\n"; try { var_dump(mb_strrpos($string_mb, '', -150)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -70,10 +70,10 @@ int(7) int(5) -- ASCII string with out of bound positive offset -- -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- ASCII string with out of bound negative offset -- -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string without offset -- int(21) @@ -85,7 +85,7 @@ int(21) int(19) -- Multi-byte string with out of bound positive offset -- -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Multi-byte string with out of bound negative offset -- -mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: mb_strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/mbstring/tests/mb_strrpos_error2.phpt b/ext/mbstring/tests/mb_strrpos_error2.phpt index 17d2927987c0..836b8b7671c2 100644 --- a/ext/mbstring/tests/mb_strrpos_error2.phpt +++ b/ext/mbstring/tests/mb_strrpos_error2.phpt @@ -18,10 +18,10 @@ $encoding = 'unknown-encoding'; try { var_dump(mb_strrpos($haystack, $needle , $offset, $encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strrpos() : error conditions *** -mb_strrpos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strrpos(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strstr_error2.phpt b/ext/mbstring/tests/mb_strstr_error2.phpt index f798a35592a0..4ba88e929732 100644 --- a/ext/mbstring/tests/mb_strstr_error2.phpt +++ b/ext/mbstring/tests/mb_strstr_error2.phpt @@ -16,7 +16,7 @@ $part = true; try { var_dump( mb_strstr($haystack, $needle, $part, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -24,4 +24,4 @@ try { *** Testing mb_strstr() : error conditions *** -- Testing mb_strstr() with unknown encoding -- -mb_strstr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strstr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strtolower_error2.phpt b/ext/mbstring/tests/mb_strtolower_error2.phpt index cbe4df5ca626..6b21d3767520 100644 --- a/ext/mbstring/tests/mb_strtolower_error2.phpt +++ b/ext/mbstring/tests/mb_strtolower_error2.phpt @@ -16,10 +16,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_strtolower($sourcestring, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strtolower() : error conditions*** -mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strtolower(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_strtoupper_error2.phpt b/ext/mbstring/tests/mb_strtoupper_error2.phpt index 75de762e4be4..97aa58cef597 100644 --- a/ext/mbstring/tests/mb_strtoupper_error2.phpt +++ b/ext/mbstring/tests/mb_strtoupper_error2.phpt @@ -16,10 +16,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_strtoupper($sourcestring, $encoding) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_strtoupper() : error conditions *** -mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_strtoupper(): Argument #2 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_substitute_character.phpt b/ext/mbstring/tests/mb_substitute_character.phpt index 2dd791cbd642..5568e34258cf 100644 --- a/ext/mbstring/tests/mb_substitute_character.phpt +++ b/ext/mbstring/tests/mb_substitute_character.phpt @@ -26,7 +26,7 @@ var_dump(bin2hex(mb_convert_encoding("\xe2\x99\xa0\xe3\x81\x82", "CP932", "UTF-8 try { var_dump(mb_substitute_character('BAD_NAME')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -42,4 +42,4 @@ string(4) "82a0" bool(true) string(6) "entity" string(20) "262378323636303b82a0" -mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint +ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint diff --git a/ext/mbstring/tests/mb_substitute_character_basic.phpt b/ext/mbstring/tests/mb_substitute_character_basic.phpt index 92f6c9bb8144..8099abde9fc2 100644 --- a/ext/mbstring/tests/mb_substitute_character_basic.phpt +++ b/ext/mbstring/tests/mb_substitute_character_basic.phpt @@ -21,7 +21,7 @@ var_dump( mb_substitute_character() ); try { var_dump( mb_substitute_character("b") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -36,4 +36,4 @@ bool(true) string(4) "none" bool(true) string(4) "long" -mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint +ValueError: mb_substitute_character(): Argument #1 ($substitute_character) must be "none", "long", "entity" or a valid codepoint diff --git a/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt b/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt index 9badcb95cf20..269e6fa7a88a 100644 --- a/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt +++ b/ext/mbstring/tests/mb_substitute_character_variation_strict_types.phpt @@ -100,7 +100,7 @@ foreach($inputs as $key =>$value) { try { var_dump( mb_substitute_character($value) ); } catch (\ValueError|\TypeError $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } diff --git a/ext/mbstring/tests/mb_substr_count.phpt b/ext/mbstring/tests/mb_substr_count.phpt index 872f03f92f8c..4e38deb27f25 100644 --- a/ext/mbstring/tests/mb_substr_count.phpt +++ b/ext/mbstring/tests/mb_substr_count.phpt @@ -12,19 +12,19 @@ internal_encoding=EUC-JP try { var_dump(mb_substr_count("", "")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(mb_substr_count("��", "")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // Although the needle below contains 3 bytes, it decodes to zero Unicode codepoints // So the needle is actually 'empty', although it doesn't appear so var_dump(mb_substr_count("abcdef", "\x1B(B", "ISO-2022-JP")); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } print "== Return value for empty haystack should always be zero ==\n"; @@ -69,9 +69,9 @@ internal_encoding=EUC-JP ?> --EXPECT-- == Empty needle should raise an error == -mb_substr_count(): Argument #2 ($needle) must not be empty -mb_substr_count(): Argument #2 ($needle) must not be empty -mb_substr_count(): Argument #2 ($needle) must not be empty +ValueError: mb_substr_count(): Argument #2 ($needle) must not be empty +ValueError: mb_substr_count(): Argument #2 ($needle) must not be empty +ValueError: mb_substr_count(): Argument #2 ($needle) must not be empty == Return value for empty haystack should always be zero == int(0) int(0) diff --git a/ext/mbstring/tests/mb_substr_count_error2.phpt b/ext/mbstring/tests/mb_substr_count_error2.phpt index 489319e408da..07686a70f6d6 100644 --- a/ext/mbstring/tests/mb_substr_count_error2.phpt +++ b/ext/mbstring/tests/mb_substr_count_error2.phpt @@ -16,7 +16,7 @@ echo "\n-- Testing mb_substr_count() function with an unknown encoding --\n"; try { var_dump(mb_substr_count($haystack, $needle, $encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -24,4 +24,4 @@ try { *** Testing mb_substr_count() : error conditions *** -- Testing mb_substr_count() function with an unknown encoding -- -mb_substr_count(): Argument #3 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_substr_count(): Argument #3 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_substr_error2.phpt b/ext/mbstring/tests/mb_substr_error2.phpt index c0849a32b441..38c9a2a29f99 100644 --- a/ext/mbstring/tests/mb_substr_error2.phpt +++ b/ext/mbstring/tests/mb_substr_error2.phpt @@ -18,10 +18,10 @@ $encoding = 'unknown-encoding'; try { var_dump( mb_substr($str, $start, $length, $encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing mb_substr() : error conditions *** -mb_substr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given +ValueError: mb_substr(): Argument #4 ($encoding) must be a valid encoding, "unknown-encoding" given diff --git a/ext/mbstring/tests/mb_trim.phpt b/ext/mbstring/tests/mb_trim.phpt index 7133e327f826..1059c7d3d331 100644 --- a/ext/mbstring/tests/mb_trim.phpt +++ b/ext/mbstring/tests/mb_trim.phpt @@ -78,7 +78,7 @@ echo "== \$encoding throws ValueError ==\n"; try { var_dump(mb_trim( "\u{180F}", "", "NULL")); } catch (ValueError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -136,4 +136,4 @@ string(3) "あ" == Same strings == string(1) "f" == $encoding throws ValueError == -string(73) "mb_trim(): Argument #3 ($encoding) must be a valid encoding, "NULL" given" +ValueError: mb_trim(): Argument #3 ($encoding) must be a valid encoding, "NULL" given diff --git a/ext/mysqli/tests/bug36802.phpt b/ext/mysqli/tests/bug36802.phpt index 47642087acb3..fdfc37d862be 100644 --- a/ext/mysqli/tests/bug36802.phpt +++ b/ext/mysqli/tests/bug36802.phpt @@ -18,7 +18,7 @@ mysqli try { $mysql->set_charset('utf8'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } else { $x[0] = false; @@ -27,7 +27,7 @@ mysqli try { $mysql->query("SELECT 'foo' FROM DUAL"); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* following operations should work */ @@ -39,8 +39,8 @@ mysqli var_dump($x); ?> --EXPECT-- -mysqli object is not fully initialized -mysqli object is not fully initialized +Error: mysqli object is not fully initialized +Error: mysqli object is not fully initialized array(2) { [1]=> string(0) "" diff --git a/ext/mysqli/tests/bug62885.phpt b/ext/mysqli/tests/bug62885.phpt index 8666795bd87c..9d2585b2fce7 100644 --- a/ext/mysqli/tests/bug62885.phpt +++ b/ext/mysqli/tests/bug62885.phpt @@ -13,19 +13,19 @@ $tablica = array(); try { $test1 = mysqli_poll($test2, $test3, $tablica, 0); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $test2 = array(); try { $test1 = mysqli_poll($test2, $test3, $tablica, 0); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "okey"; ?> --EXPECTF-- -No stream arrays were passed +ValueError: No stream arrays were passed Warning: mysqli_poll(): No stream arrays were passed in %s on line %d okey diff --git a/ext/mysqli/tests/gh17900.phpt b/ext/mysqli/tests/gh17900.phpt index ed099fa7e852..90aa3d7edfe0 100644 --- a/ext/mysqli/tests/gh17900.phpt +++ b/ext/mysqli/tests/gh17900.phpt @@ -9,8 +9,8 @@ $mysqli = new mysqli(); try { $mysqli->__construct('doesnotexist'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot call constructor twice +Error: Cannot call constructor twice diff --git a/ext/mysqli/tests/ghsa-h35g-vwh6-m678-auth-message.phpt b/ext/mysqli/tests/ghsa-h35g-vwh6-m678-auth-message.phpt index 666f47f4199f..84c38dd862db 100644 --- a/ext/mysqli/tests/ghsa-h35g-vwh6-m678-auth-message.phpt +++ b/ext/mysqli/tests/ghsa-h35g-vwh6-m678-auth-message.phpt @@ -18,7 +18,7 @@ try { $info = mysqli_info($conn); var_dump($info); } catch (Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $process->terminate(); @@ -33,5 +33,5 @@ print "done!"; [*] Sending - Malicious OK Auth Response [Extract heap through buffer over-read]: 0900000200000002000000fcff Warning: mysqli::__construct(): OK packet message length is past the packet size in %s on line %d -Unknown error while trying to connect via tcp://127.0.0.1:%d +mysqli_sql_exception: Unknown error while trying to connect via tcp://127.0.0.1:%d done! diff --git a/ext/mysqli/tests/mysqli_driver/write_property.phpt b/ext/mysqli/tests/mysqli_driver/write_property.phpt index 456dd40c81df..7bb41440b39f 100644 --- a/ext/mysqli/tests/mysqli_driver/write_property.phpt +++ b/ext/mysqli/tests/mysqli_driver/write_property.phpt @@ -10,7 +10,7 @@ try { /* Read-only property */ $driver->client_info = 'test'; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $driver->report_mode = "1"; @@ -18,11 +18,11 @@ var_dump($driver->report_mode); try { $driver->report_mode = []; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot write read-only property mysqli_driver::$client_info +Error: Cannot write read-only property mysqli_driver::$client_info int(1) -Cannot assign array to property mysqli_driver::$report_mode of type int +TypeError: Cannot assign array to property mysqli_driver::$report_mode of type int diff --git a/ext/mysqli/tests/mysqli_driver/write_property_strict.phpt b/ext/mysqli/tests/mysqli_driver/write_property_strict.phpt index 41645ff61c28..996048ac1f34 100644 --- a/ext/mysqli/tests/mysqli_driver/write_property_strict.phpt +++ b/ext/mysqli/tests/mysqli_driver/write_property_strict.phpt @@ -12,16 +12,16 @@ try { /* Read-only property */ $driver->client_info = 42; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $driver->report_mode = "1"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot write read-only property mysqli_driver::$client_info -Cannot assign string to property mysqli_driver::$report_mode of type int +Error: Cannot write read-only property mysqli_driver::$client_info +TypeError: Cannot assign string to property mysqli_driver::$report_mode of type int diff --git a/ext/mysqli/tests/mysqli_driver_unclonable.phpt b/ext/mysqli/tests/mysqli_driver_unclonable.phpt index 7041a024f67c..94065a1379df 100644 --- a/ext/mysqli/tests/mysqli_driver_unclonable.phpt +++ b/ext/mysqli/tests/mysqli_driver_unclonable.phpt @@ -9,7 +9,7 @@ try { $driver = new mysqli_driver; $driver_clone = clone $driver; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/odbc/tests/bug78473.phpt b/ext/odbc/tests/bug78473.phpt index 9313237efde2..7c909d882cb6 100644 --- a/ext/odbc/tests/bug78473.phpt +++ b/ext/odbc/tests/bug78473.phpt @@ -7,10 +7,10 @@ odbc try { odbc_close(STDIN); } catch (TypeError $err) { - echo $err->getMessage(), PHP_EOL; + echo $err::class, ': ', $err->getMessage(), PHP_EOL; } var_dump(STDIN); ?> --EXPECT-- -odbc_close(): Argument #1 ($odbc) must be of type Odbc\Connection, resource given +TypeError: odbc_close(): Argument #1 ($odbc) must be of type Odbc\Connection, resource given resource(1) of type (stream) diff --git a/ext/opcache/tests/assign_obj_exceptions.phpt b/ext/opcache/tests/assign_obj_exceptions.phpt index ffcebede37b0..f8e1d4802faa 100644 --- a/ext/opcache/tests/assign_obj_exceptions.phpt +++ b/ext/opcache/tests/assign_obj_exceptions.phpt @@ -27,21 +27,21 @@ function test_invalid_obj_type($c) { try { test_invalid_prop_type(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_invalid_prop_name("\0"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_invalid_obj_type(false); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign string to property Test::$x of type stdClass -Cannot access property starting with "\0" -Attempt to assign property "x" on null +TypeError: Cannot assign string to property Test::$x of type stdClass +Error: Cannot access property starting with "\0" +Error: Attempt to assign property "x" on null diff --git a/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt index 1f42c3ac2aeb..0ccf6816e35b 100644 --- a/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt +++ b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt @@ -13,10 +13,10 @@ function test() { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined array key 0 in %s on line %d -Attempt to assign property "y" on null +Error: Attempt to assign property "y" on null diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt index 00c9551e974c..108d28d59a3f 100644 --- a/ext/opcache/tests/bug68104.phpt +++ b/ext/opcache/tests/bug68104.phpt @@ -18,9 +18,9 @@ var_dump(is_callable("dl")); try { dl("a.so"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -Call to undefined function dl() +Error: Call to undefined function dl() diff --git a/ext/opcache/tests/bug76796.phpt b/ext/opcache/tests/bug76796.phpt index b9efbc3ce70f..ae852df3d8ac 100644 --- a/ext/opcache/tests/bug76796.phpt +++ b/ext/opcache/tests/bug76796.phpt @@ -13,9 +13,9 @@ opcache try { var_dump(strpos('foo', 'bar')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to undefined function strpos() +Error: Call to undefined function strpos() diff --git a/ext/opcache/tests/bug78185.phpt b/ext/opcache/tests/bug78185.phpt index d8f2b00977ec..b671039a19be 100644 --- a/ext/opcache/tests/bug78185.phpt +++ b/ext/opcache/tests/bug78185.phpt @@ -38,4 +38,3 @@ foreach (glob($pattern) as $p) { ?> --EXPECTF-- string(%d) "%s78185.php.bin" - diff --git a/ext/opcache/tests/get_configuration_matches_ini.phpt b/ext/opcache/tests/get_configuration_matches_ini.phpt index 8e29614acad6..07d7f1044567 100644 --- a/ext/opcache/tests/get_configuration_matches_ini.phpt +++ b/ext/opcache/tests/get_configuration_matches_ini.phpt @@ -14,4 +14,4 @@ var_dump(array_diff_key($inis, $opts)); ?> --EXPECT-- array(0) { -} \ No newline at end of file +} diff --git a/ext/opcache/tests/gh13817.phpt b/ext/opcache/tests/gh13817.phpt index 0e5eb560d46f..140b6d836320 100644 --- a/ext/opcache/tests/gh13817.phpt +++ b/ext/opcache/tests/gh13817.phpt @@ -48,4 +48,3 @@ Ok - diff --git a/ext/opcache/tests/gh17422/002.phpt b/ext/opcache/tests/gh17422/002.phpt index 6145f71a8e58..3bc5ff3199f3 100644 --- a/ext/opcache/tests/gh17422/002.phpt +++ b/ext/opcache/tests/gh17422/002.phpt @@ -10,12 +10,12 @@ set_error_handler(static function (int $errno, string $errstr, string $errfile, try { require __DIR__ . "/warning.inc"; } catch (\Exception $e) { - echo "Caught: ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } warning(); ?> --EXPECT-- -Caught: "continue" targeting switch is equivalent to "break" +ErrorException: "continue" targeting switch is equivalent to "break" OK: warning diff --git a/ext/opcache/tests/gh20628_borked_live_range_calc.phpt b/ext/opcache/tests/gh20628_borked_live_range_calc.phpt index f0b6ccfc92c8..741cb8ea3fff 100644 --- a/ext/opcache/tests/gh20628_borked_live_range_calc.phpt +++ b/ext/opcache/tests/gh20628_borked_live_range_calc.phpt @@ -15,9 +15,9 @@ function test($cond) { try { test(true); } catch (Throwable $e) { - echo $e::class, $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ReflectionExceptionClass "non" does not exist +ReflectionException: Class "non" does not exist diff --git a/ext/opcache/tests/inc_array.phpt b/ext/opcache/tests/inc_array.phpt index 223554448164..56bb43dc48e8 100644 --- a/ext/opcache/tests/inc_array.phpt +++ b/ext/opcache/tests/inc_array.phpt @@ -14,14 +14,14 @@ function test_inc_partial_array($k) { try { test_inc_array(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_inc_partial_array(0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot increment array -Cannot increment array +TypeError: Cannot increment array +TypeError: Cannot increment array diff --git a/ext/opcache/tests/invalid_new_dce.phpt b/ext/opcache/tests/invalid_new_dce.phpt index 4f31c8049c9c..a58210a13979 100644 --- a/ext/opcache/tests/invalid_new_dce.phpt +++ b/ext/opcache/tests/invalid_new_dce.phpt @@ -29,14 +29,14 @@ function test4() { $x = new Abc; } -try { test1(); } catch (Error $e) { echo $e->getMessage(), "\n"; } -try { test2(); } catch (Error $e) { echo $e->getMessage(), "\n"; } -try { test3(); } catch (Error $e) { echo $e->getMessage(), "\n"; } -try { test4(); } catch (Error $e) { echo $e->getMessage(), "\n"; } +try { test1(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } +try { test2(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } +try { test3(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } +try { test4(); } catch (Error $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate abstract class Foo -Cannot instantiate interface Bar -Cannot instantiate trait Baz -Cannot declare self-referencing constant Abc::BAR +Error: Cannot instantiate abstract class Foo +Error: Cannot instantiate interface Bar +Error: Cannot instantiate trait Baz +Error: Cannot declare self-referencing constant Abc::BAR diff --git a/ext/opcache/tests/issue0057.phpt b/ext/opcache/tests/issue0057.phpt index ac73859b0d36..97984025f689 100644 --- a/ext/opcache/tests/issue0057.phpt +++ b/ext/opcache/tests/issue0057.phpt @@ -30,9 +30,9 @@ function dummy($query) { try { dummy(0); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -exception +Exception: exception diff --git a/ext/opcache/tests/jit/add_011.phpt b/ext/opcache/tests/jit/add_011.phpt index 17bd7be99d15..898759b0a894 100644 --- a/ext/opcache/tests/jit/add_011.phpt +++ b/ext/opcache/tests/jit/add_011.phpt @@ -197,4 +197,3 @@ Warning: Undefined variable $u in %sadd_011.php on line 5 Warning: The float %f is not representable as an int, cast occurred in %sadd_011.php on line 5 int(66572500992) - diff --git a/ext/opcache/tests/jit/add_012.phpt b/ext/opcache/tests/jit/add_012.phpt index 707b795f5e03..87ae095f38f1 100644 --- a/ext/opcache/tests/jit/add_012.phpt +++ b/ext/opcache/tests/jit/add_012.phpt @@ -15,4 +15,4 @@ $y[$x] += 4467793343; ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/add_013.phpt b/ext/opcache/tests/jit/add_013.phpt index 9bac9ad51036..ef28c70da26b 100644 --- a/ext/opcache/tests/jit/add_013.phpt +++ b/ext/opcache/tests/jit/add_013.phpt @@ -16,4 +16,4 @@ function y(){ ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/add_014.phpt b/ext/opcache/tests/jit/add_014.phpt index 7f4b96229ad4..a620cc9b392d 100644 --- a/ext/opcache/tests/jit/add_014.phpt +++ b/ext/opcache/tests/jit/add_014.phpt @@ -17,8 +17,8 @@ function test() { try { @test(); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/add_015.phpt b/ext/opcache/tests/jit/add_015.phpt index 6fcded2fe1f5..8322cf1213c7 100644 --- a/ext/opcache/tests/jit/add_015.phpt +++ b/ext/opcache/tests/jit/add_015.phpt @@ -19,4 +19,4 @@ function test() { ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/assign_018.phpt b/ext/opcache/tests/jit/assign_018.phpt index a0c29320ab18..b5ba2a4989e9 100644 --- a/ext/opcache/tests/jit/assign_018.phpt +++ b/ext/opcache/tests/jit/assign_018.phpt @@ -23,4 +23,3 @@ foo(); int(2) array(0) { } - diff --git a/ext/opcache/tests/jit/assign_040.phpt b/ext/opcache/tests/jit/assign_040.phpt index 73eecfe2e109..c41bbf653fc5 100644 --- a/ext/opcache/tests/jit/assign_040.phpt +++ b/ext/opcache/tests/jit/assign_040.phpt @@ -19,9 +19,9 @@ function test() { try { test(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $y in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string diff --git a/ext/opcache/tests/jit/assign_041.phpt b/ext/opcache/tests/jit/assign_041.phpt index e7e2914875a8..7e4ffeee4db0 100644 --- a/ext/opcache/tests/jit/assign_041.phpt +++ b/ext/opcache/tests/jit/assign_041.phpt @@ -18,4 +18,4 @@ function test($val) { test(0); ?> --EXPECT-- -string(1) "0" \ No newline at end of file +string(1) "0" diff --git a/ext/opcache/tests/jit/assign_043.phpt b/ext/opcache/tests/jit/assign_043.phpt index edb0cb212ab0..1ac5fe5ed283 100644 --- a/ext/opcache/tests/jit/assign_043.phpt +++ b/ext/opcache/tests/jit/assign_043.phpt @@ -14,8 +14,8 @@ try { $a = $b; NOT_REACHED; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $b +Exception: Undefined variable $b diff --git a/ext/opcache/tests/jit/assign_044.phpt b/ext/opcache/tests/jit/assign_044.phpt index e30483d2caec..312aaa3ab9c1 100644 --- a/ext/opcache/tests/jit/assign_044.phpt +++ b/ext/opcache/tests/jit/assign_044.phpt @@ -17,4 +17,3 @@ test(false); ?> --EXPECT-- float(INF) - diff --git a/ext/opcache/tests/jit/assign_045.phpt b/ext/opcache/tests/jit/assign_045.phpt index 8c8f6fc99091..2f15ec62595e 100644 --- a/ext/opcache/tests/jit/assign_045.phpt +++ b/ext/opcache/tests/jit/assign_045.phpt @@ -15,4 +15,3 @@ test(null, 1); ?> --EXPECT-- int(1) - diff --git a/ext/opcache/tests/jit/assign_047.phpt b/ext/opcache/tests/jit/assign_047.phpt index dcd222a8190e..83092e4bb876 100644 --- a/ext/opcache/tests/jit/assign_047.phpt +++ b/ext/opcache/tests/jit/assign_047.phpt @@ -21,4 +21,3 @@ DONE --EXPECTF-- Warning: Undefined variable $a in %sassign_047.php on line 5 DONE - diff --git a/ext/opcache/tests/jit/assign_053.phpt b/ext/opcache/tests/jit/assign_053.phpt index 7e226ab99351..66f2fc79fa0c 100644 --- a/ext/opcache/tests/jit/assign_053.phpt +++ b/ext/opcache/tests/jit/assign_053.phpt @@ -22,4 +22,4 @@ Warning: Undefined variable $y in %sassign_053.php on line 7 Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7 Stack trace: #0 {main} - thrown in %sassign_053.php on line 7 \ No newline at end of file + thrown in %sassign_053.php on line 7 diff --git a/ext/opcache/tests/jit/assign_dim_002.phpt b/ext/opcache/tests/jit/assign_dim_002.phpt index dac9393d5ba9..9f3a3d3862a5 100644 --- a/ext/opcache/tests/jit/assign_dim_002.phpt +++ b/ext/opcache/tests/jit/assign_dim_002.phpt @@ -31,7 +31,7 @@ function foo3() { try { $array[] = array(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $array = new ArrayObject(); @@ -60,7 +60,7 @@ function foo4() { try { $array[function() {}] = 2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($array); @@ -74,7 +74,7 @@ function foo5() { try { $a[2] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } return $a; } @@ -109,14 +109,14 @@ var_dump(false_to_array_append(false)); try { var_dump(false_to_array_invalid_index(false)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(false_to_array_nested(false)); var_dump(false_to_array_nested_append(false)); try { var_dump(false_to_array_nested_invalid_index(false)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } function array_access_undef() { @@ -141,7 +141,7 @@ array(1) { array(0) { } } -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(2) { @@ -160,7 +160,7 @@ array(1) { int(1) } } -Cannot access offset of type Closure on array +TypeError: Cannot access offset of type Closure on array array(1) { [0]=> array(2) { @@ -179,7 +179,7 @@ array(1) { int(1) } } -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array int(1) Deprecated: Automatic conversion of false to array is deprecated in %s @@ -197,7 +197,7 @@ array(1) { } Deprecated: Automatic conversion of false to array is deprecated in %s on line %d -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array Deprecated: Automatic conversion of false to array is deprecated in %s on line %d int(1) @@ -220,7 +220,7 @@ array(1) { } Deprecated: Automatic conversion of false to array is deprecated in %s on line %d -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array Warning: Undefined variable $undef in %s on line %d NULL diff --git a/ext/opcache/tests/jit/assign_dim_003.phpt b/ext/opcache/tests/jit/assign_dim_003.phpt index 95fed0b52cce..6d62754cf360 100644 --- a/ext/opcache/tests/jit/assign_dim_003.phpt +++ b/ext/opcache/tests/jit/assign_dim_003.phpt @@ -16,4 +16,4 @@ test(); ?> --EXPECTF-- Warning: Undefined variable $v in %sassign_dim_003.php on line 3 -NULL \ No newline at end of file +NULL diff --git a/ext/opcache/tests/jit/assign_dim_011.phpt b/ext/opcache/tests/jit/assign_dim_011.phpt index 5df415c89e6c..5fa763fe9aa7 100644 --- a/ext/opcache/tests/jit/assign_dim_011.phpt +++ b/ext/opcache/tests/jit/assign_dim_011.phpt @@ -14,11 +14,11 @@ set_error_handler(function($code, $msg) use(&$my_var) { try { $my_var[] = ""; } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECT-- Err: Automatic conversion of false to array is deprecated -Exception: Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array DONE diff --git a/ext/opcache/tests/jit/assign_dim_013.phpt b/ext/opcache/tests/jit/assign_dim_013.phpt index cccf0a32150c..582129ede261 100644 --- a/ext/opcache/tests/jit/assign_dim_013.phpt +++ b/ext/opcache/tests/jit/assign_dim_013.phpt @@ -22,4 +22,4 @@ Fatal error: Uncaught Error: Undefined constant "y" in %sassign_dim_013.php:8 Stack trace: #0 %sassign_dim_013.php(11): test() #1 {main} - thrown in %sassign_dim_013.php on line 8 \ No newline at end of file + thrown in %sassign_dim_013.php on line 8 diff --git a/ext/opcache/tests/jit/assign_dim_017.phpt b/ext/opcache/tests/jit/assign_dim_017.phpt index 9b0925f867f8..c3524fdc79b4 100644 --- a/ext/opcache/tests/jit/assign_dim_017.phpt +++ b/ext/opcache/tests/jit/assign_dim_017.phpt @@ -16,4 +16,4 @@ function test() { ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/assign_dim_op_001.phpt b/ext/opcache/tests/jit/assign_dim_op_001.phpt index c5b057e92603..b8887ab1b158 100644 --- a/ext/opcache/tests/jit/assign_dim_op_001.phpt +++ b/ext/opcache/tests/jit/assign_dim_op_001.phpt @@ -49,19 +49,19 @@ false_to_array_append(false); try { var_dump(false_to_array_invalid_index(false)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(false_to_array_nested(false)); var_dump(false_to_array_nested_append(false)); try { var_dump(false_to_array_nested_invalid_index(false)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(modulo_string([])); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -78,7 +78,7 @@ Warning: Undefined array key 2 in %s on line %d Deprecated: Automatic conversion of false to array is deprecated in %s on line %d Deprecated: Automatic conversion of false to array is deprecated in %s on line %d -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array Deprecated: Automatic conversion of false to array is deprecated in %s on line %d @@ -103,5 +103,5 @@ array(1) { } Deprecated: Automatic conversion of false to array is deprecated in %s on line %d -Cannot access offset of type array on array -Unsupported operand types: null % string +TypeError: Cannot access offset of type array on array +TypeError: Unsupported operand types: null % string diff --git a/ext/opcache/tests/jit/assign_dim_op_005.phpt b/ext/opcache/tests/jit/assign_dim_op_005.phpt index a25cc7505e2b..0dfecc6f2acb 100644 --- a/ext/opcache/tests/jit/assign_dim_op_005.phpt +++ b/ext/opcache/tests/jit/assign_dim_op_005.phpt @@ -18,14 +18,14 @@ function test2() { try { test1(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $undef -Undefined variable $a +Exception: Undefined variable $undef +Exception: Undefined variable $a diff --git a/ext/opcache/tests/jit/assign_dim_undef_exception.phpt b/ext/opcache/tests/jit/assign_dim_undef_exception.phpt index 2c1d0274a1f8..3677eaff9e31 100644 --- a/ext/opcache/tests/jit/assign_dim_undef_exception.phpt +++ b/ext/opcache/tests/jit/assign_dim_undef_exception.phpt @@ -24,14 +24,14 @@ function test3() { try { test1(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $undef -Undefined variable $undef +Exception: Undefined variable $undef +Exception: Undefined variable $undef diff --git a/ext/opcache/tests/jit/assign_obj_001.phpt b/ext/opcache/tests/jit/assign_obj_001.phpt index c83a7e649e5b..e78180dc5911 100644 --- a/ext/opcache/tests/jit/assign_obj_001.phpt +++ b/ext/opcache/tests/jit/assign_obj_001.phpt @@ -18,16 +18,16 @@ function test2($o) { try { test1(null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attempt to assign property "x" on null -Attempt to assign property "x" on null +Error: Attempt to assign property "x" on null +Error: Attempt to assign property "x" on null diff --git a/ext/opcache/tests/jit/assign_obj_002.phpt b/ext/opcache/tests/jit/assign_obj_002.phpt index 2b211f79d5dd..1e3baba2bca6 100644 --- a/ext/opcache/tests/jit/assign_obj_002.phpt +++ b/ext/opcache/tests/jit/assign_obj_002.phpt @@ -24,7 +24,7 @@ test(); try { test2(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -32,4 +32,4 @@ Warning: Undefined variable $undef in %s on line %d NULL Warning: Undefined variable $undef in %s on line %d -Cannot assign null to property Test::$prop2 of type int +TypeError: Cannot assign null to property Test::$prop2 of type int diff --git a/ext/opcache/tests/jit/assign_obj_003.phpt b/ext/opcache/tests/jit/assign_obj_003.phpt index 4d878d648efb..7addb1101136 100644 --- a/ext/opcache/tests/jit/assign_obj_003.phpt +++ b/ext/opcache/tests/jit/assign_obj_003.phpt @@ -29,8 +29,8 @@ function xxx() { try { @xxx(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Attempt to assign property "next" on null +Error: Attempt to assign property "next" on null diff --git a/ext/opcache/tests/jit/assign_obj_on_null.phpt b/ext/opcache/tests/jit/assign_obj_on_null.phpt index 3ba85f20a230..e99448998611 100644 --- a/ext/opcache/tests/jit/assign_obj_on_null.phpt +++ b/ext/opcache/tests/jit/assign_obj_on_null.phpt @@ -23,14 +23,14 @@ function test2() { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attempt to assign property "y" on null -Attempt to assign property "y" on null +Error: Attempt to assign property "y" on null +Error: Attempt to assign property "y" on null diff --git a/ext/opcache/tests/jit/assign_op_001.phpt b/ext/opcache/tests/jit/assign_op_001.phpt index 957de4d83c56..c84f88297a4e 100644 --- a/ext/opcache/tests/jit/assign_op_001.phpt +++ b/ext/opcache/tests/jit/assign_op_001.phpt @@ -15,14 +15,14 @@ function test2($a) { try { test1(1); } catch (DivisionByZeroError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test2(1); } catch (ArithmeticError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Modulo by zero -Bit shift by negative number +DivisionByZeroError: Modulo by zero +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/assign_op_002.phpt b/ext/opcache/tests/jit/assign_op_002.phpt index fb8b0e46b7f4..067d5f195c8c 100644 --- a/ext/opcache/tests/jit/assign_op_002.phpt +++ b/ext/opcache/tests/jit/assign_op_002.phpt @@ -17,4 +17,4 @@ function test() { test(); ?> --EXPECT-- -string(1) "0" \ No newline at end of file +string(1) "0" diff --git a/ext/opcache/tests/jit/bind_static.phpt b/ext/opcache/tests/jit/bind_static.phpt index 3aaef1befb5e..b5dc6da49ac1 100644 --- a/ext/opcache/tests/jit/bind_static.phpt +++ b/ext/opcache/tests/jit/bind_static.phpt @@ -13,9 +13,9 @@ function test() { try { test(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "UNDEFINED" +Error: Undefined constant "UNDEFINED" diff --git a/ext/opcache/tests/jit/bug80745.phpt b/ext/opcache/tests/jit/bug80745.phpt index f2dec43d2153..c0be5bebe845 100644 --- a/ext/opcache/tests/jit/bug80745.phpt +++ b/ext/opcache/tests/jit/bug80745.phpt @@ -39,4 +39,3 @@ echo "PROBLEM NOT REPRODUCED !\n"; Starting... int(0) PROBLEM NOT REPRODUCED ! - diff --git a/ext/opcache/tests/jit/bug81409.phpt b/ext/opcache/tests/jit/bug81409.phpt index d9501b18ddbb..c617fd648a78 100644 --- a/ext/opcache/tests/jit/bug81409.phpt +++ b/ext/opcache/tests/jit/bug81409.phpt @@ -22,4 +22,4 @@ function bar() { bar(); ?> --EXPECT-- -int(200) \ No newline at end of file +int(200) diff --git a/ext/opcache/tests/jit/bw_not_001.phpt b/ext/opcache/tests/jit/bw_not_001.phpt index 125cc8a1f158..33a37ff0c7f7 100644 --- a/ext/opcache/tests/jit/bw_not_001.phpt +++ b/ext/opcache/tests/jit/bw_not_001.phpt @@ -16,4 +16,4 @@ Warning: Undefined variable $x in %sbw_not_001.php on line 2 Warning: Undefined variable $x in %sbw_not_001.php on line 2 Warning: Undefined array key "" in %sbw_not_001.php on line 2 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/copy_tmp_002.phpt b/ext/opcache/tests/jit/copy_tmp_002.phpt index 01b87b418748..ed61b52ac87c 100644 --- a/ext/opcache/tests/jit/copy_tmp_002.phpt +++ b/ext/opcache/tests/jit/copy_tmp_002.phpt @@ -11,4 +11,4 @@ $x[~"abc"] ??= 0; ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/count_001.phpt b/ext/opcache/tests/jit/count_001.phpt index 2fb1c52d2855..6fca44ecfc21 100644 --- a/ext/opcache/tests/jit/count_001.phpt +++ b/ext/opcache/tests/jit/count_001.phpt @@ -65,4 +65,4 @@ Caught In destructor Caught In destructor Caught In destructor Caught In destructor -Caught In destructor \ No newline at end of file +Caught In destructor diff --git a/ext/opcache/tests/jit/fe_reset_001.phpt b/ext/opcache/tests/jit/fe_reset_001.phpt index fcd1d18ada80..95b7c38661b9 100644 --- a/ext/opcache/tests/jit/fe_reset_001.phpt +++ b/ext/opcache/tests/jit/fe_reset_001.phpt @@ -33,4 +33,3 @@ Warning: Undefined variable $4 in %sfe_reset_001.php on line 4 Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4 OK - diff --git a/ext/opcache/tests/jit/fetch_dim_r_003.phpt b/ext/opcache/tests/jit/fetch_dim_r_003.phpt index 43c216026b93..3329f9d4139c 100644 --- a/ext/opcache/tests/jit/fetch_dim_r_003.phpt +++ b/ext/opcache/tests/jit/fetch_dim_r_003.phpt @@ -22,14 +22,14 @@ function foo() { try { var_dump($a["ab"]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $x = "a"; $y = "b"; try { var_dump($a[$x . $y]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($a["2x"]); $x = "2"; @@ -55,8 +55,8 @@ string(1) "B" Warning: String offset cast occurred in %s on line %d string(1) "A" -Cannot access offset of type string on string -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "2x" in %sfetch_dim_r_003.php on line 24 string(1) "C" diff --git a/ext/opcache/tests/jit/fetch_dim_r_004.phpt b/ext/opcache/tests/jit/fetch_dim_r_004.phpt index d0a25de7936e..18d43141666d 100644 --- a/ext/opcache/tests/jit/fetch_dim_r_004.phpt +++ b/ext/opcache/tests/jit/fetch_dim_r_004.phpt @@ -14,7 +14,7 @@ function foo($n) { try { var_dump($a[$n]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } foo(0); @@ -51,8 +51,8 @@ string(1) "B" Warning: String offset cast occurred in %s on line %d string(1) "A" -Cannot access offset of type string on string -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string Warning: Illegal string offset "2x" in %sfetch_dim_r_004.php on line 5 string(1) "C" diff --git a/ext/opcache/tests/jit/fetch_dim_r_006.phpt b/ext/opcache/tests/jit/fetch_dim_r_006.phpt index 18250aa822ff..10b33b424180 100644 --- a/ext/opcache/tests/jit/fetch_dim_r_006.phpt +++ b/ext/opcache/tests/jit/fetch_dim_r_006.phpt @@ -24,4 +24,4 @@ NULL Warning: Undefined array key 0 in %sfetch_dim_r_006.php on line 5 NULL -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/fetch_obj_001.phpt b/ext/opcache/tests/jit/fetch_obj_001.phpt index ddc8dfafba64..a50dd00e86cc 100644 --- a/ext/opcache/tests/jit/fetch_obj_001.phpt +++ b/ext/opcache/tests/jit/fetch_obj_001.phpt @@ -51,7 +51,7 @@ function bar() { try { foo($d->{"ab" ."c"}); } catch (Error $err) { - echo $err->getMessage(), "\n"; + echo $err::class, ': ', $err->getMessage(), "\n"; } var_dump($d); @@ -59,7 +59,7 @@ function bar() { try { foo($e->{"ab" ."c"}); } catch (Error $err) { - echo $err->getMessage(), "\n"; + echo $err::class, ': ', $err->getMessage(), "\n"; } var_dump($e); @@ -67,7 +67,7 @@ function bar() { try { foo($f->{"ab" ."c"}); } catch (Error $err) { - echo $err->getMessage(), "\n"; + echo $err::class, ': ', $err->getMessage(), "\n"; } var_dump($f); } @@ -127,10 +127,10 @@ object(stdClass)#%d (2) { array(0) { } } -Attempt to modify property "abc" on array +Error: Attempt to modify property "abc" on array array(0) { } -Attempt to modify property "abc" on null +Error: Attempt to modify property "abc" on null NULL -Attempt to modify property "abc" on string +Error: Attempt to modify property "abc" on string string(0) "" diff --git a/ext/opcache/tests/jit/fetch_obj_005.phpt b/ext/opcache/tests/jit/fetch_obj_005.phpt index 2084269bf430..bfd61eb725b2 100644 --- a/ext/opcache/tests/jit/fetch_obj_005.phpt +++ b/ext/opcache/tests/jit/fetch_obj_005.phpt @@ -19,4 +19,4 @@ Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4 Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4 -Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4 \ No newline at end of file +Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4 diff --git a/ext/opcache/tests/jit/gh12509.phpt b/ext/opcache/tests/jit/gh12509.phpt index ae8bdee66196..e96a22f4d0fc 100644 --- a/ext/opcache/tests/jit/gh12509.phpt +++ b/ext/opcache/tests/jit/gh12509.phpt @@ -25,4 +25,4 @@ array(3) { int(2) [3]=> int(3) -} \ No newline at end of file +} diff --git a/ext/opcache/tests/jit/gh12723-A.phpt b/ext/opcache/tests/jit/gh12723-A.phpt index f30453e8c0a3..d0350dca3ae2 100644 --- a/ext/opcache/tests/jit/gh12723-A.phpt +++ b/ext/opcache/tests/jit/gh12723-A.phpt @@ -12,9 +12,9 @@ $dimension = []; try { var_dump($container[$dimension]); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type array on string +TypeError: Cannot access offset of type array on string diff --git a/ext/opcache/tests/jit/gh12723-B.phpt b/ext/opcache/tests/jit/gh12723-B.phpt index 9f5ae7a19ff1..7018e24b156d 100644 --- a/ext/opcache/tests/jit/gh12723-B.phpt +++ b/ext/opcache/tests/jit/gh12723-B.phpt @@ -11,9 +11,9 @@ $container = new stdClass(); try { $container[new stdClass()] .= 'append'; } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use object of type stdClass as array +Error: Cannot use object of type stdClass as array diff --git a/ext/opcache/tests/jit/gh12747.phpt b/ext/opcache/tests/jit/gh12747.phpt index df0b039cebc0..1229b7829145 100644 --- a/ext/opcache/tests/jit/gh12747.phpt +++ b/ext/opcache/tests/jit/gh12747.phpt @@ -11,25 +11,25 @@ try { echo "isset():\n"; var_dump(isset($container[new stdClass()])); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo "empty():\n"; var_dump(empty($container[new stdClass()])); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo "Coalesce():\n"; var_dump($container[new stdClass()] ?? 'default'); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- isset(): -Cannot access offset of type stdClass in isset or empty +TypeError: Cannot access offset of type stdClass in isset or empty empty(): -Cannot access offset of type stdClass in isset or empty +TypeError: Cannot access offset of type stdClass in isset or empty Coalesce(): -Cannot access offset of type stdClass on array +TypeError: Cannot access offset of type stdClass on array diff --git a/ext/opcache/tests/jit/gh12748.phpt b/ext/opcache/tests/jit/gh12748.phpt index d7580fdb9ab7..3b309e25745b 100644 --- a/ext/opcache/tests/jit/gh12748.phpt +++ b/ext/opcache/tests/jit/gh12748.phpt @@ -11,19 +11,19 @@ try { echo "isset():\n"; var_dump(isset($container[new stdClass()])); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo "empty():\n"; var_dump(empty($container[new stdClass()])); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo "Coalesce():\n"; var_dump($container[new stdClass()] ?? 'default'); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -32,4 +32,4 @@ bool(false) empty(): bool(true) Coalesce(): -Cannot access offset of type stdClass on string +TypeError: Cannot access offset of type stdClass on string diff --git a/ext/opcache/tests/jit/gh12812.phpt b/ext/opcache/tests/jit/gh12812.phpt index 267abf2aae06..faa6433ce263 100644 --- a/ext/opcache/tests/jit/gh12812.phpt +++ b/ext/opcache/tests/jit/gh12812.phpt @@ -12,12 +12,12 @@ $dimension = '7'; try { var_dump($container['7']); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($container[$dimension]); } catch (\Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/opcache/tests/jit/gh13772.phpt b/ext/opcache/tests/jit/gh13772.phpt index 97fa6536e0ce..172d2e535b7e 100644 --- a/ext/opcache/tests/jit/gh13772.phpt +++ b/ext/opcache/tests/jit/gh13772.phpt @@ -23,4 +23,3 @@ var_dump(Ack(3, 3)); ?> --EXPECT-- int(61) - diff --git a/ext/opcache/tests/jit/gh15652.phpt b/ext/opcache/tests/jit/gh15652.phpt index 2220c7550a66..82762a7138cb 100644 --- a/ext/opcache/tests/jit/gh15652.phpt +++ b/ext/opcache/tests/jit/gh15652.phpt @@ -43,4 +43,4 @@ bool(true) Warning: Undefined property: C2::$value in %sgh15652.php on line 6 Warning: Undefined property: C2::$value in %sgh15652.php on line 6 -bool(true) \ No newline at end of file +bool(true) diff --git a/ext/opcache/tests/jit/gh16499.phpt b/ext/opcache/tests/jit/gh16499.phpt index 6aec1012ab5e..0dad8349a157 100644 --- a/ext/opcache/tests/jit/gh16499.phpt +++ b/ext/opcache/tests/jit/gh16499.phpt @@ -25,4 +25,4 @@ NULL Warning: Undefined variable $i in %sgh16499.php on line 6 Warning: Undefined variable $i in %sgh16499.php on line 6 -NULL \ No newline at end of file +NULL diff --git a/ext/opcache/tests/jit/gh8863.phpt b/ext/opcache/tests/jit/gh8863.phpt index 0d8e833c5faa..0f0ba9127e87 100644 --- a/ext/opcache/tests/jit/gh8863.phpt +++ b/ext/opcache/tests/jit/gh8863.phpt @@ -23,10 +23,10 @@ $test = new Test(); try { $test->rw(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECT-- -Cannot modify readonly property Test::$prop +Error: Cannot modify readonly property Test::$prop DONE diff --git a/ext/opcache/tests/jit/gh9011.phpt b/ext/opcache/tests/jit/gh9011.phpt index 3ffefe2ce29b..f8667fbae8ce 100644 --- a/ext/opcache/tests/jit/gh9011.phpt +++ b/ext/opcache/tests/jit/gh9011.phpt @@ -24,4 +24,4 @@ foreach ($foo as $baz) { ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/inc_020.phpt b/ext/opcache/tests/jit/inc_020.phpt index 9c0c2472acf4..99610f1d3b4d 100644 --- a/ext/opcache/tests/jit/inc_020.phpt +++ b/ext/opcache/tests/jit/inc_020.phpt @@ -24,4 +24,4 @@ function foo($row) { ?> OK --EXPECT-- -OK \ No newline at end of file +OK diff --git a/ext/opcache/tests/jit/inc_obj_003.phpt b/ext/opcache/tests/jit/inc_obj_003.phpt index dfa556cfe26f..77dd2d42e311 100644 --- a/ext/opcache/tests/jit/inc_obj_003.phpt +++ b/ext/opcache/tests/jit/inc_obj_003.phpt @@ -16,4 +16,4 @@ $v = --$test->prop; var_dump($v); ?> --EXPECT-- -float(0) \ No newline at end of file +float(0) diff --git a/ext/opcache/tests/jit/inc_obj_006.phpt b/ext/opcache/tests/jit/inc_obj_006.phpt index af31d0c471c2..1bdae45fa16e 100644 --- a/ext/opcache/tests/jit/inc_obj_006.phpt +++ b/ext/opcache/tests/jit/inc_obj_006.phpt @@ -27,4 +27,3 @@ Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on int Stack trace: #0 {main} thrown in %sinc_obj_006.php on line 14 - diff --git a/ext/opcache/tests/jit/init_fcall_001.phpt b/ext/opcache/tests/jit/init_fcall_001.phpt index fae4af53179f..19959a235d05 100644 --- a/ext/opcache/tests/jit/init_fcall_001.phpt +++ b/ext/opcache/tests/jit/init_fcall_001.phpt @@ -18,4 +18,3 @@ Stack trace: #0 %sinit_fcall_001.php(5): ini_set() #1 {main} thrown in %sinit_fcall_001.php on line 5 - diff --git a/ext/opcache/tests/jit/isset_002.phpt b/ext/opcache/tests/jit/isset_002.phpt index 2c2527fbe7b9..41f1b6e39a85 100644 --- a/ext/opcache/tests/jit/isset_002.phpt +++ b/ext/opcache/tests/jit/isset_002.phpt @@ -29,4 +29,4 @@ DONE Warning: Undefined variable $how in %sisset_002.php on line 3 Warning: foreach() argument must be of type array|object, null given in %sisset_002.php on line 3 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/match_001.phpt b/ext/opcache/tests/jit/match_001.phpt index b21c5b2c1720..86d9cf9ff514 100644 --- a/ext/opcache/tests/jit/match_001.phpt +++ b/ext/opcache/tests/jit/match_001.phpt @@ -18,4 +18,4 @@ Fatal error: Uncaught UnhandledMatchError: Unhandled match case NULL in %smatch_ Stack trace: #0 %smatch_001.php(5): foo() #1 {main} - thrown in %smatch_001.php on line 3 \ No newline at end of file + thrown in %smatch_001.php on line 3 diff --git a/ext/opcache/tests/jit/mod_001.phpt b/ext/opcache/tests/jit/mod_001.phpt index 03431fe54eb4..c01be5536b6e 100644 --- a/ext/opcache/tests/jit/mod_001.phpt +++ b/ext/opcache/tests/jit/mod_001.phpt @@ -21,12 +21,12 @@ var_dump(mod(-125, -33)); try { var_dump(mod(125, -1)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(mod(125, 0)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -37,4 +37,4 @@ int(-29) int(26) int(-26) int(0) -Exception (DivisionByZeroError): Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/opcache/tests/jit/mod_002.phpt b/ext/opcache/tests/jit/mod_002.phpt index b1d163b94d5f..a19d8c41ac38 100644 --- a/ext/opcache/tests/jit/mod_002.phpt +++ b/ext/opcache/tests/jit/mod_002.phpt @@ -33,12 +33,12 @@ var_dump(modNeg33(-125)); try { var_dump(modNeg1(125)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(mod0(125)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -49,4 +49,4 @@ int(-29) int(26) int(-26) int(0) -Exception (DivisionByZeroError): Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/opcache/tests/jit/mod_004.phpt b/ext/opcache/tests/jit/mod_004.phpt index 73cf1a92c47a..b8905ae8c6db 100644 --- a/ext/opcache/tests/jit/mod_004.phpt +++ b/ext/opcache/tests/jit/mod_004.phpt @@ -17,4 +17,4 @@ Warning: Undefined array key "xy" in %smod_004.php on line 4 Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smod_004.php:4 Stack trace: #0 {main} - thrown in %smod_004.php on line 4 \ No newline at end of file + thrown in %smod_004.php on line 4 diff --git a/ext/opcache/tests/jit/mod_006.phpt b/ext/opcache/tests/jit/mod_006.phpt index 6409cd3253ad..b9abbd8e98ad 100644 --- a/ext/opcache/tests/jit/mod_006.phpt +++ b/ext/opcache/tests/jit/mod_006.phpt @@ -15,4 +15,4 @@ function foo(){ ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/mod_007.phpt b/ext/opcache/tests/jit/mod_007.phpt index 1d76d34fe436..add360e9f3a7 100644 --- a/ext/opcache/tests/jit/mod_007.phpt +++ b/ext/opcache/tests/jit/mod_007.phpt @@ -19,4 +19,4 @@ Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smod_007.php:4 Stack trace: #0 %smod_007.php(7): test(NULL) #1 {main} - thrown in %smod_007.php on line 4 \ No newline at end of file + thrown in %smod_007.php on line 4 diff --git a/ext/opcache/tests/jit/mul_003.phpt b/ext/opcache/tests/jit/mul_003.phpt index d57534d9b3fc..08f0b4cdd760 100644 --- a/ext/opcache/tests/jit/mul_003.phpt +++ b/ext/opcache/tests/jit/mul_003.phpt @@ -29,4 +29,4 @@ mul1_bound(3); ?> --EXPECT-- int(-6442450944) -int(-6442450944) \ No newline at end of file +int(-6442450944) diff --git a/ext/opcache/tests/jit/mul_005.phpt b/ext/opcache/tests/jit/mul_005.phpt index 7476d215f130..dde76afba830 100644 --- a/ext/opcache/tests/jit/mul_005.phpt +++ b/ext/opcache/tests/jit/mul_005.phpt @@ -17,8 +17,8 @@ function test($a) { try { test('foo'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: string * int +TypeError: Unsupported operand types: string * int diff --git a/ext/opcache/tests/jit/mul_006.phpt b/ext/opcache/tests/jit/mul_006.phpt index a36bdec41b0e..0dd03fc9dc2a 100644 --- a/ext/opcache/tests/jit/mul_006.phpt +++ b/ext/opcache/tests/jit/mul_006.phpt @@ -15,4 +15,4 @@ for ($i = 0; $i<6; $i++) { ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/mul_007.phpt b/ext/opcache/tests/jit/mul_007.phpt index 71eb4d4009ca..e4a652de183b 100644 --- a/ext/opcache/tests/jit/mul_007.phpt +++ b/ext/opcache/tests/jit/mul_007.phpt @@ -17,4 +17,4 @@ DONE Deprecated: Implicit conversion from float 1.5 to int loses precision in %smul_007.php on line 3 Deprecated: Implicit conversion from float 0.5 to int loses precision in %smul_007.php on line 3 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/mul_009.phpt b/ext/opcache/tests/jit/mul_009.phpt index a6016bd535e7..4f3207d2735e 100644 --- a/ext/opcache/tests/jit/mul_009.phpt +++ b/ext/opcache/tests/jit/mul_009.phpt @@ -16,4 +16,4 @@ Warning: Undefined variable $y in %smul_009.php on line 3 Fatal error: Uncaught TypeError: Unsupported operand types: array * int in %smul_009.php:3 Stack trace: #0 {main} - thrown in %smul_009.php on line 3 \ No newline at end of file + thrown in %smul_009.php on line 3 diff --git a/ext/opcache/tests/jit/mul_010.phpt b/ext/opcache/tests/jit/mul_010.phpt index 6c94f8164487..49422a20ff7f 100644 --- a/ext/opcache/tests/jit/mul_010.phpt +++ b/ext/opcache/tests/jit/mul_010.phpt @@ -25,8 +25,8 @@ function test() { try { @test(); } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Unsupported operand types: string * float +TypeError: Unsupported operand types: string * float diff --git a/ext/opcache/tests/jit/noval_001.phpt b/ext/opcache/tests/jit/noval_001.phpt index 0fef38652bf4..c09325604940 100644 --- a/ext/opcache/tests/jit/noval_001.phpt +++ b/ext/opcache/tests/jit/noval_001.phpt @@ -31,4 +31,3 @@ var_dump(Foo::bar()); ?> --EXPECT-- string(2) "ok" - diff --git a/ext/opcache/tests/jit/qm_assign_001.phpt b/ext/opcache/tests/jit/qm_assign_001.phpt index ecfda50a28c0..3c89b5360bb4 100644 --- a/ext/opcache/tests/jit/qm_assign_001.phpt +++ b/ext/opcache/tests/jit/qm_assign_001.phpt @@ -13,4 +13,3 @@ Deprecated: Implicit conversion from float 1.5 to int loses precision in %sqm_as Deprecated: Implicit conversion from float 1.5 to int loses precision in %sqm_assign_001.php on line 2 -1 - diff --git a/ext/opcache/tests/jit/qm_assign_002.phpt b/ext/opcache/tests/jit/qm_assign_002.phpt index 8f6328d81dde..2a12942dc44f 100644 --- a/ext/opcache/tests/jit/qm_assign_002.phpt +++ b/ext/opcache/tests/jit/qm_assign_002.phpt @@ -25,4 +25,4 @@ Warning: Undefined variable $b in %sqm_assign_002.php on line 5 Warning: Undefined variable $a in %sqm_assign_002.php on line 4 Warning: Array to string conversion in %sqm_assign_002.php on line 5 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/qm_assign_003.phpt b/ext/opcache/tests/jit/qm_assign_003.phpt index cb62c5425c79..c9c8b126cbd8 100644 --- a/ext/opcache/tests/jit/qm_assign_003.phpt +++ b/ext/opcache/tests/jit/qm_assign_003.phpt @@ -22,4 +22,4 @@ function foo() { ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/qm_assign_undef_exception.phpt b/ext/opcache/tests/jit/qm_assign_undef_exception.phpt index 4e93e2ed7e56..b67f7b8f8e75 100644 --- a/ext/opcache/tests/jit/qm_assign_undef_exception.phpt +++ b/ext/opcache/tests/jit/qm_assign_undef_exception.phpt @@ -14,8 +14,8 @@ function test() { try { test(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined variable $b +Exception: Undefined variable $b diff --git a/ext/opcache/tests/jit/recursive_wrong_args.phpt b/ext/opcache/tests/jit/recursive_wrong_args.phpt index 84043ca03d5d..edc3c1b8c143 100644 --- a/ext/opcache/tests/jit/recursive_wrong_args.phpt +++ b/ext/opcache/tests/jit/recursive_wrong_args.phpt @@ -12,8 +12,8 @@ function f($arg) { try { f(); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Too few arguments to function f(), 0 passed in %s on line %d and exactly 1 expected +ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line %d and exactly 1 expected diff --git a/ext/opcache/tests/jit/recv_002.phpt b/ext/opcache/tests/jit/recv_002.phpt index 30999dc278d1..016935f94cba 100644 --- a/ext/opcache/tests/jit/recv_002.phpt +++ b/ext/opcache/tests/jit/recv_002.phpt @@ -23,4 +23,4 @@ Fatal error: Uncaught ArgumentCountError: Too few arguments to function test(), Stack trace: #0 %s(7): test() #1 {main} - thrown in %s on line 3 \ No newline at end of file + thrown in %s on line 3 diff --git a/ext/opcache/tests/jit/reg_alloc_005.phpt b/ext/opcache/tests/jit/reg_alloc_005.phpt index f46d0f64e745..3d4d15b896e0 100644 --- a/ext/opcache/tests/jit/reg_alloc_005.phpt +++ b/ext/opcache/tests/jit/reg_alloc_005.phpt @@ -18,4 +18,4 @@ test(); ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_006.phpt b/ext/opcache/tests/jit/reg_alloc_006.phpt index fa7777a12d83..411a614c7782 100644 --- a/ext/opcache/tests/jit/reg_alloc_006.phpt +++ b/ext/opcache/tests/jit/reg_alloc_006.phpt @@ -30,4 +30,4 @@ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5 Warning: Undefined variable $y in %sreg_alloc_006.php on line 5 Warning: Undefined variable $y in %sreg_alloc_006.php on line 5 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_010.phpt b/ext/opcache/tests/jit/reg_alloc_010.phpt index 4dd92d43dfad..02b685f5879c 100644 --- a/ext/opcache/tests/jit/reg_alloc_010.phpt +++ b/ext/opcache/tests/jit/reg_alloc_010.phpt @@ -20,4 +20,4 @@ DONE Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3 Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_011.phpt b/ext/opcache/tests/jit/reg_alloc_011.phpt index 521a827cc1f0..8d61ac2047a1 100644 --- a/ext/opcache/tests/jit/reg_alloc_011.phpt +++ b/ext/opcache/tests/jit/reg_alloc_011.phpt @@ -21,4 +21,4 @@ foo(null); ?> DONE --EXPECTF-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_012.phpt b/ext/opcache/tests/jit/reg_alloc_012.phpt index b684011fbf16..d9d208203379 100644 --- a/ext/opcache/tests/jit/reg_alloc_012.phpt +++ b/ext/opcache/tests/jit/reg_alloc_012.phpt @@ -18,4 +18,4 @@ for ($i = 0; $i < 3; $i++) { ?> DONE --EXPECTF-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_013.phpt b/ext/opcache/tests/jit/reg_alloc_013.phpt index 73bd3abb6566..cba21193a84d 100644 --- a/ext/opcache/tests/jit/reg_alloc_013.phpt +++ b/ext/opcache/tests/jit/reg_alloc_013.phpt @@ -15,4 +15,4 @@ foo(); DONE --EXPECTF-- Warning: Undefined variable $j in %sreg_alloc_013.php on line 3 -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/reg_alloc_022.phpt b/ext/opcache/tests/jit/reg_alloc_022.phpt index fc9a0b29dff4..80f720627bcf 100644 --- a/ext/opcache/tests/jit/reg_alloc_022.phpt +++ b/ext/opcache/tests/jit/reg_alloc_022.phpt @@ -22,4 +22,4 @@ test(); ?> DONE --EXPECT-- -DONE \ No newline at end of file +DONE diff --git a/ext/opcache/tests/jit/shift_left_001.phpt b/ext/opcache/tests/jit/shift_left_001.phpt index 5b0cbf927caf..c5f0421e780a 100644 --- a/ext/opcache/tests/jit/shift_left_001.phpt +++ b/ext/opcache/tests/jit/shift_left_001.phpt @@ -19,12 +19,12 @@ var_dump(shl(-1, 2)); try { var_dump(shl(1, 64)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shl(1, -1)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -33,4 +33,4 @@ int(2) int(4) int(-4) int(0) -Exception (ArithmeticError): Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/shift_left_002.phpt b/ext/opcache/tests/jit/shift_left_002.phpt index 979aaf96b0bd..5bdbf8bd745e 100644 --- a/ext/opcache/tests/jit/shift_left_002.phpt +++ b/ext/opcache/tests/jit/shift_left_002.phpt @@ -31,12 +31,12 @@ var_dump(shl2(-1)); try { var_dump(shl64(1)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shlNEG(1)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -45,4 +45,4 @@ int(2) int(4) int(-4) int(0) -Exception (ArithmeticError): Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/shift_right_001.phpt b/ext/opcache/tests/jit/shift_right_001.phpt index 454e8a120449..c1ddb627b284 100644 --- a/ext/opcache/tests/jit/shift_right_001.phpt +++ b/ext/opcache/tests/jit/shift_right_001.phpt @@ -19,17 +19,17 @@ var_dump(shr(-8, 2)); try { var_dump(shr(1, 64)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shr(-1, 64)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shr(1, -1)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -39,4 +39,4 @@ int(64) int(-2) int(0) int(-1) -Exception (ArithmeticError): Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/shift_right_002.phpt b/ext/opcache/tests/jit/shift_right_002.phpt index c7d6d227774c..0dea5171512a 100644 --- a/ext/opcache/tests/jit/shift_right_002.phpt +++ b/ext/opcache/tests/jit/shift_right_002.phpt @@ -31,17 +31,17 @@ var_dump(shr2(-8)); try { var_dump(shr64(1)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shr64(-1)); } catch (Throwable $e) { - echo "Exception " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(shrNEG(1)); } catch (Throwable $e) { - echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -51,4 +51,4 @@ int(64) int(-2) int(0) int(-1) -Exception (ArithmeticError): Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/ext/opcache/tests/jit/type_check_001.phpt b/ext/opcache/tests/jit/type_check_001.phpt index 028d2e8637e2..0b9c81ad0d57 100644 --- a/ext/opcache/tests/jit/type_check_001.phpt +++ b/ext/opcache/tests/jit/type_check_001.phpt @@ -17,7 +17,7 @@ try { undefined_function('Null'); } } catch (Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/opcache/tests/jit/undef_to_typed_ref.phpt b/ext/opcache/tests/jit/undef_to_typed_ref.phpt index c1308e249a92..8cb0cb929d01 100644 --- a/ext/opcache/tests/jit/undef_to_typed_ref.phpt +++ b/ext/opcache/tests/jit/undef_to_typed_ref.phpt @@ -57,50 +57,50 @@ function test_obj_nores() { try { test_simple_res(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_simple_nores(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_dim_res(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_dim_nores(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_obj_res(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { test_obj_nores(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string Warning: Undefined variable $v in %s on line %d -Cannot assign null to reference held by property Test::$x of type string +TypeError: Cannot assign null to reference held by property Test::$x of type string diff --git a/ext/opcache/tests/jit/verify_return_undef.phpt b/ext/opcache/tests/jit/verify_return_undef.phpt index fb07ee42505d..8a34ddc47c8a 100644 --- a/ext/opcache/tests/jit/verify_return_undef.phpt +++ b/ext/opcache/tests/jit/verify_return_undef.phpt @@ -14,10 +14,10 @@ function test(): int { try { test(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $undef in %s on line %d -test(): Return value must be of type int, null returned +TypeError: test(): Return value must be of type int, null returned diff --git a/ext/opcache/tests/match_always_error.phpt b/ext/opcache/tests/match_always_error.phpt index 1be5b21305b4..e875afedd0e3 100644 --- a/ext/opcache/tests/match_always_error.phpt +++ b/ext/opcache/tests/match_always_error.phpt @@ -14,8 +14,8 @@ function test() { try { test(); } catch (UnhandledMatchError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unhandled match case 0 +UnhandledMatchError: Unhandled match case 0 diff --git a/ext/opcache/tests/method_call_on_literal.phpt b/ext/opcache/tests/method_call_on_literal.phpt index 50b0076c4011..7e025b13933c 100644 --- a/ext/opcache/tests/method_call_on_literal.phpt +++ b/ext/opcache/tests/method_call_on_literal.phpt @@ -8,9 +8,9 @@ opcache try { (42)->foo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Call to a member function foo() on int +Error: Call to a member function foo() on int diff --git a/ext/opcache/tests/opt/coalesce_002.phpt b/ext/opcache/tests/opt/coalesce_002.phpt index c3a05d22e7a1..e118df2cc625 100644 --- a/ext/opcache/tests/opt/coalesce_002.phpt +++ b/ext/opcache/tests/opt/coalesce_002.phpt @@ -19,4 +19,4 @@ Stack trace: #0 %scoalesce_002.php(3): var_dump() #1 %scoalesce_002.php(5): t() #2 {main} - thrown in %scoalesce_002.php on line 3 \ No newline at end of file + thrown in %scoalesce_002.php on line 3 diff --git a/ext/opcache/tests/opt/gh19792.phpt b/ext/opcache/tests/opt/gh19792.phpt index edd805ca57a1..72fc663c49c8 100644 --- a/ext/opcache/tests/opt/gh19792.phpt +++ b/ext/opcache/tests/opt/gh19792.phpt @@ -18,10 +18,10 @@ function foo() try { foo(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: a warning in %s on line %d -an exception +Error: an exception diff --git a/ext/opcache/tests/opt/inference_003.phpt b/ext/opcache/tests/opt/inference_003.phpt index 046396f21253..b4e585968253 100644 --- a/ext/opcache/tests/opt/inference_003.phpt +++ b/ext/opcache/tests/opt/inference_003.phpt @@ -17,4 +17,3 @@ Fatal error: Uncaught Error: Interface "I" not found in %sinference_003.php:2 Stack trace: #0 {main} thrown in %sinference_003.php on line 2 - diff --git a/ext/opcache/tests/opt/inference_016.phpt b/ext/opcache/tests/opt/inference_016.phpt index 7d1733934fb6..5b8b8a3334cb 100644 --- a/ext/opcache/tests/opt/inference_016.phpt +++ b/ext/opcache/tests/opt/inference_016.phpt @@ -15,11 +15,11 @@ function test() { try { test(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- NULL Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %sinference_016.php on line %d -Modulo by zero +DivisionByZeroError: Modulo by zero diff --git a/ext/opcache/tests/opt/inference_017.phpt b/ext/opcache/tests/opt/inference_017.phpt index 2c9255e3b2b4..00f26bd682a6 100644 --- a/ext/opcache/tests/opt/inference_017.phpt +++ b/ext/opcache/tests/opt/inference_017.phpt @@ -14,8 +14,8 @@ function test() { try { @test(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/opcache/tests/opt/inference_018.phpt b/ext/opcache/tests/opt/inference_018.phpt index 123cb3b9eb62..f865913d01b4 100644 --- a/ext/opcache/tests/opt/inference_018.phpt +++ b/ext/opcache/tests/opt/inference_018.phpt @@ -16,8 +16,8 @@ function test() { try { @test(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Division by zero +DivisionByZeroError: Division by zero diff --git a/ext/opcache/tests/opt/tmp_001.phpt b/ext/opcache/tests/opt/tmp_001.phpt index 83b679f5f76f..3b1e67e006ff 100644 --- a/ext/opcache/tests/opt/tmp_001.phpt +++ b/ext/opcache/tests/opt/tmp_001.phpt @@ -15,4 +15,4 @@ Fatal error: Uncaught ArgumentCountError: is_a() expects at least 2 arguments, 1 Stack trace: #0 %stmp_001.php(2): is_a(0) #1 {main} - thrown in %stmp_001.php on line 2 \ No newline at end of file + thrown in %stmp_001.php on line 2 diff --git a/ext/opcache/tests/optimize_static_001.phpt b/ext/opcache/tests/optimize_static_001.phpt index a71f029b3302..894d9f0d8c2e 100644 --- a/ext/opcache/tests/optimize_static_001.phpt +++ b/ext/opcache/tests/optimize_static_001.phpt @@ -14,10 +14,10 @@ function foo() { try { foo(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> OK --EXPECT-- -Exception: Undefined constant "UNDEFINED_CONST" +Error: Undefined constant "UNDEFINED_CONST" OK diff --git a/ext/opcache/tests/preload_004.phpt b/ext/opcache/tests/preload_004.phpt index 76047bde6222..fee4eb682146 100644 --- a/ext/opcache/tests/preload_004.phpt +++ b/ext/opcache/tests/preload_004.phpt @@ -17,9 +17,9 @@ var_dump(class_exists('Foo')); try { new Foo(); } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -Undefined constant self::DOES_NOT_EXIST +Error: Undefined constant self::DOES_NOT_EXIST diff --git a/ext/opcache/tests/preload_009.phpt b/ext/opcache/tests/preload_009.phpt index bb15998f7ab0..71702922bea3 100644 --- a/ext/opcache/tests/preload_009.phpt +++ b/ext/opcache/tests/preload_009.phpt @@ -18,10 +18,10 @@ var_dump(class_exists('Foo')); try { new Foo(); } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- bool(true) bool(true) -Undefined constant "UNDEF" +Error: Undefined constant "UNDEF" diff --git a/ext/opcache/tests/preload_012.phpt b/ext/opcache/tests/preload_012.phpt index 836d4707a0d9..b23876666cbe 100644 --- a/ext/opcache/tests/preload_012.phpt +++ b/ext/opcache/tests/preload_012.phpt @@ -19,9 +19,9 @@ var_dump(class_exists('Test')); try { new Test(); } catch (Throwable $ex) { - echo $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -Undefined constant Foo::BAR +Error: Undefined constant Foo::BAR diff --git a/ext/opcache/tests/ssa_bug_003.phpt b/ext/opcache/tests/ssa_bug_003.phpt index 780a02955786..a173143fffcf 100644 --- a/ext/opcache/tests/ssa_bug_003.phpt +++ b/ext/opcache/tests/ssa_bug_003.phpt @@ -19,7 +19,7 @@ function test1($x) : callable { try { test1(1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Foo {} @@ -31,10 +31,10 @@ function test2() : Foo { try { test2(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -test1(): Return value must be of type callable, string returned -test2(): Return value must be of type Foo, stdClass returned +TypeError: test1(): Return value must be of type callable, string returned +TypeError: test2(): Return value must be of type Foo, stdClass returned diff --git a/ext/openssl/tests/bug38261.phpt b/ext/openssl/tests/bug38261.phpt index 6064380c8bca..49e289ddf266 100644 --- a/ext/openssl/tests/bug38261.phpt +++ b/ext/openssl/tests/bug38261.phpt @@ -17,13 +17,13 @@ var_dump(openssl_x509_parse("foo")); try { var_dump(openssl_x509_parse($t)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { openssl_x509_parse([]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(openssl_x509_parse($cert)); @@ -31,13 +31,13 @@ var_dump(openssl_x509_parse($cert)); try { openssl_x509_parse(new stdClass); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) bool(false) -openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given +TypeError: openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given bool(false) -openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, stdClass given +TypeError: openssl_x509_parse(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, stdClass given diff --git a/ext/openssl/tests/bug60632.phpt b/ext/openssl/tests/bug60632.phpt index 7be90bd4ab43..24f652a1c685 100644 --- a/ext/openssl/tests/bug60632.phpt +++ b/ext/openssl/tests/bug60632.phpt @@ -21,8 +21,8 @@ $ekeys = array(); try { $result = openssl_seal('test phrase', $encrypted, $ekeys, array($pubkey), 'AES-256-CBC'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -openssl_seal(): Argument #6 ($iv) cannot be null for the chosen cipher algorithm +ValueError: openssl_seal(): Argument #6 ($iv) cannot be null for the chosen cipher algorithm diff --git a/ext/openssl/tests/bug68912.phpt b/ext/openssl/tests/bug68912.phpt index 7bb8c9e5032b..46d50acd4d9f 100644 --- a/ext/openssl/tests/bug68912.phpt +++ b/ext/openssl/tests/bug68912.phpt @@ -16,8 +16,8 @@ $var3=3; try { openssl_spki_new($var1, $var2, $var3); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -openssl_spki_new(): Argument #1 ($private_key) must be of type OpenSSLAsymmetricKey, resource given +TypeError: openssl_spki_new(): Argument #1 ($private_key) must be of type OpenSSLAsymmetricKey, resource given diff --git a/ext/openssl/tests/bug71475.phpt b/ext/openssl/tests/bug71475.phpt index 354d0b4de27d..6bcbda3b07f4 100644 --- a/ext/openssl/tests/bug71475.phpt +++ b/ext/openssl/tests/bug71475.phpt @@ -8,10 +8,10 @@ $_ = str_repeat("A", 512); try { openssl_seal($_, $_, $_, array_fill(0,64,0)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECT-- -openssl_seal() expects at least 5 arguments, 4 given +ArgumentCountError: openssl_seal() expects at least 5 arguments, 4 given DONE diff --git a/ext/openssl/tests/bug81713.phpt b/ext/openssl/tests/bug81713.phpt index 9e3ab5d5e2f3..938b449670d4 100644 --- a/ext/openssl/tests/bug81713.phpt +++ b/ext/openssl/tests/bug81713.phpt @@ -130,7 +130,7 @@ foreach ($tests as $test) { var_dump($key); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> @@ -142,98 +142,98 @@ $outfile = __DIR__ . '/bug81713.out'; --EXPECTF-- object(OpenSSLAsymmetricKey)#1 (0) { } -openssl_pkey_get_public(): Argument #1 ($public_key) must not contain any null bytes -openssl_pkey_get_private(): Argument #1 ($private_key) must not contain any null bytes -openssl_pkey_export_to_file(): Argument #1 ($key) must not contain any null bytes -openssl_pkey_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes -openssl_pkey_export(): Argument #1 ($key) must not contain any null bytes -openssl_pkey_derive(): Argument #1 ($public_key) must not contain any null bytes -openssl_pkey_derive(): Argument #2 ($private_key) must not contain any null bytes -openssl_private_encrypt(): Argument #3 ($private_key) must not contain any null bytes -openssl_private_decrypt(): Argument #3 ($private_key) must not contain any null bytes -openssl_public_encrypt(): Argument #3 ($public_key) must not contain any null bytes -openssl_public_decrypt(): Argument #3 ($public_key) must not contain any null bytes -openssl_sign(): Argument #3 ($private_key) must not contain any null bytes -openssl_verify(): Argument #3 ($public_key) must not contain any null bytes -openssl_seal(): Argument #4 ($public_key) must not contain any null bytes -openssl_open(): Argument #4 ($private_key) must not contain any null bytes -openssl_csr_new(): Argument #2 ($private_key) must not contain any null bytes -openssl_csr_get_subject(): Argument #1 ($csr) must not contain any null bytes -openssl_csr_get_public_key(): Argument #1 ($csr) must not contain any null bytes +ValueError: openssl_pkey_get_public(): Argument #1 ($public_key) must not contain any null bytes +ValueError: openssl_pkey_get_private(): Argument #1 ($private_key) must not contain any null bytes +ValueError: openssl_pkey_export_to_file(): Argument #1 ($key) must not contain any null bytes +ValueError: openssl_pkey_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_pkey_export(): Argument #1 ($key) must not contain any null bytes +ValueError: openssl_pkey_derive(): Argument #1 ($public_key) must not contain any null bytes +ValueError: openssl_pkey_derive(): Argument #2 ($private_key) must not contain any null bytes +ValueError: openssl_private_encrypt(): Argument #3 ($private_key) must not contain any null bytes +ValueError: openssl_private_decrypt(): Argument #3 ($private_key) must not contain any null bytes +ValueError: openssl_public_encrypt(): Argument #3 ($public_key) must not contain any null bytes +ValueError: openssl_public_decrypt(): Argument #3 ($public_key) must not contain any null bytes +ValueError: openssl_sign(): Argument #3 ($private_key) must not contain any null bytes +ValueError: openssl_verify(): Argument #3 ($public_key) must not contain any null bytes +ValueError: openssl_seal(): Argument #4 ($public_key) must not contain any null bytes +ValueError: openssl_open(): Argument #4 ($private_key) must not contain any null bytes +ValueError: openssl_csr_new(): Argument #2 ($private_key) must not contain any null bytes +ValueError: openssl_csr_get_subject(): Argument #1 ($csr) must not contain any null bytes +ValueError: openssl_csr_get_public_key(): Argument #1 ($csr) must not contain any null bytes Warning: openssl_x509_fingerprint(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_x509_fingerprint(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_fingerprint(): Argument #1 ($certificate) must not contain any null bytes Warning: openssl_x509_export_to_file(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_x509_export_to_file(): Argument #1 ($certificate) must not contain any null bytes -openssl_x509_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_x509_export_to_file(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes Warning: openssl_x509_export(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_x509_export(): Argument #1 ($certificate) must not contain any null bytes -openssl_x509_checkpurpose(): Argument #1 ($certificate) must not contain any null bytes -openssl_x509_checkpurpose(): Argument #3 ($ca_info) array item must not contain any null bytes -openssl_x509_check_private_key(): Argument #1 ($certificate) must not contain any null bytes -openssl_x509_check_private_key(): Argument #2 ($private_key) must not contain any null bytes -openssl_x509_verify(): Argument #1 ($certificate) must not contain any null bytes -openssl_x509_verify(): Argument #2 ($public_key) must not contain any null bytes -openssl_x509_parse(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_export(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_checkpurpose(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_checkpurpose(): Argument #3 ($ca_info) array item must not contain any null bytes +ValueError: openssl_x509_check_private_key(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_check_private_key(): Argument #2 ($private_key) must not contain any null bytes +ValueError: openssl_x509_verify(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_x509_verify(): Argument #2 ($public_key) must not contain any null bytes +ValueError: openssl_x509_parse(): Argument #1 ($certificate) must not contain any null bytes Warning: openssl_x509_read(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_x509_read(): Argument #1 ($certificate) must not contain any null bytes -openssl_cms_encrypt(): Argument #1 ($input_filename) must not contain any null bytes -openssl_cms_encrypt(): Argument #2 ($output_filename) must not contain any null bytes -openssl_cms_encrypt(): Argument #3 ($certificate) must not contain any null bytes -openssl_cms_encrypt(): Argument #3 ($certificate) array item must not contain any null bytes -openssl_cms_decrypt(): Argument #1 ($input_filename) must not contain any null bytes -openssl_cms_decrypt(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_x509_read(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_cms_encrypt(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_cms_encrypt(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_cms_encrypt(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_cms_encrypt(): Argument #3 ($certificate) array item must not contain any null bytes +ValueError: openssl_cms_decrypt(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_cms_decrypt(): Argument #2 ($output_filename) must not contain any null bytes Warning: openssl_cms_decrypt(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_cms_decrypt(): Argument #3 ($certificate) must not contain any null bytes -openssl_cms_decrypt(): Argument #4 ($private_key) must not contain any null bytes -openssl_cms_sign(): Argument #1 ($input_filename) must not contain any null bytes -openssl_cms_sign(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_cms_decrypt(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_cms_decrypt(): Argument #4 ($private_key) must not contain any null bytes +ValueError: openssl_cms_sign(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_cms_sign(): Argument #2 ($output_filename) must not contain any null bytes Warning: openssl_cms_sign(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_cms_sign(): Argument #3 ($certificate) must not contain any null bytes -openssl_cms_sign(): Argument #4 ($private_key) must not contain any null bytes -openssl_cms_sign(): Argument #8 ($untrusted_certificates_filename) must not contain any null bytes -openssl_cms_verify(): Argument #1 ($input_filename) must not contain any null bytes -openssl_cms_verify(): Argument #3 ($certificates) must not contain any null bytes -openssl_cms_verify(): Argument #4 ($ca_info) array item must not contain any null bytes -openssl_cms_verify(): Argument #5 ($untrusted_certificates_filename) must not contain any null bytes -openssl_cms_verify(): Argument #6 ($content) must not contain any null bytes -openssl_cms_verify(): Argument #7 ($pk7) must not contain any null bytes -openssl_pkcs7_encrypt(): Argument #1 ($input_filename) must not contain any null bytes -openssl_pkcs7_encrypt(): Argument #2 ($output_filename) must not contain any null bytes -openssl_pkcs7_encrypt(): Argument #3 ($certificate) must not contain any null bytes -openssl_pkcs7_encrypt(): Argument #3 ($certificate) array item must not contain any null bytes -openssl_pkcs7_decrypt(): Argument #1 ($input_filename) must not contain any null bytes -openssl_pkcs7_decrypt(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_cms_sign(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_cms_sign(): Argument #4 ($private_key) must not contain any null bytes +ValueError: openssl_cms_sign(): Argument #8 ($untrusted_certificates_filename) must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #3 ($certificates) must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #4 ($ca_info) array item must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #5 ($untrusted_certificates_filename) must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #6 ($content) must not contain any null bytes +ValueError: openssl_cms_verify(): Argument #7 ($pk7) must not contain any null bytes +ValueError: openssl_pkcs7_encrypt(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_pkcs7_encrypt(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_pkcs7_encrypt(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_pkcs7_encrypt(): Argument #3 ($certificate) array item must not contain any null bytes +ValueError: openssl_pkcs7_decrypt(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_pkcs7_decrypt(): Argument #2 ($output_filename) must not contain any null bytes Warning: openssl_pkcs7_decrypt(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_pkcs7_decrypt(): Argument #3 ($certificate) must not contain any null bytes -openssl_pkcs7_decrypt(): Argument #4 ($private_key) must not contain any null bytes -openssl_pkcs7_sign(): Argument #1 ($input_filename) must not contain any null bytes -openssl_pkcs7_sign(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_pkcs7_decrypt(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_pkcs7_decrypt(): Argument #4 ($private_key) must not contain any null bytes +ValueError: openssl_pkcs7_sign(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_pkcs7_sign(): Argument #2 ($output_filename) must not contain any null bytes Warning: openssl_pkcs7_sign(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_pkcs7_sign(): Argument #3 ($certificate) must not contain any null bytes -openssl_pkcs7_sign(): Argument #4 ($private_key) must not contain any null bytes -openssl_pkcs7_sign(): Argument #7 ($untrusted_certificates_filename) must not contain any null bytes -openssl_pkcs7_verify(): Argument #1 ($input_filename) must not contain any null bytes -openssl_pkcs7_verify(): Argument #3 ($signers_certificates_filename) must not contain any null bytes -openssl_pkcs7_verify(): Argument #4 ($ca_info) array item must not contain any null bytes -openssl_pkcs7_verify(): Argument #5 ($untrusted_certificates_filename) must not contain any null bytes -openssl_pkcs7_verify(): Argument #6 ($content) must not contain any null bytes -openssl_pkcs7_verify(): Argument #7 ($output_filename) must not contain any null bytes +ValueError: openssl_pkcs7_sign(): Argument #3 ($certificate) must not contain any null bytes +ValueError: openssl_pkcs7_sign(): Argument #4 ($private_key) must not contain any null bytes +ValueError: openssl_pkcs7_sign(): Argument #7 ($untrusted_certificates_filename) must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #1 ($input_filename) must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #3 ($signers_certificates_filename) must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #4 ($ca_info) array item must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #5 ($untrusted_certificates_filename) must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #6 ($content) must not contain any null bytes +ValueError: openssl_pkcs7_verify(): Argument #7 ($output_filename) must not contain any null bytes Warning: openssl_pkcs12_export(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_pkcs12_export(): Argument #1 ($certificate) must not contain any null bytes -openssl_pkcs12_export(): Argument #3 ($private_key) must not contain any null bytes -openssl_pkcs12_export(): Argument #5 ($options) option extracerts array item must not contain any null bytes +ValueError: openssl_pkcs12_export(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_pkcs12_export(): Argument #3 ($private_key) must not contain any null bytes +ValueError: openssl_pkcs12_export(): Argument #5 ($options) option extracerts array item must not contain any null bytes Warning: openssl_pkcs12_export_to_file(): X.509 Certificate cannot be retrieved in %s on line %d -openssl_pkcs12_export_to_file(): Argument #1 ($certificate) must not contain any null bytes -openssl_pkcs12_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes -openssl_pkcs12_export_to_file(): Argument #3 ($private_key) must not contain any null bytes -openssl_pkcs12_export_to_file(): Argument #5 ($options) option extracerts array item must not contain any null bytes +ValueError: openssl_pkcs12_export_to_file(): Argument #1 ($certificate) must not contain any null bytes +ValueError: openssl_pkcs12_export_to_file(): Argument #2 ($output_filename) must not contain any null bytes +ValueError: openssl_pkcs12_export_to_file(): Argument #3 ($private_key) must not contain any null bytes +ValueError: openssl_pkcs12_export_to_file(): Argument #5 ($options) option extracerts array item must not contain any null bytes diff --git a/ext/openssl/tests/gh22081.phpt b/ext/openssl/tests/gh22081.phpt index 17f74be7584c..f8069bc180f7 100644 --- a/ext/openssl/tests/gh22081.phpt +++ b/ext/openssl/tests/gh22081.phpt @@ -73,4 +73,3 @@ ok 1 ok 2 ok 3 ok 4 - diff --git a/ext/openssl/tests/memory_leak_x509_store.phpt b/ext/openssl/tests/memory_leak_x509_store.phpt index bc9b113602a3..78a0df6825dc 100644 --- a/ext/openssl/tests/memory_leak_x509_store.phpt +++ b/ext/openssl/tests/memory_leak_x509_store.phpt @@ -14,9 +14,9 @@ class MyStringable{ try { openssl_pkcs7_verify("does not matter", 0, "does not matter", [new MyStringable]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stop +Error: stop diff --git a/ext/openssl/tests/openssl_cipher_iv_length_error.phpt b/ext/openssl/tests/openssl_cipher_iv_length_error.phpt index cdd5f3616fb2..8924fa2af675 100644 --- a/ext/openssl/tests/openssl_cipher_iv_length_error.phpt +++ b/ext/openssl/tests/openssl_cipher_iv_length_error.phpt @@ -10,12 +10,11 @@ var_dump(openssl_cipher_iv_length('unknown')); try { var_dump(openssl_cipher_iv_length('')); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: openssl_cipher_iv_length(): Unknown cipher algorithm in %s on line %d bool(false) -openssl_cipher_iv_length(): Argument #1 ($cipher_algo) must not be empty +ValueError: openssl_cipher_iv_length(): Argument #1 ($cipher_algo) must not be empty diff --git a/ext/openssl/tests/openssl_cipher_key_length_error.phpt b/ext/openssl/tests/openssl_cipher_key_length_error.phpt index a4e4e8e6bfcf..92aca289ad3e 100644 --- a/ext/openssl/tests/openssl_cipher_key_length_error.phpt +++ b/ext/openssl/tests/openssl_cipher_key_length_error.phpt @@ -10,12 +10,11 @@ var_dump(openssl_cipher_key_length('unknown')); try { var_dump(openssl_cipher_key_length('')); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: openssl_cipher_key_length(): Unknown cipher algorithm in %s on line %d bool(false) -openssl_cipher_key_length(): Argument #1 ($cipher_algo) must not be empty +ValueError: openssl_cipher_key_length(): Argument #1 ($cipher_algo) must not be empty diff --git a/ext/openssl/tests/openssl_cms_decrypt_error.phpt b/ext/openssl/tests/openssl_cms_decrypt_error.phpt index 3c128be64d09..28ff09357a25 100644 --- a/ext/openssl/tests/openssl_cms_decrypt_error.phpt +++ b/ext/openssl/tests/openssl_cms_decrypt_error.phpt @@ -18,7 +18,7 @@ $d = new stdclass; try { var_dump(openssl_cms_decrypt($a, $b, $c, $d)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($c); @@ -30,7 +30,7 @@ var_dump(openssl_cms_decrypt($a, $b, 0, 0)); echo "Done\n"; ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string object(stdClass)#1 (0) { } string(60) "openssl_cms_decrypt(): X.509 Certificate cannot be retrieved" diff --git a/ext/openssl/tests/openssl_cms_encrypt_der.phpt b/ext/openssl/tests/openssl_cms_encrypt_der.phpt index 2f26428c2a64..11985a367ae4 100644 --- a/ext/openssl/tests/openssl_cms_encrypt_der.phpt +++ b/ext/openssl/tests/openssl_cms_encrypt_der.phpt @@ -46,4 +46,3 @@ bool(true) Now is the winter of our discontent. true true - diff --git a/ext/openssl/tests/openssl_csr_export_basic.phpt b/ext/openssl/tests/openssl_csr_export_basic.phpt index f64271ffd971..1e5fa55fb298 100644 --- a/ext/openssl/tests/openssl_csr_export_basic.phpt +++ b/ext/openssl/tests/openssl_csr_export_basic.phpt @@ -34,12 +34,12 @@ var_dump(openssl_csr_export($csr, $output)); try { var_dump(openssl_csr_export($wrong, $output)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(openssl_csr_export($privkey, $output)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(openssl_csr_export($csr, $output, false)); ?> @@ -48,5 +48,5 @@ bool(true) Warning: openssl_csr_export(): X.509 Certificate Signing Request cannot be retrieved in %s on line %d bool(false) -openssl_csr_export(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, OpenSSLAsymmetricKey given +TypeError: openssl_csr_export(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, OpenSSLAsymmetricKey given bool(true) diff --git a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt index 4a6a393a6ba2..b475cc416e11 100644 --- a/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_csr_export_to_file_basic.phpt @@ -46,7 +46,7 @@ var_dump(openssl_csr_export_to_file($wrong, $csrfile)); try { openssl_csr_export_to_file($dh, $csrfile); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(openssl_csr_export_to_file($csr, $csrfile, false)); ?> @@ -81,5 +81,5 @@ f1JMPX0/eHrKvG9wBZu28FdS54xoWGeD1NGraW24 Warning: openssl_csr_export_to_file(): X.509 Certificate Signing Request cannot be retrieved in %s on line %d bool(false) -openssl_csr_export_to_file(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, OpenSSLAsymmetricKey given +TypeError: openssl_csr_export_to_file(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, OpenSSLAsymmetricKey given bool(true) diff --git a/ext/openssl/tests/openssl_csr_new_array_dn_entry.phpt b/ext/openssl/tests/openssl_csr_new_array_dn_entry.phpt index 7184c9af48d5..0f8f3540fa53 100644 --- a/ext/openssl/tests/openssl_csr_new_array_dn_entry.phpt +++ b/ext/openssl/tests/openssl_csr_new_array_dn_entry.phpt @@ -56,4 +56,4 @@ array(7) { string(12) "test.php.net" ["emailAddress"]=> string(20) "php.test@example.com" -} \ No newline at end of file +} diff --git a/ext/openssl/tests/openssl_csr_new_basic.phpt b/ext/openssl/tests/openssl_csr_new_basic.phpt index 66a30584e5a7..7ca0c599d65a 100644 --- a/ext/openssl/tests/openssl_csr_new_basic.phpt +++ b/ext/openssl/tests/openssl_csr_new_basic.phpt @@ -13,7 +13,7 @@ try { var_dump(openssl_csr_new(array(), $a, $conf, array())); var_dump($keyFailed); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // this leaks @@ -28,7 +28,7 @@ var_dump(openssl_csr_new(["countryName" => "DE"], $x, $conf + ["x509_extensions" ?> --EXPECTF-- Warning: openssl_csr_new(): add1_attr_by_txt challengePassword_min -> 4 (failed; check error queue and value of string_mask OpenSSL option if illegal characters are reported) in %s on line %d -Key array must be of the form array(0 => key, 1 => phrase) +ValueError: Key array must be of the form array(0 => key, 1 => phrase) object(OpenSSLCertificateSigningRequest)#%d (0) { } object(OpenSSLCertificateSigningRequest)#%d (0) { diff --git a/ext/openssl/tests/openssl_csr_new_with_attribs.phpt b/ext/openssl/tests/openssl_csr_new_with_attribs.phpt index a031b9d4a661..f8d4b2fc3c15 100644 --- a/ext/openssl/tests/openssl_csr_new_with_attribs.phpt +++ b/ext/openssl/tests/openssl_csr_new_with_attribs.phpt @@ -91,4 +91,4 @@ UeEz+fvmQ4L+sc3RE8u+M8g31LM= Warning: openssl_csr_new(): attributes: wrong is not a recognized attribute name in %s on line %d object(OpenSSLCertificateSigningRequest)#%d (0) { -} \ No newline at end of file +} diff --git a/ext/openssl/tests/openssl_csr_sign_basic.phpt b/ext/openssl/tests/openssl_csr_sign_basic.phpt index 852b296b9e04..e99cdc024573 100644 --- a/ext/openssl/tests/openssl_csr_sign_basic.phpt +++ b/ext/openssl/tests/openssl_csr_sign_basic.phpt @@ -45,19 +45,19 @@ var_dump(openssl_csr_sign($wrong, null, $privkey, 365)); try { openssl_csr_sign(array(), null, $privkey, 365); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(openssl_csr_sign($csr, array(), $privkey, 365)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(openssl_csr_sign($csr, null, array(), 365)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(openssl_csr_sign($csr, null, $privkey, 365, $config_arg)); ?> @@ -79,8 +79,8 @@ bool(false) Warning: openssl_csr_sign(): X.509 Certificate Signing Request cannot be retrieved in %s on line %d bool(false) -openssl_csr_sign(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, array given -openssl_csr_sign(): Argument #2 ($ca_certificate) must be of type OpenSSLCertificate|string|null, array given -Key array must be of the form array(0 => key, 1 => phrase) +TypeError: openssl_csr_sign(): Argument #1 ($csr) must be of type OpenSSLCertificateSigningRequest|string, array given +TypeError: openssl_csr_sign(): Argument #2 ($ca_certificate) must be of type OpenSSLCertificate|string|null, array given +ValueError: Key array must be of the form array(0 => key, 1 => phrase) object(OpenSSLCertificate)#%d (0) { } diff --git a/ext/openssl/tests/openssl_csr_sign_with_serial_hex.phpt b/ext/openssl/tests/openssl_csr_sign_with_serial_hex.phpt index eec1bbdcfc4c..56084838b10a 100644 --- a/ext/openssl/tests/openssl_csr_sign_with_serial_hex.phpt +++ b/ext/openssl/tests/openssl_csr_sign_with_serial_hex.phpt @@ -62,4 +62,4 @@ string(6) "12D687" string(10) "3735928559" string(8) "DEADBEEF" string(42) "0xDEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" -string(40) "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" \ No newline at end of file +string(40) "DEADBEEFDEADBEEFDEADBEEFDEADBEEFDEADBEEF" diff --git a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt index 458f365fc14b..e35efdd8e045 100644 --- a/ext/openssl/tests/openssl_pkcs12_export_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs12_export_basic.phpt @@ -33,7 +33,7 @@ var_dump(openssl_pkcs12_export($invalid_path, $output, $invalid_path, $pass)); try { var_dump(openssl_pkcs12_export($priv_res, $output, $cert_res, $pass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //var_dump(openssl_pkcs12_export($cert, $output, $priv, $pass, array("foo"))); ?> @@ -53,4 +53,4 @@ bool(false) Warning: openssl_pkcs12_export(): X.509 Certificate cannot be retrieved in %s on line %d bool(false) -openssl_pkcs12_export(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, OpenSSLAsymmetricKey given +TypeError: openssl_pkcs12_export(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, OpenSSLAsymmetricKey given diff --git a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt index f53e9753613e..bb9fafeea9c7 100644 --- a/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_pkcs12_export_to_file_basic.phpt @@ -33,7 +33,7 @@ var_dump(openssl_pkcs12_export_to_file($invalid_path, $pkcsfile, $invalid_path, try { var_dump(openssl_pkcs12_export_to_file($priv_res, $pkcsfile, $cert_res, $pass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -58,4 +58,4 @@ bool(false) Warning: openssl_pkcs12_export_to_file(): X.509 Certificate cannot be retrieved in %s on line %d bool(false) -openssl_pkcs12_export_to_file(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, OpenSSLAsymmetricKey given +TypeError: openssl_pkcs12_export_to_file(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, OpenSSLAsymmetricKey given diff --git a/ext/openssl/tests/openssl_pkcs12_read_array_init.phpt b/ext/openssl/tests/openssl_pkcs12_read_array_init.phpt index b57cd32b686a..f62d7d3e348c 100644 --- a/ext/openssl/tests/openssl_pkcs12_read_array_init.phpt +++ b/ext/openssl/tests/openssl_pkcs12_read_array_init.phpt @@ -16,7 +16,7 @@ $typed = new Typed; try { openssl_pkcs12_read($cert_store, $typed->foo, "csos"); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt b/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt index 480e662e4145..1069a9e4e797 100644 --- a/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt +++ b/ext/openssl/tests/openssl_pkcs7_decrypt_error.phpt @@ -18,7 +18,7 @@ $d = new stdclass; try { var_dump(openssl_pkcs7_decrypt($a, $b, $c, $d)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($c); @@ -30,7 +30,7 @@ var_dump(openssl_pkcs7_decrypt($a, $b, 0, 0)); echo "Done\n"; ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string object(stdClass)#1 (0) { } string(62) "openssl_pkcs7_decrypt(): X.509 Certificate cannot be retrieved" diff --git a/ext/openssl/tests/openssl_pkey_new_error.phpt b/ext/openssl/tests/openssl_pkey_new_error.phpt index f32292677bac..5a09a055372b 100644 --- a/ext/openssl/tests/openssl_pkey_new_error.phpt +++ b/ext/openssl/tests/openssl_pkey_new_error.phpt @@ -14,20 +14,20 @@ $dh = array("dh" => array()); try { openssl_pkey_get_details(openssl_pkey_new($rsa)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { openssl_pkey_get_details(openssl_pkey_new($dsa)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { openssl_pkey_get_details(openssl_pkey_new($dh)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given -openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given -openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given +TypeError: openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given +TypeError: openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given +TypeError: openssl_pkey_get_details(): Argument #1 ($key) must be of type OpenSSLAsymmetricKey, false given diff --git a/ext/openssl/tests/openssl_private_decrypt_basic.phpt b/ext/openssl/tests/openssl_private_decrypt_basic.phpt index 44101d580c02..fe557d17cfda 100644 --- a/ext/openssl/tests/openssl_private_decrypt_basic.phpt +++ b/ext/openssl/tests/openssl_private_decrypt_basic.phpt @@ -21,7 +21,7 @@ try { var_dump(openssl_private_decrypt($encrypted, $output4, array($privkey), OPENSSL_PKCS1_OAEP_PADDING)); var_dump($output4); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(openssl_private_decrypt($encrypted, $output5, array($privkey, ""), OPENSSL_PKCS1_OAEP_PADDING)); @@ -36,6 +36,6 @@ bool(false) NULL bool(false) NULL -Key array must be of the form array(0 => key, 1 => phrase) +ValueError: Key array must be of the form array(0 => key, 1 => phrase) bool(true) string(32) "Testing openssl_public_decrypt()" diff --git a/ext/openssl/tests/openssl_private_decrypt_digest.phpt b/ext/openssl/tests/openssl_private_decrypt_digest.phpt index 9bb07ba71eac..26120971a201 100644 --- a/ext/openssl/tests/openssl_private_decrypt_digest.phpt +++ b/ext/openssl/tests/openssl_private_decrypt_digest.phpt @@ -34,7 +34,7 @@ try { var_dump(openssl_private_decrypt($encrypted_sha256, $output_invalid, $privkey, OPENSSL_PKCS1_OAEP_PADDING, "sha256\0extra")); var_dump($output_invalid); } catch (\ValueError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } openssl_public_encrypt($data, $encrypted_pkcs1, $pubkey, OPENSSL_PKCS1_PADDING); @@ -52,6 +52,6 @@ NULL Warning: openssl_private_decrypt(): Unknown digest algorithm: invalid_hash in %s on line %d bool(false) NULL -string(85) "openssl_private_decrypt(): Argument #5 ($digest_algo) must not contain any null bytes" +ValueError: openssl_private_decrypt(): Argument #5 ($digest_algo) must not contain any null bytes bool(true) string(56) "Testing openssl_private_decrypt() with digest algorithms" diff --git a/ext/openssl/tests/openssl_public_decrypt_basic.phpt b/ext/openssl/tests/openssl_public_decrypt_basic.phpt index 8a3f0f2c58d7..f6c9c04d9af6 100644 --- a/ext/openssl/tests/openssl_public_decrypt_basic.phpt +++ b/ext/openssl/tests/openssl_public_decrypt_basic.phpt @@ -21,14 +21,14 @@ try { var_dump(openssl_public_decrypt($encrypted, $output4, array())); var_dump($output4); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(openssl_public_decrypt($encrypted, $output5, array($pubkey))); var_dump($output5); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(openssl_public_decrypt($encrypted, $output6, array($pubkey, ""))); var_dump($output6); @@ -42,7 +42,7 @@ bool(false) NULL bool(false) NULL -Key array must be of the form array(0 => key, 1 => phrase) -Key array must be of the form array(0 => key, 1 => phrase) +ValueError: Key array must be of the form array(0 => key, 1 => phrase) +ValueError: Key array must be of the form array(0 => key, 1 => phrase) bool(true) string(32) "Testing openssl_public_decrypt()" diff --git a/ext/openssl/tests/openssl_random_pseudo_bytes_error.phpt b/ext/openssl/tests/openssl_random_pseudo_bytes_error.phpt index 9f905e6a3510..6bfd8d89de6a 100644 --- a/ext/openssl/tests/openssl_random_pseudo_bytes_error.phpt +++ b/ext/openssl/tests/openssl_random_pseudo_bytes_error.phpt @@ -7,8 +7,8 @@ openssl try { openssl_random_pseudo_bytes(0); } catch (Error $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -openssl_random_pseudo_bytes(): Argument #1 ($length) must be greater than 0 +ValueError: openssl_random_pseudo_bytes(): Argument #1 ($length) must be greater than 0 diff --git a/ext/openssl/tests/openssl_seal_basic.phpt b/ext/openssl/tests/openssl_seal_basic.phpt index 6c08efa6d70d..2531f008fc6d 100644 --- a/ext/openssl/tests/openssl_seal_basic.phpt +++ b/ext/openssl/tests/openssl_seal_basic.phpt @@ -16,7 +16,7 @@ var_dump(openssl_seal($a, $b, $c, $d, $method)); try { var_dump(openssl_seal($a, $a, $a, array(), $method)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // tests with cert @@ -31,7 +31,7 @@ var_dump(openssl_seal($data, $sealed, $ekeys, array($pub_key, $wrong), $method)) try { var_dump(openssl_seal($data, $sealed, $ekeys, array(), $method)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(openssl_seal($data, $sealed, $ekeys, array($wrong), $method)); @@ -40,13 +40,13 @@ var_dump(openssl_seal($data, $sealed, $ekeys, array($wrong), $method)); --EXPECTF-- Warning: openssl_seal(): Not a public key (1th member of pubkeys) in %s on line %d bool(false) -openssl_seal(): Argument #4 ($public_key) must not be empty +ValueError: openssl_seal(): Argument #4 ($public_key) must not be empty int(32) int(32) Warning: openssl_seal(): Not a public key (2th member of pubkeys) in %s on line %d bool(false) -openssl_seal(): Argument #4 ($public_key) must not be empty +ValueError: openssl_seal(): Argument #4 ($public_key) must not be empty Warning: openssl_seal(): Not a public key (1th member of pubkeys) in %s on line %d bool(false) diff --git a/ext/openssl/tests/openssl_x509_export_basic.phpt b/ext/openssl/tests/openssl_x509_export_basic.phpt index f4b96fb9df24..124cd6d277bd 100644 --- a/ext/openssl/tests/openssl_x509_export_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_basic.phpt @@ -20,7 +20,7 @@ var_dump(openssl_x509_export($d, $output4)); // read cert from a resource try { openssl_x509_export($e, $output5); // read an array, fails } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } if (PHP_EOL !== "\n") { @@ -40,7 +40,7 @@ bool(true) Warning: openssl_x509_export(): X.509 Certificate cannot be retrieved in %s on line %d bool(false) bool(true) -openssl_x509_export(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given +TypeError: openssl_x509_export(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given int(0) int(0) int(%d) diff --git a/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt b/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt index 9fe8abfa4569..6c72e23b6e60 100644 --- a/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt +++ b/ext/openssl/tests/openssl_x509_export_to_file_basic.phpt @@ -20,7 +20,7 @@ var_dump(openssl_x509_export_to_file($d, $outfilename)); // read cert from a res try { openssl_x509_export_to_file($e, $outfilename); // read an array, fails } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "---\n"; var_dump($exists = file_exists($outfilename)); @@ -39,6 +39,6 @@ bool(true) Warning: openssl_x509_export_to_file(): X.509 Certificate cannot be retrieved in %s on line %d bool(false) bool(true) -openssl_x509_export_to_file(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given +TypeError: openssl_x509_export_to_file(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given --- bool(true) diff --git a/ext/openssl/tests/openssl_x509_read_basic.phpt b/ext/openssl/tests/openssl_x509_read_basic.phpt index 5eaf4ce8eb63..5ec5f7de2d10 100644 --- a/ext/openssl/tests/openssl_x509_read_basic.phpt +++ b/ext/openssl/tests/openssl_x509_read_basic.phpt @@ -22,13 +22,13 @@ var_dump(openssl_x509_read($d)); // read cert from a resource try { openssl_x509_read($e); // read an array } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { openssl_x509_read($f); // read an array with the filename } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -42,5 +42,5 @@ Warning: openssl_x509_read(): X.509 Certificate cannot be retrieved in %s on lin bool(false) object(OpenSSLCertificate)#%d (0) { } -openssl_x509_read(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given -openssl_x509_read(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given +TypeError: openssl_x509_read(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given +TypeError: openssl_x509_read(): Argument #1 ($certificate) must be of type OpenSSLCertificate|string, array given diff --git a/ext/openssl/tests/php_openssl_pkey_from_zval_leak.phpt b/ext/openssl/tests/php_openssl_pkey_from_zval_leak.phpt index 2b19dd311150..5fbda8ee488f 100644 --- a/ext/openssl/tests/php_openssl_pkey_from_zval_leak.phpt +++ b/ext/openssl/tests/php_openssl_pkey_from_zval_leak.phpt @@ -15,9 +15,9 @@ $key = ["", new StrFail]; try { openssl_pkey_export_to_file($key, "doesnotmatter"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -create a leak +Error: create a leak diff --git a/ext/openssl/tests/session_resumption_get_cb_no_ticket.phpt b/ext/openssl/tests/session_resumption_get_cb_no_ticket.phpt index f87f831a7859..74db2f3474ba 100644 --- a/ext/openssl/tests/session_resumption_get_cb_no_ticket.phpt +++ b/ext/openssl/tests/session_resumption_get_cb_no_ticket.phpt @@ -76,4 +76,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- SERVER_EXCEPTION: Session tickets cannot be enabled when session_get_cb is setConnection failed as expected - diff --git a/ext/openssl/tests/session_resumption_invalid_session_import.phpt b/ext/openssl/tests/session_resumption_invalid_session_import.phpt index a9c5b65f2051..0a8b846928e3 100644 --- a/ext/openssl/tests/session_resumption_invalid_session_import.phpt +++ b/ext/openssl/tests/session_resumption_invalid_session_import.phpt @@ -12,7 +12,7 @@ if (!function_exists("proc_open")) die("skip no proc_open"); try { Openssl\Session::import('invalid'); } catch (Openssl\OpensslException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -20,4 +20,4 @@ try { @unlink(__DIR__ . DIRECTORY_SEPARATOR . 'session_cache_disabled.pem.tmp'); ?> --EXPECT-- -Failed to import session data +Openssl\OpensslException: Failed to import session data diff --git a/ext/openssl/tests/tls_psk_callback_not_callable.phpt b/ext/openssl/tests/tls_psk_callback_not_callable.phpt index 29382e2a13ab..14b2a0508e51 100644 --- a/ext/openssl/tests/tls_psk_callback_not_callable.phpt +++ b/ext/openssl/tests/tls_psk_callback_not_callable.phpt @@ -43,4 +43,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECTF-- caught: psk_client_cb must be a valid callback, %s - diff --git a/ext/openssl/tests/tls_psk_client_callback_null.phpt b/ext/openssl/tests/tls_psk_client_callback_null.phpt index 92d970908c8e..e7acdf77094b 100644 --- a/ext/openssl/tests/tls_psk_client_callback_null.phpt +++ b/ext/openssl/tests/tls_psk_client_callback_null.phpt @@ -42,4 +42,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- bool(false) - diff --git a/ext/openssl/tests/tls_psk_client_callback_throws.phpt b/ext/openssl/tests/tls_psk_client_callback_throws.phpt index 13b2d71476c2..350756130b14 100644 --- a/ext/openssl/tests/tls_psk_client_callback_throws.phpt +++ b/ext/openssl/tests/tls_psk_client_callback_throws.phpt @@ -45,4 +45,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- caught: callback boom - diff --git a/ext/openssl/tests/tls_psk_client_no_identity.phpt b/ext/openssl/tests/tls_psk_client_no_identity.phpt index bfc8d078ceff..8a84d822b4c1 100644 --- a/ext/openssl/tests/tls_psk_client_no_identity.phpt +++ b/ext/openssl/tests/tls_psk_client_no_identity.phpt @@ -46,4 +46,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- caught: Client PSK callback must return Openssl\Psk with a non-null identity - diff --git a/ext/openssl/tests/tls_psk_mismatch.phpt b/ext/openssl/tests/tls_psk_mismatch.phpt index 8fa90d115c5a..ada49402bbde 100644 --- a/ext/openssl/tests/tls_psk_mismatch.phpt +++ b/ext/openssl/tests/tls_psk_mismatch.phpt @@ -41,4 +41,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- bool(false) - diff --git a/ext/openssl/tests/tls_psk_tls13_unknown_identity.phpt b/ext/openssl/tests/tls_psk_tls13_unknown_identity.phpt index 830c02449dc9..ddd05fd37ab4 100644 --- a/ext/openssl/tests/tls_psk_tls13_unknown_identity.phpt +++ b/ext/openssl/tests/tls_psk_tls13_unknown_identity.phpt @@ -41,4 +41,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECT-- bool(false) - diff --git a/ext/pcntl/tests/async_signals_2.phpt b/ext/pcntl/tests/async_signals_2.phpt index 95a5a219768f..f94a8881ee09 100644 --- a/ext/pcntl/tests/async_signals_2.phpt +++ b/ext/pcntl/tests/async_signals_2.phpt @@ -22,9 +22,9 @@ try { array_fill(0, 360, 0) ); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Alarm! +Exception: Alarm! diff --git a/ext/pcntl/tests/bug81577.phpt b/ext/pcntl/tests/bug81577.phpt index 7bf3b7ffea4d..557e719bd8ad 100644 --- a/ext/pcntl/tests/bug81577.phpt +++ b/ext/pcntl/tests/bug81577.phpt @@ -19,13 +19,13 @@ for ($i = 0; $i < 5; $i++) { C::$a + C::$a; posix_kill(posix_getpid(), SIGTERM) + C::$cond; } catch (Throwable $ex) { - echo get_class($ex) , " : " , $ex->getMessage() , "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } } ?> --EXPECT-- -Exception : Signal -Exception : Signal -Exception : Signal -Exception : Signal -Exception : Signal +Exception: Signal +Exception: Signal +Exception: Signal +Exception: Signal +Exception: Signal diff --git a/ext/pcntl/tests/bug81577_2.phpt b/ext/pcntl/tests/bug81577_2.phpt index 2f92502df530..c77617dfb784 100644 --- a/ext/pcntl/tests/bug81577_2.phpt +++ b/ext/pcntl/tests/bug81577_2.phpt @@ -10,7 +10,7 @@ pcntl_signal(SIGTERM, function ($signo) {}); try { $a = [1, posix_kill(posix_getpid(), SIGTERM), 2]; } catch (Throwable $ex) { - echo get_class($ex) , " : " , $ex->getMessage() , "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } var_dump($a); ?> diff --git a/ext/pcntl/tests/bug81577_3.phpt b/ext/pcntl/tests/bug81577_3.phpt index 1a30deaebaab..c50a04d68a47 100644 --- a/ext/pcntl/tests/bug81577_3.phpt +++ b/ext/pcntl/tests/bug81577_3.phpt @@ -12,8 +12,8 @@ pcntl_signal(SIGTERM, function ($signo) { throw new Exception("Signal"); }); try { array_merge([1], [2]) + posix_kill(posix_getpid(), SIGTERM); } catch (Throwable $ex) { - echo get_class($ex) , " : " , $ex->getMessage() , "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -Exception : Signal +Exception: Signal diff --git a/ext/pcntl/tests/gh16769.phpt b/ext/pcntl/tests/gh16769.phpt index 60baee616101..5f9383882f86 100644 --- a/ext/pcntl/tests/gh16769.phpt +++ b/ext/pcntl/tests/gh16769.phpt @@ -11,8 +11,8 @@ $a[0] = &$a; try { pcntl_sigwaitinfo($a,$a); } catch(\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, array given +TypeError: pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, array given diff --git a/ext/pcntl/tests/pcntl_alarm_invalid_value.phpt b/ext/pcntl/tests/pcntl_alarm_invalid_value.phpt index 59e74662f6f7..cc53a3ee04f8 100644 --- a/ext/pcntl/tests/pcntl_alarm_invalid_value.phpt +++ b/ext/pcntl/tests/pcntl_alarm_invalid_value.phpt @@ -10,26 +10,26 @@ pcntl try { pcntl_alarm(-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_alarm(PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_alarm(PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(pcntl_alarm(0)); ?> --EXPECTF-- -pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d -pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d -pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d +ValueError: pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d +ValueError: pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d +ValueError: pcntl_alarm(): Argument #1 ($seconds) must be between 0 and %d int(0) diff --git a/ext/pcntl/tests/pcntl_exec_004.phpt b/ext/pcntl/tests/pcntl_exec_004.phpt index 270fdb755ca1..932a6a0277e7 100644 --- a/ext/pcntl/tests/pcntl_exec_004.phpt +++ b/ext/pcntl/tests/pcntl_exec_004.phpt @@ -11,15 +11,15 @@ if (!getenv("TEST_PHP_EXECUTABLE") || !is_executable(getenv("TEST_PHP_EXECUTABLE try { pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n', new stdClass()]); } catch (Error $error) { - echo $error->getMessage() . "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { pcntl_exec(getenv("TEST_PHP_EXECUTABLE"), ['-n'], [new stdClass()]); } catch (Error $error) { - echo $error->getMessage() . "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } ?> --EXPECT-- -Object of class stdClass could not be converted to string -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/pcntl/tests/pcntl_getpriority_error.phpt b/ext/pcntl/tests/pcntl_getpriority_error.phpt index 2fa88a76842d..3ca9243dddfe 100644 --- a/ext/pcntl/tests/pcntl_getpriority_error.phpt +++ b/ext/pcntl/tests/pcntl_getpriority_error.phpt @@ -23,7 +23,7 @@ if (PHP_OS == "Darwin") { try { pcntl_getpriority(null, PRIO_PGRP + PRIO_USER + PRIO_PROCESS + 10); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Different behavior in MacOS than rest of operating systems @@ -31,6 +31,6 @@ pcntl_getpriority(-1, PRIO_PROCESS); ?> --EXPECTF-- -pcntl_getpriority(): Argument #2 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS +ValueError: pcntl_getpriority(): Argument #2 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS Warning: pcntl_getpriority(): Error %d: No process was located using the given parameters in %s diff --git a/ext/pcntl/tests/pcntl_setpriority_error.phpt b/ext/pcntl/tests/pcntl_setpriority_error.phpt index 6f0a67977a8f..1c40d747602b 100644 --- a/ext/pcntl/tests/pcntl_setpriority_error.phpt +++ b/ext/pcntl/tests/pcntl_setpriority_error.phpt @@ -23,13 +23,13 @@ if (PHP_OS == "Darwin") { try { $result = pcntl_setpriority(0, null, (PRIO_PGRP + PRIO_USER + PRIO_PROCESS + 10)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } pcntl_setpriority(0, -123); ?> --EXPECTF-- -pcntl_setpriority(): Argument #3 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS +ValueError: pcntl_setpriority(): Argument #3 ($mode) must be one of PRIO_PGRP, PRIO_USER, or PRIO_PROCESS Warning: pcntl_setpriority(): Error 3: No process was located using the given parameters in %s diff --git a/ext/pcntl/tests/pcntl_signal.phpt b/ext/pcntl/tests/pcntl_signal.phpt index 2e65139e3937..f4ae1ef07e10 100644 --- a/ext/pcntl/tests/pcntl_signal.phpt +++ b/ext/pcntl/tests/pcntl_signal.phpt @@ -22,19 +22,19 @@ var_dump(pcntl_signal(SIGALRM, SIG_IGN)); try { pcntl_signal(-1, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { pcntl_signal(-1, function(){}); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { pcntl_signal(SIGALRM, "not callable"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* test freeing queue in RSHUTDOWN */ @@ -45,7 +45,7 @@ echo "ok\n"; signal dispatched got signal from %r\d+|nobody%r bool(true) -pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1 -pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1 -pcntl_signal(): Argument #2 ($handler) must be of type callable|int, string given +ValueError: pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1 +ValueError: pcntl_signal(): Argument #1 ($signal) must be greater than or equal to 1 +TypeError: pcntl_signal(): Argument #2 ($handler) must be of type callable|int, string given ok diff --git a/ext/pcntl/tests/pcntl_signal_001.phpt b/ext/pcntl/tests/pcntl_signal_001.phpt index 2f4f385553a2..0b9a0f1d3577 100644 --- a/ext/pcntl/tests/pcntl_signal_001.phpt +++ b/ext/pcntl/tests/pcntl_signal_001.phpt @@ -9,8 +9,8 @@ try { echo "signaled\n"; }); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -pcntl_signal(): Argument #1 ($signal) must be less than %d +ValueError: pcntl_signal(): Argument #1 ($signal) must be less than %d diff --git a/ext/pcntl/tests/pcntl_signal_002.phpt b/ext/pcntl/tests/pcntl_signal_002.phpt index 1d4e29d94a75..f98392205e21 100644 --- a/ext/pcntl/tests/pcntl_signal_002.phpt +++ b/ext/pcntl/tests/pcntl_signal_002.phpt @@ -8,9 +8,9 @@ pcntl try { pcntl_signal(SIGTERM, -1); } catch (Error $error) { - echo $error->getMessage(); + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } ?> --EXPECT-- -pcntl_signal(): Argument #2 ($handler) must be either SIG_DFL or SIG_IGN when an integer value is given +ValueError: pcntl_signal(): Argument #2 ($handler) must be either SIG_DFL or SIG_IGN when an integer value is given diff --git a/ext/pcntl/tests/pcntl_signal_dispatch_exception.phpt b/ext/pcntl/tests/pcntl_signal_dispatch_exception.phpt index 06c4f827c6ef..1558b7556d21 100644 --- a/ext/pcntl/tests/pcntl_signal_dispatch_exception.phpt +++ b/ext/pcntl/tests/pcntl_signal_dispatch_exception.phpt @@ -23,12 +23,12 @@ posix_kill(posix_getpid(), SIGUSR2); try { pcntl_signal_dispatch(); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Handlers called: " . implode(', ', $called) . "\n"; ?> --EXPECT-- -Exception in signal handler +Exception: Exception in signal handler Handlers called: SIGUSR1 diff --git a/ext/pcntl/tests/pcntl_signal_functions_invalid_signals.phpt b/ext/pcntl/tests/pcntl_signal_functions_invalid_signals.phpt index e61b17bf3fbd..bd7e22e6634a 100644 --- a/ext/pcntl/tests/pcntl_signal_functions_invalid_signals.phpt +++ b/ext/pcntl/tests/pcntl_signal_functions_invalid_signals.phpt @@ -16,65 +16,65 @@ max_execution_time=0 try { pcntl_sigprocmask(SIG_BLOCK, ["not_a_signal"]); } catch (TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigprocmask(SIG_BLOCK, [0]); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigprocmask(SIG_BLOCK, []); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigwaitinfo(["not_a_signal"]); } catch (TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigwaitinfo([0]); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigwaitinfo([]); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigtimedwait(["not_a_signal"], $info, 1); } catch (TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigtimedwait([0], $info, 1); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pcntl_sigtimedwait([], $info, 1); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -pcntl_sigprocmask(): Argument #2 ($signals) signals must be of type int, string given -pcntl_sigprocmask(): Argument #2 ($signals) signals must be between 1 and %d -pcntl_sigprocmask(): Argument #2 ($signals) must not be empty -pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, string given -pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be between 1 and %d -pcntl_sigwaitinfo(): Argument #1 ($signals) must not be empty -pcntl_sigtimedwait(): Argument #1 ($signals) signals must be of type int, string given -pcntl_sigtimedwait(): Argument #1 ($signals) signals must be between 1 and %d -pcntl_sigtimedwait(): Argument #1 ($signals) must not be empty +TypeError: pcntl_sigprocmask(): Argument #2 ($signals) signals must be of type int, string given +ValueError: pcntl_sigprocmask(): Argument #2 ($signals) signals must be between 1 and %d +ValueError: pcntl_sigprocmask(): Argument #2 ($signals) must not be empty +TypeError: pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be of type int, string given +ValueError: pcntl_sigwaitinfo(): Argument #1 ($signals) signals must be between 1 and %d +ValueError: pcntl_sigwaitinfo(): Argument #1 ($signals) must not be empty +TypeError: pcntl_sigtimedwait(): Argument #1 ($signals) signals must be of type int, string given +ValueError: pcntl_sigtimedwait(): Argument #1 ($signals) signals must be between 1 and %d +ValueError: pcntl_sigtimedwait(): Argument #1 ($signals) must not be empty diff --git a/ext/pcre/tests/002.phpt b/ext/pcre/tests/002.phpt index 14d196402062..ac3e54db459c 100644 --- a/ext/pcre/tests/002.phpt +++ b/ext/pcre/tests/002.phpt @@ -6,7 +6,7 @@ preg_* with bogus vals try { preg_match_all('//', '', $dummy, 0xdead); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(preg_quote('')); @@ -17,7 +17,7 @@ var_dump(preg_replace('/(.)/e', 'for ($', 'abc')); ?> --EXPECTF-- -preg_match_all(): Argument #4 ($flags) must be a PREG_* constant +ValueError: preg_match_all(): Argument #4 ($flags) must be a PREG_* constant string(0) "" string(12) "a${1b${1c${1" diff --git a/ext/pcre/tests/bug21732.phpt b/ext/pcre/tests/bug21732.phpt index 02a13713e2ed..6fcbf47e3058 100644 --- a/ext/pcre/tests/bug21732.phpt +++ b/ext/pcre/tests/bug21732.phpt @@ -12,12 +12,12 @@ class foo { try { var_dump(preg_replace('', array(), '')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(preg_replace_callback("/(ab)(cd)(e)/", array(new foo(), "cb"), 'abcde')); ?> --EXPECT-- -preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given +TypeError: preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given array(4) { [0]=> string(5) "abcde" diff --git a/ext/pcre/tests/gh16189.phpt b/ext/pcre/tests/gh16189.phpt index c77ab7699eed..6e7dbaaf3941 100644 --- a/ext/pcre/tests/gh16189.phpt +++ b/ext/pcre/tests/gh16189.phpt @@ -6,14 +6,14 @@ GH-16189 (preg_match/preg_match_all underflow on start_offset argument) try { preg_match( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '
', $matches, 0, PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { preg_match_all( '/<(\w+)[\s\w\-]+ id="S44_i89ew">/', '
', $matches, 0, PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -preg_match(): Argument #5 ($offset) must be greater than %s -preg_match_all(): Argument #5 ($offset) must be greater than %s +ValueError: preg_match(): Argument #5 ($offset) must be greater than %s +ValueError: preg_match_all(): Argument #5 ($offset) must be greater than %s diff --git a/ext/pcre/tests/preg_grep_error1.phpt b/ext/pcre/tests/preg_grep_error1.phpt index ae80ecc3506f..0c1a4733ca90 100644 --- a/ext/pcre/tests/preg_grep_error1.phpt +++ b/ext/pcre/tests/preg_grep_error1.phpt @@ -25,18 +25,17 @@ foreach ($values as $value) { try { var_dump(preg_grep($value, $array)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } $value = new stdclass(); //Object try { var_dump(preg_grep($value, $array)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: preg_grep(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_grep_error1.php on line %d bool(false) @@ -48,11 +47,11 @@ bool(false) Warning: preg_grep(): Unknown modifier 'F' in %spreg_grep_error1.php on line %d bool(false) -preg_grep(): Argument #1 ($pattern) must be of type string, array given +TypeError: preg_grep(): Argument #1 ($pattern) must be of type string, array given array(2) { [1]=> string(3) "abc" [2]=> string(4) "test" } -preg_grep(): Argument #1 ($pattern) must be of type string, stdClass given +TypeError: preg_grep(): Argument #1 ($pattern) must be of type string, stdClass given diff --git a/ext/pcre/tests/preg_match_all_error1.phpt b/ext/pcre/tests/preg_match_all_error1.phpt index 92d1a6aff664..4965cc1913bb 100644 --- a/ext/pcre/tests/preg_match_all_error1.phpt +++ b/ext/pcre/tests/preg_match_all_error1.phpt @@ -25,7 +25,7 @@ foreach ($regex_array as $regex_value) { try { var_dump(preg_match_all($regex_value, $subject, $matches1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($matches1); } @@ -33,12 +33,11 @@ $regex_value = new stdclass(); //Object try { var_dump(preg_match_all($regex_value, $subject, $matches)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($matches); ?> --EXPECTF-- - Warning: preg_match_all(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_match_all_error1.php on line %d bool(false) NULL @@ -54,7 +53,7 @@ NULL Warning: preg_match_all(): Unknown modifier 'F' in %spreg_match_all_error1.php on line %d bool(false) NULL -preg_match_all(): Argument #1 ($pattern) must be of type string, array given +TypeError: preg_match_all(): Argument #1 ($pattern) must be of type string, array given NULL int(4) array(1) { @@ -70,5 +69,5 @@ array(1) { string(1) "t" } } -preg_match_all(): Argument #1 ($pattern) must be of type string, stdClass given +TypeError: preg_match_all(): Argument #1 ($pattern) must be of type string, stdClass given NULL diff --git a/ext/pcre/tests/preg_match_error1.phpt b/ext/pcre/tests/preg_match_error1.phpt index 870cc498792c..6507f9e47dd6 100644 --- a/ext/pcre/tests/preg_match_error1.phpt +++ b/ext/pcre/tests/preg_match_error1.phpt @@ -23,19 +23,18 @@ foreach ($regex_array as $regex_value) { try { var_dump(preg_match($regex_value, $subject)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } $regex_value = new stdclass(); //Object try { var_dump(preg_match($regex_value, $subject)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: preg_match(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_match_error1.php on line %d bool(false) @@ -47,6 +46,6 @@ bool(false) Warning: preg_match(): Unknown modifier 'F' in %spreg_match_error1.php on line %d bool(false) -preg_match(): Argument #1 ($pattern) must be of type string, array given +TypeError: preg_match(): Argument #1 ($pattern) must be of type string, array given int(1) -preg_match(): Argument #1 ($pattern) must be of type string, stdClass given +TypeError: preg_match(): Argument #1 ($pattern) must be of type string, stdClass given diff --git a/ext/pcre/tests/preg_replace_callback_array2.phpt b/ext/pcre/tests/preg_replace_callback_array2.phpt index aca11dc19c6f..ffdcdea71db5 100644 --- a/ext/pcre/tests/preg_replace_callback_array2.phpt +++ b/ext/pcre/tests/preg_replace_callback_array2.phpt @@ -9,7 +9,7 @@ $b = ""; try { var_dump(preg_replace_callback_array(array("xx" => "s"), $a, -1, $b)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @@ -24,16 +24,16 @@ var_dump(preg_replace_callback_array(array('/\w' => 'f'), 'z')); try { var_dump(preg_replace_callback_array(array('/\w/' => 'f', '/.*/' => 'f'), 'z')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- -preg_replace_callback_array(): Argument #1 ($pattern) must contain only valid callbacks +TypeError: preg_replace_callback_array(): Argument #1 ($pattern) must contain only valid callbacks string(0) "" Warning: preg_replace_callback_array(): No ending delimiter '/' found in %spreg_replace_callback_array2.php on line %d NULL -string(1) "1" +Exception: 1 Done diff --git a/ext/pcre/tests/preg_replace_error1.phpt b/ext/pcre/tests/preg_replace_error1.phpt index 0a8a79751a9a..5219496a5535 100644 --- a/ext/pcre/tests/preg_replace_error1.phpt +++ b/ext/pcre/tests/preg_replace_error1.phpt @@ -29,11 +29,10 @@ $regex_value = new stdclass(); //Object try { var_dump(preg_replace($regex_value, $replace, $subject)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: preg_replace(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_replace_error1.php on line %d NULL @@ -47,4 +46,4 @@ Warning: preg_replace(): Unknown modifier 'F' in %spreg_replace_error1.php on li NULL string(1) "a" string(1) "1" -preg_replace(): Argument #1 ($pattern) must be of type array|string, stdClass given +TypeError: preg_replace(): Argument #1 ($pattern) must be of type array|string, stdClass given diff --git a/ext/pcre/tests/preg_replace_error2.phpt b/ext/pcre/tests/preg_replace_error2.phpt index 9bc36f655f48..6b4a1bfae934 100644 --- a/ext/pcre/tests/preg_replace_error2.phpt +++ b/ext/pcre/tests/preg_replace_error2.phpt @@ -15,17 +15,17 @@ foreach($replace as $value) { try { var_dump(preg_replace($regex, $value, $subject)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } $value = new stdclass(); //Object try { var_dump(preg_replace($regex, $value, $subject)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(64) "this is a stringthis is a stringthis is a stringthis is a string" -preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given -preg_replace(): Argument #2 ($replacement) must be of type array|string, stdClass given +TypeError: preg_replace(): Argument #1 ($pattern) must be of type array when argument #2 ($replacement) is an array, string given +TypeError: preg_replace(): Argument #2 ($replacement) must be of type array|string, stdClass given diff --git a/ext/pcre/tests/preg_split_error1.phpt b/ext/pcre/tests/preg_split_error1.phpt index 6555f21366ad..9e9fd8c7133d 100644 --- a/ext/pcre/tests/preg_split_error1.phpt +++ b/ext/pcre/tests/preg_split_error1.phpt @@ -25,18 +25,17 @@ foreach ($regex_array as $regex_value) { try { var_dump(preg_split($regex_value, $subject)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } $regex_value = new stdclass(); //Object try { var_dump(preg_split($regex_value, $subject)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- - Warning: preg_split(): Delimiter must not be alphanumeric, backslash, or NUL byte in %spreg_split_error1.php on line %d bool(false) @@ -48,7 +47,7 @@ bool(false) Warning: preg_split(): Unknown modifier 'F' in %spreg_split_error1.php on line %d bool(false) -preg_split(): Argument #1 ($pattern) must be of type string, array given +TypeError: preg_split(): Argument #1 ($pattern) must be of type string, array given array(3) { [0]=> string(4) "1 2 " @@ -57,4 +56,4 @@ array(3) { [2]=> string(4) " 5 6" } -preg_split(): Argument #1 ($pattern) must be of type string, stdClass given +TypeError: preg_split(): Argument #1 ($pattern) must be of type string, stdClass given diff --git a/ext/pdo/tests/bug_77849_2.phpt b/ext/pdo/tests/bug_77849_2.phpt index 3e481eedb1e1..a12b6ce5e90b 100644 --- a/ext/pdo/tests/bug_77849_2.phpt +++ b/ext/pdo/tests/bug_77849_2.phpt @@ -9,7 +9,7 @@ try { $stmt = new PDOStatement(); clone $stmt; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/pdo/tests/pdo_036.phpt b/ext/pdo/tests/pdo_036.phpt index 10fe22193017..113c4f055501 100644 --- a/ext/pdo/tests/pdo_036.phpt +++ b/ext/pdo/tests/pdo_036.phpt @@ -17,7 +17,7 @@ try { $x->queryString = "SELECT 2"; var_dump($x); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $instance = new reflectionclass('pdorow'); @@ -34,7 +34,7 @@ object(PDOStatement)#2 (1) { ["queryString"]=> string(8) "SELECT 1" } -Property queryString is read only +Error: Property queryString is read only Fatal error: Uncaught PDOException: You may not create a PDORow manually in %spdo_036.php:%d Stack trace: diff --git a/ext/pdo/tests/pdo_uninitialized.phpt b/ext/pdo/tests/pdo_uninitialized.phpt index e3b4c96af811..792776ea4ab6 100644 --- a/ext/pdo/tests/pdo_uninitialized.phpt +++ b/ext/pdo/tests/pdo_uninitialized.phpt @@ -16,24 +16,24 @@ $pdo = new MyPDO; try { $pdo->query("foo"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $stmt = new MyPDOStatement; try { $stmt->fetch(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $stmt = new MyPDOStatement; try { foreach ($stmt as $row) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -MyPDO object is uninitialized -MyPDOStatement object is uninitialized -MyPDOStatement object is uninitialized +Error: MyPDO object is uninitialized +Error: MyPDOStatement object is uninitialized +Error: MyPDOStatement object is uninitialized diff --git a/ext/pdo_sqlite/tests/bug66033.phpt b/ext/pdo_sqlite/tests/bug66033.phpt index a45d34a580e6..611cc59c982d 100644 --- a/ext/pdo_sqlite/tests/bug66033.phpt +++ b/ext/pdo_sqlite/tests/bug66033.phpt @@ -24,8 +24,8 @@ $pdo->exec("CREATE TABLE IF NOT EXISTS messages ( try { $pdoStatement = $pdo->query("select * from messages"); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(4) "Blah" +Exception: Blah diff --git a/ext/pdo_sqlite/tests/bug81227.phpt b/ext/pdo_sqlite/tests/bug81227.phpt index b15818e8a137..8fc469ed36f9 100644 --- a/ext/pdo_sqlite/tests/bug81227.phpt +++ b/ext/pdo_sqlite/tests/bug81227.phpt @@ -13,7 +13,7 @@ var_dump($db->inTransaction()); try { $db->beginTransaction(); } catch (PDOException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $db->commit(); @@ -25,6 +25,6 @@ var_dump($db->inTransaction()); --EXPECT-- bool(false) bool(true) -There is already an active transaction +PDOException: There is already an active transaction bool(false) bool(true) diff --git a/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt b/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt index 69cd0897e388..e1b57b39ed15 100644 --- a/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt +++ b/ext/pdo_sqlite/tests/bug_44159_sqlite_version.phpt @@ -10,19 +10,19 @@ $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING); try { var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, NULL)); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 1)); try { var_dump($pdo->setAttribute(PDO::NULL_TO_STRING, 'nonsense')); } catch (\TypeError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } @unlink(__DIR__."/foo.db"); ?> --EXPECT-- -Attribute value must be of type int for selected attribute, null given +TypeError: Attribute value must be of type int for selected attribute, null given bool(true) -Attribute value must be of type int for selected attribute, string given +TypeError: Attribute value must be of type int for selected attribute, string given diff --git a/ext/pdo_sqlite/tests/gh14712.phpt b/ext/pdo_sqlite/tests/gh14712.phpt index d565abacdcd1..269572703093 100644 --- a/ext/pdo_sqlite/tests/gh14712.phpt +++ b/ext/pdo_sqlite/tests/gh14712.phpt @@ -11,8 +11,8 @@ $db = new PDO('sqlite::memory:'); try { $db->query("select 1 as queryStringxx")->fetch(PDO::FETCH_LAZY)->documentElement->firstChild->nextElementSibling->textContent = "é"; } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Attempt to modify property "firstChild" on null +Error: Attempt to modify property "firstChild" on null diff --git a/ext/pdo_sqlite/tests/gh9032.phpt b/ext/pdo_sqlite/tests/gh9032.phpt index 332190484cfb..776f0bdd17df 100644 --- a/ext/pdo_sqlite/tests/gh9032.phpt +++ b/ext/pdo_sqlite/tests/gh9032.phpt @@ -16,9 +16,9 @@ $st = $db->prepare('attach database :a AS "db2"'); $st->execute([':a' => ':memory:']); var_dump($db->exec('create table db2.r (id int)')); } catch (PDOException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- int(0) -SQLSTATE[HY000]: General error: 23 not authorized +PDOException: SQLSTATE[HY000]: General error: 23 not authorized diff --git a/ext/pdo_sqlite/tests/open_basedir.phpt b/ext/pdo_sqlite/tests/open_basedir.phpt index a82c3027aed0..59e5fe273c2c 100644 --- a/ext/pdo_sqlite/tests/open_basedir.phpt +++ b/ext/pdo_sqlite/tests/open_basedir.phpt @@ -11,21 +11,21 @@ chdir(__DIR__); try { $db = new PDO('sqlite:../not_in_open_basedir.sqlite'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db = new PDO('sqlite:file:../not_in_open_basedir.sqlite'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db = new PDO('sqlite:file:../not_in_open_basedir.sqlite?mode=ro'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -open_basedir prohibits opening ../not_in_open_basedir.sqlite -open_basedir prohibits opening file:../not_in_open_basedir.sqlite -open_basedir prohibits opening file:../not_in_open_basedir.sqlite?mode=ro +PDOException: open_basedir prohibits opening ../not_in_open_basedir.sqlite +PDOException: open_basedir prohibits opening file:../not_in_open_basedir.sqlite +PDOException: open_basedir prohibits opening file:../not_in_open_basedir.sqlite?mode=ro diff --git a/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt b/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt index 7fc686b21472..9811208b3a62 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite___construct_uri.phpt @@ -26,7 +26,7 @@ var_dump(file_exists($dbFile)); try { new PDO("uri:{$dsnFile}"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } clearstatcache(); diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt index 192eabbf74fd..d0eefc303868 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createaggregate_002.phpt @@ -10,18 +10,18 @@ $pdo = new PDO('sqlite::memory:'); try { $pdo->sqliteCreateAggregate('foo', 'a', ''); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $pdo->sqliteCreateAggregate('foo', 'strlen', ''); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Method PDO::sqliteCreateAggregate() is deprecated since 8.5, use Pdo\Sqlite::createAggregate() instead in %s on line %d -PDO::sqliteCreateAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name +TypeError: PDO::sqliteCreateAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name Deprecated: Method PDO::sqliteCreateAggregate() is deprecated since 8.5, use Pdo\Sqlite::createAggregate() instead in %s on line %d -PDO::sqliteCreateAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name +TypeError: PDO::sqliteCreateAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt index eb5ea6c97b7d..8a8d099e8d00 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createcollation.phpt @@ -29,7 +29,7 @@ $db->sqliteCreateCollation('MYCOLLATEBAD', function($a, $b) { return $a; }); try { $db->query('SELECT name FROM test_pdo_sqlite_createcollation ORDER BY name COLLATE MYCOLLATEBAD'); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -42,4 +42,4 @@ Deprecated: Method PDO::sqliteCreateCollation() is deprecated since 8.5, use Pdo 2 Deprecated: Method PDO::sqliteCreateCollation() is deprecated since 8.5, use Pdo\Sqlite::createCollation() instead in %s on line %d -PDO::query(): Return value of the collation callback must be of type int, string returned +TypeError: PDO::query(): Return value of the collation callback must be of type int, string returned diff --git a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt index ead2f7b6a830..5f7fbe001a15 100644 --- a/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt +++ b/ext/pdo_sqlite/tests/pdo_sqlite_createfunction_002.phpt @@ -13,10 +13,10 @@ $db = new PDO( 'sqlite::memory:'); try { $db->sqliteCreateFunction('bar-alias', 'bar'); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Method PDO::sqliteCreateFunction() is deprecated since 8.5, use Pdo\Sqlite::createFunction() instead in %s on line %d -PDO::sqliteCreateFunction(): Argument #2 ($callback) must be a valid callback, function "bar" not found or invalid function name +TypeError: PDO::sqliteCreateFunction(): Argument #2 ($callback) must be a valid callback, function "bar" not found or invalid function name diff --git a/ext/pdo_sqlite/tests/subclasses/gh_16131.phpt b/ext/pdo_sqlite/tests/subclasses/gh_16131.phpt index 601ce24f5152..ac0d31bd6122 100644 --- a/ext/pdo_sqlite/tests/subclasses/gh_16131.phpt +++ b/ext/pdo_sqlite/tests/subclasses/gh_16131.phpt @@ -9,7 +9,7 @@ pdo_sqlite try { new Pdo\Pgsql('sqlite::memory:'); } catch (PDOException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class MyPgsql extends Pdo\Pgsql @@ -19,10 +19,10 @@ class MyPgsql extends Pdo\Pgsql try { new MyPgsql('sqlite::memory:'); } catch (PDOException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Pdo\Pgsql::__construct() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::__construct() or PDO::__construct() instead -MyPgsql::__construct() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::__construct() or PDO::__construct() instead +PDOException: Pdo\Pgsql::__construct() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::__construct() or PDO::__construct() instead +PDOException: MyPgsql::__construct() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::__construct() or PDO::__construct() instead diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt index dce8ecf28785..7afa43ac9d3c 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createafunction_arg_error.phpt @@ -18,32 +18,32 @@ class TrampolineTest { try { $db->createFunction(null, [new TrampolineTest(), 'strtoupper']); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createFunction('strtoupper', null); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createFunction('strtoupper', [new TrampolineTest(), 'strtoupper'], null); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createFunction('strtoupper', [new TrampolineTest(), 'strtoupper'], 1, null); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'done!'; ?> --EXPECT-- -Pdo\Sqlite::createFunction(): Argument #1 ($function_name) must be of type string, null given -Pdo\Sqlite::createFunction(): Argument #2 ($callback) must be a valid callback, no array or string given -Pdo\Sqlite::createFunction(): Argument #3 ($num_args) must be of type int, null given -Pdo\Sqlite::createFunction(): Argument #4 ($flags) must be of type int, null given +TypeError: Pdo\Sqlite::createFunction(): Argument #1 ($function_name) must be of type string, null given +TypeError: Pdo\Sqlite::createFunction(): Argument #2 ($callback) must be a valid callback, no array or string given +TypeError: Pdo\Sqlite::createFunction(): Argument #3 ($num_args) must be of type int, null given +TypeError: Pdo\Sqlite::createFunction(): Argument #4 ($flags) must be of type int, null given done! diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt index 3419f5548057..74b5e5fceade 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_002.phpt @@ -11,15 +11,15 @@ $pdo = new Pdo\Sqlite('sqlite::memory:'); try { $pdo->createAggregate('foo', 'a', ''); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $pdo->createAggregate('foo', 'strlen', ''); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name -Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name +TypeError: Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, function "a" not found or invalid function name +TypeError: Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, function "" not found or invalid function name diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt index 7707f8cae978..896aac27a558 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createaggregate_arg_error.phpt @@ -18,46 +18,46 @@ class TrampolineTest { try { $db->createAggregate(null, [new TrampolineTest(), 'step'], null, 1); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createAggregate(null, null, [new TrampolineTest(), 'step'], 1); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createAggregate(null, [new TrampolineTest(), 'step'], [new TrampolineTest(), 'step'], 1); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createAggregate('S', null, [new TrampolineTest(), 'finalize'], 1); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createAggregate('S', [new TrampolineTest(), 'step'], null, 1); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createAggregate('S', [new TrampolineTest(), 'step'], [new TrampolineTest(), 'finalize'], null); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'done!'; ?> --EXPECT-- -Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given -Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, no array or string given -Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, no array or string given -Pdo\Sqlite::createAggregate(): Argument #4 ($numArgs) must be of type int, null given +TypeError: Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +TypeError: Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +TypeError: Pdo\Sqlite::createAggregate(): Argument #1 ($name) must be of type string, null given +TypeError: Pdo\Sqlite::createAggregate(): Argument #2 ($step) must be a valid callback, no array or string given +TypeError: Pdo\Sqlite::createAggregate(): Argument #3 ($finalize) must be a valid callback, no array or string given +TypeError: Pdo\Sqlite::createAggregate(): Argument #4 ($numArgs) must be of type int, null given done! diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt index 16bb8b9333e4..95b591b105c2 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_arg_error.phpt @@ -18,18 +18,18 @@ class TrampolineTest { try { $db->createCollation(null, [new TrampolineTest(), 'NAT']); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $db->createCollation('NAT', null); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'done!'; ?> --EXPECT-- -Pdo\Sqlite::createCollation(): Argument #1 ($name) must be of type string, null given -Pdo\Sqlite::createCollation(): Argument #2 ($callback) must be a valid callback, no array or string given +TypeError: Pdo\Sqlite::createCollation(): Argument #1 ($name) must be of type string, null given +TypeError: Pdo\Sqlite::createCollation(): Argument #2 ($callback) must be a valid callback, no array or string given done! diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_wrong_callback.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_wrong_callback.phpt index 2a493c211797..0f8718604567 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_wrong_callback.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_createcollation_wrong_callback.phpt @@ -17,8 +17,8 @@ $db->createCollation('NAT', function($a, $b): string { return $a . $b; }); try { $db->query("SELECT c FROM test ORDER BY c COLLATE NAT"); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -PDO::query(): Return value of the collation callback must be of type int, string returned +TypeError: PDO::query(): Return value of the collation callback must be of type int, string returned diff --git a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt index d2a6c2a5f52b..77182ae310b8 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdo_sqlite_getsetattr_explain.phpt @@ -36,25 +36,25 @@ class Duh {} try { $stmts->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, "EXPLAIN"); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $stmts->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, new Duh()); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $stmts->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, -1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $stmts->setAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT, 256); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($stmts->getAttribute(Pdo\Sqlite::ATTR_EXPLAIN_STATEMENT) == Pdo\Sqlite::EXPLAIN_MODE_PREPARED); @@ -393,8 +393,8 @@ array(2) { string(13) "second_insert" } } -explain mode must be of type int, string given -explain mode must be of type int, Duh given -explain mode must be one of the Pdo\Sqlite::EXPLAIN_MODE_* constants -explain mode must be one of the Pdo\Sqlite::EXPLAIN_MODE_* constants +TypeError: explain mode must be of type int, string given +TypeError: explain mode must be of type int, Duh given +ValueError: explain mode must be one of the Pdo\Sqlite::EXPLAIN_MODE_* constants +ValueError: explain mode must be one of the Pdo\Sqlite::EXPLAIN_MODE_* constants bool(true) diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt index 24120f1d8205..19da0daaebab 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_005.phpt @@ -9,9 +9,9 @@ pdo_sqlite try { Pdo\Pgsql::connect('sqlite::memory:'); } catch (PDOException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Pdo\Pgsql::connect() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::connect() or PDO::connect() instead +PDOException: Pdo\Pgsql::connect() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::connect() or PDO::connect() instead diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_007.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_007.phpt index 58568abe7363..cc8cdec78967 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_007.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_007.phpt @@ -10,9 +10,9 @@ class MyPDO extends PDO {} try { MyPDO::connect('sqlite::memory:'); } catch (PDOException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -MyPDO::connect() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::connect() or PDO::connect() instead +PDOException: MyPDO::connect() cannot be used for connecting to the "sqlite" driver, either call Pdo\Sqlite::connect() or PDO::connect() instead diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt index 75f3de6b581a..829f515ece64 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_load_extension_failure.phpt @@ -22,7 +22,7 @@ try { echo "Failed to throw exception"; } catch (PDOException $pdoException) { - echo $pdoException->getMessage() . "\n"; + echo $pdoException::class, ': ', $pdoException->getMessage(), "\n"; } try { @@ -31,14 +31,14 @@ try { echo "Failed to throw exception"; } catch (PDOException $pdoException) { - echo $pdoException->getMessage() . "\n"; + echo $pdoException::class, ': ', $pdoException->getMessage(), "\n"; } echo "Fin."; ?> --EXPECTF-- Loading non-existent file. -Unable to load extension "/this/does/not_exist" +PDOException: Unable to load extension "/this/does/not_exist" Loading invalid file. -Unable to load extension "%a" +PDOException: Unable to load extension "%a" Fin. diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer.phpt index d1e9039ea1c4..92a9b28a3cfb 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer.phpt @@ -22,7 +22,7 @@ try { // This one should fail var_dump($db->exec('CREATE TABLE test (a, b);')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test disabling the authorizer @@ -51,7 +51,7 @@ $db->setAuthorizer(function () { try { var_dump($db->query('SELECT 1;')); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $db->setAuthorizer(function () { @@ -61,7 +61,7 @@ $db->setAuthorizer(function () { try { var_dump($db->query('SELECT 1;')); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -70,7 +70,7 @@ object(PDOStatement)#%d (1) { ["queryString"]=> string(9) "SELECT 1;" } -SQLSTATE[HY000]: General error: 23 not authorized +PDOException: SQLSTATE[HY000]: General error: 23 not authorized int(1) int(1) string(6) "SELECT" @@ -97,5 +97,5 @@ string(28) "sqlite_master,rootpage,main," string(4) "READ" string(28) "sqlite_master,rootpage,main," int(1) -PDO::query(): Return value of the authorizer callback must be of type int, string returned -PDO::query(): Return value of the authorizer callback must be one of Pdo\Sqlite::OK, Pdo\Sqlite::DENY, or Pdo\Sqlite::IGNORE +TypeError: PDO::query(): Return value of the authorizer callback must be of type int, string returned +ValueError: PDO::query(): Return value of the authorizer callback must be one of Pdo\Sqlite::OK, Pdo\Sqlite::DENY, or Pdo\Sqlite::IGNORE diff --git a/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer_trampoline.phpt b/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer_trampoline.phpt index c93a1f2e34a5..1bceccb48570 100644 --- a/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer_trampoline.phpt +++ b/ext/pdo_sqlite/tests/subclasses/pdosqlite_setauthorizer_trampoline.phpt @@ -29,7 +29,7 @@ try { // This one should fail var_dump($db->query('CREATE TABLE test (a, b);')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -40,4 +40,4 @@ object(PDOStatement)#%d (1) { string(9) "SELECT 1;" } Trampoline for authorizer -SQLSTATE[HY000]: General error: 23 not authorized +PDOException: SQLSTATE[HY000]: General error: 23 not authorized diff --git a/ext/pgsql/tests/gh17158.phpt b/ext/pgsql/tests/gh17158.phpt index ade47ededed1..0b7c47ff7d90 100644 --- a/ext/pgsql/tests/gh17158.phpt +++ b/ext/pgsql/tests/gh17158.phpt @@ -8,9 +8,9 @@ pgsql try { pg_fetch_result(null); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -pg_fetch_result() expects at least 2 arguments, 1 given +ArgumentCountError: pg_fetch_result() expects at least 2 arguments, 1 given diff --git a/ext/pgsql/tests/no_link_open.phpt b/ext/pgsql/tests/no_link_open.phpt index 4a94401f3e6e..b44592c9ea14 100644 --- a/ext/pgsql/tests/no_link_open.phpt +++ b/ext/pgsql/tests/no_link_open.phpt @@ -8,10 +8,10 @@ pgsql try { pg_dbname(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: pg_dbname(): Automatic fetching of PostgreSQL connection is deprecated in %s on line %d -No PostgreSQL connection opened yet +Error: No PostgreSQL connection opened yet diff --git a/ext/phar/tests/002.phpt b/ext/phar/tests/002.phpt index c89f223b2b9c..793276d07cbc 100644 --- a/ext/phar/tests/002.phpt +++ b/ext/phar/tests/002.phpt @@ -7,15 +7,15 @@ phar try { Phar::mapPhar(5, 'hio', 'hi'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::mapPhar(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } __HALT_COMPILER(); ?> --EXPECTF-- -Phar::mapPhar() expects at most 2 arguments, 3 given -internal corruption of phar "%s002.php" (truncated manifest at manifest length) +ArgumentCountError: Phar::mapPhar() expects at most 2 arguments, 3 given +PharException: internal corruption of phar "%s002.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/004.phpt b/ext/phar/tests/004.phpt index 90d4572f0718..ffa73318ec3b 100644 --- a/ext/phar/tests/004.phpt +++ b/ext/phar/tests/004.phpt @@ -7,8 +7,8 @@ phar try { Phar::mapPhar('hio'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -__HALT_COMPILER(); must be declared in a phar +PharException: __HALT_COMPILER(); must be declared in a phar diff --git a/ext/phar/tests/005.phpt b/ext/phar/tests/005.phpt index 6bc2985f9f9c..3119e4c3bcd5 100644 --- a/ext/phar/tests/005.phpt +++ b/ext/phar/tests/005.phpt @@ -7,8 +7,8 @@ phar try { Phar::mapPhar('hio'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } __HALT_COMPILER(); ?>() --EXPECTF-- -internal corruption of phar "%s" (truncated manifest at manifest length) +PharException: internal corruption of phar "%s" (truncated manifest at manifest length) diff --git a/ext/phar/tests/006.phpt b/ext/phar/tests/006.phpt index e203bff90e7a..db01fa53736f 100644 --- a/ext/phar/tests/006.phpt +++ b/ext/phar/tests/006.phpt @@ -7,8 +7,8 @@ phar try { Phar::mapPhar('hio'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } __HALT_COMPILER(); ?> --EXPECTF-- -internal corruption of phar "%s" (truncated manifest at manifest length) +PharException: internal corruption of phar "%s" (truncated manifest at manifest length) diff --git a/ext/phar/tests/007.phpt b/ext/phar/tests/007.phpt index 701e6ccf08e3..1e62b12ae03d 100644 --- a/ext/phar/tests/007.phpt +++ b/ext/phar/tests/007.phpt @@ -7,8 +7,8 @@ phar try { Phar::mapPhar('hio'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } __HALT_COMPILER(); ?>~~~~ --EXPECTF-- -manifest cannot be larger than 100 MB in phar "%s" +PharException: manifest cannot be larger than 100 MB in phar "%s" diff --git a/ext/phar/tests/008.phpt b/ext/phar/tests/008.phpt index a8e7eaec39e7..00a211c54240 100644 --- a/ext/phar/tests/008.phpt +++ b/ext/phar/tests/008.phpt @@ -12,10 +12,10 @@ file_put_contents(__DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php', $fil try { include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php'; } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- --EXPECTF-- -internal corruption of phar "%s" (truncated manifest header) +PharException: internal corruption of phar "%s" (truncated manifest header) diff --git a/ext/phar/tests/009.phpt b/ext/phar/tests/009.phpt index d18329395a68..1e268b0a1f76 100644 --- a/ext/phar/tests/009.phpt +++ b/ext/phar/tests/009.phpt @@ -14,10 +14,10 @@ file_put_contents(__DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php', $fil try { include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php'; } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- --EXPECTF-- -internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest) +PharException: internal corruption of phar "%s009.phar.php" (too many manifest entries for size of manifest) diff --git a/ext/phar/tests/010.phpt b/ext/phar/tests/010.phpt index 724d67d815de..4c91ffbc9663 100644 --- a/ext/phar/tests/010.phpt +++ b/ext/phar/tests/010.phpt @@ -20,10 +20,10 @@ try { include __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.php'; echo file_get_contents('phar://hio/a'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- --EXPECTF-- -internal corruption of phar "%s" (too many manifest entries for size of manifest) +PharException: internal corruption of phar "%s" (too many manifest entries for size of manifest) diff --git a/ext/phar/tests/011.phpt b/ext/phar/tests/011.phpt index d143bd5091a9..cb3c3e535843 100644 --- a/ext/phar/tests/011.phpt +++ b/ext/phar/tests/011.phpt @@ -21,10 +21,10 @@ try { include $fname; echo file_get_contents('phar://hio/a'); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --CLEAN-- --EXPECTF-- -internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry) +PharException: internal corruption of phar "%s" (compressed and uncompressed size does not match for uncompressed entry) diff --git a/ext/phar/tests/029.phpt b/ext/phar/tests/029.phpt index 1b664fbdb742..ff1742d7253f 100644 --- a/ext/phar/tests/029.phpt +++ b/ext/phar/tests/029.phpt @@ -33,7 +33,7 @@ try } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -45,4 +45,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.php'); --EXPECTF-- bool(true) bool(true) -alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php" +PharException: alias "copy" is already used for archive "%s029.1.phar.php" cannot be overloaded with "%s029.2.phar.php" diff --git a/ext/phar/tests/030.phpt b/ext/phar/tests/030.phpt index e558261df89c..b5640a6eb6d5 100644 --- a/ext/phar/tests/030.phpt +++ b/ext/phar/tests/030.phpt @@ -29,7 +29,7 @@ var_dump(isset($p['.phar/test'])); try { $p['.phar/test']; } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -43,4 +43,4 @@ This is b/c This is b/d This is e bool(false) -Cannot directly get any files or directories in magic ".phar" directory +BadMethodCallException: Cannot directly get any files or directories in magic ".phar" directory diff --git a/ext/phar/tests/032.phpt b/ext/phar/tests/032.phpt index 7099320e8915..f813f43afd3b 100644 --- a/ext/phar/tests/032.phpt +++ b/ext/phar/tests/032.phpt @@ -14,7 +14,7 @@ require_once 'files/phar_oo_test.inc'; try { Phar::loadPhar($fname); } catch (Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -25,4 +25,5 @@ unlink(__DIR__ . '/files/032.phar.php'); __halt_compiler(); ?> --EXPECTF-- -phar "%s032.phar.php" does not have a signature===DONE=== +PharException: phar "%s032.phar.php" does not have a signature +===DONE=== diff --git a/ext/phar/tests/033a.phpt b/ext/phar/tests/033a.phpt index 355617b29f93..ba7df5cc4423 100644 --- a/ext/phar/tests/033a.phpt +++ b/ext/phar/tests/033a.phpt @@ -28,7 +28,7 @@ try { $a['a.php']->chmod(0666); var_dump($a['a.php']->isExecutable()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -37,4 +37,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.1.phar.php'); ?> --EXPECTF-- bool(false) -Cannot modify permissions for file "a.php" in phar "%s033a.1.phar.php", write operations are prohibited +PharException: Cannot modify permissions for file "a.php" in phar "%s033a.1.phar.php", write operations are prohibited diff --git a/ext/phar/tests/addfuncs.phpt b/ext/phar/tests/addfuncs.phpt index 9707cb5b1f41..1f892cbcde12 100644 --- a/ext/phar/tests/addfuncs.phpt +++ b/ext/phar/tests/addfuncs.phpt @@ -16,27 +16,27 @@ echo file_get_contents($pname . '/b') . "\n"; try { $phar->addFile($pname . '/a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFile($pname . '/a', 'a'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFile(__DIR__ . '/does/not/exist'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFile($pname . '/a', '.phar/stub.php'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFromString('.phar/stub.php', 'hi'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -44,8 +44,8 @@ echo $e->getMessage() . "\n"; --EXPECTF-- hi hi -Entry phar://%saddfuncs.phar.php/a does not exist and cannot be created: phar error: invalid path "phar://%saddfuncs.phar.php/a" contains double slash -Entry a does not exist and cannot be created: phar error: file "a" in phar "%saddfuncs.phar.php" cannot be opened for writing, readable file pointers are open -phar error: unable to open file "%s/does/not/exist" to add to phar archive -Cannot create any files in magic ".phar" directory -Cannot create any files in magic ".phar" directory +BadMethodCallException: Entry phar://%saddfuncs.phar.php/a does not exist and cannot be created: phar error: invalid path "phar://%saddfuncs.phar.php/a" contains double slash +BadMethodCallException: Entry a does not exist and cannot be created: phar error: file "a" in phar "%saddfuncs.phar.php" cannot be opened for writing, readable file pointers are open +RuntimeException: phar error: unable to open file "%s/does/not/exist" to add to phar archive +BadMethodCallException: Cannot create any files in magic ".phar" directory +BadMethodCallException: Cannot create any files in magic ".phar" directory diff --git a/ext/phar/tests/alias_acrobatics.phpt b/ext/phar/tests/alias_acrobatics.phpt index b2f80c0abe74..014f2351517f 100644 --- a/ext/phar/tests/alias_acrobatics.phpt +++ b/ext/phar/tests/alias_acrobatics.phpt @@ -17,19 +17,19 @@ $p['unused'] = 'hi'; try { $a = new Phar($fname2, 0, 'foo'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } copy($fname, $fname2); echo "2\n"; try { $a = new Phar($fname2); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = new Phar($fname, 0, 'another'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -38,7 +38,7 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar'); ?> --EXPECTF-- -alias "foo" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.2.phar" +UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.2.phar" 2 -Cannot open archive "%salias_acrobatics.2.phar", alias is already in use by existing archive -alias "another" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.phar" +UnexpectedValueException: Cannot open archive "%salias_acrobatics.2.phar", alias is already in use by existing archive +UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar" cannot be overloaded with "%salias_acrobatics.phar" diff --git a/ext/phar/tests/badparameters.phpt b/ext/phar/tests/badparameters.phpt index efa74678f897..92906283d071 100644 --- a/ext/phar/tests/badparameters.phpt +++ b/ext/phar/tests/badparameters.phpt @@ -11,258 +11,258 @@ ini_set('phar.readonly', 1); try { Phar::mungServer('hi'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::createDefaultStub(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::loadPhar(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::canCompress('hi'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = new Phar(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = new Phar(__DIR__ . '/files/frontcontroller10.phar'); } catch (PharException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->convertToExecutable(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->convertToData(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = new PharData(__DIR__ . '/whatever.tar'); } catch (PharException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $c = new PharData(__DIR__ . '/whatever.zip'); } catch (PharException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->delete(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->delete('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->delete('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $a->getPath() . "\n"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setAlias('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->setAlias('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); try { $a->setAlias(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $b->stopBuffering(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setStub('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->setStub('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); try { $a->setStub(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $b->setDefaultStub('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setDefaultStub(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setDefaultStub('oops'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setSignatureAlgorithm(Phar::MD5); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->compress(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->compress(1); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->compressFiles(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->decompressFiles(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->copy(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->copy('a', 'b'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->offsetExists(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->offsetGet(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); try { $a->offsetSet(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $b->offsetUnset(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->offsetUnset('a'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->addEmptyDir(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->addFile(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->addFromString(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->setMetadata('a'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); try { $a->setMetadata(1,2); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $a->delMetadata(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Phar::mungServer(): Argument #1 ($variables) must be of type array, string given -Phar::createDefaultStub(): Argument #1 ($index) must be of type ?string, array given -Phar::loadPhar(): Argument #1 ($filename) must be of type string, array given -Phar::canCompress(): Argument #1 ($compression) must be of type int, string given -Phar::__construct(): Argument #1 ($filename) must be of type string, array given -Phar::convertToExecutable(): Argument #1 ($format) must be of type ?int, array given -Phar::convertToData(): Argument #1 ($format) must be of type ?int, array given -PharData::delete(): Argument #1 ($localName) must be of type string, array given -Cannot write out phar archive, phar is read-only -Entry oops does not exist and cannot be deleted +TypeError: Phar::mungServer(): Argument #1 ($variables) must be of type array, string given +TypeError: Phar::createDefaultStub(): Argument #1 ($index) must be of type ?string, array given +TypeError: Phar::loadPhar(): Argument #1 ($filename) must be of type string, array given +TypeError: Phar::canCompress(): Argument #1 ($compression) must be of type int, string given +TypeError: Phar::__construct(): Argument #1 ($filename) must be of type string, array given +TypeError: Phar::convertToExecutable(): Argument #1 ($format) must be of type ?int, array given +TypeError: Phar::convertToData(): Argument #1 ($format) must be of type ?int, array given +TypeError: PharData::delete(): Argument #1 ($localName) must be of type string, array given +UnexpectedValueException: Cannot write out phar archive, phar is read-only +BadMethodCallException: Entry oops does not exist and cannot be deleted %sfrontcontroller10.phar -Cannot write out phar archive, phar is read-only -A Phar alias cannot be set in a plain tar archive -Phar::setAlias(): Argument #1 ($alias) must be of type string, array given -Cannot change stub, phar is read-only -A Phar stub cannot be set in a plain tar archive -Phar::setStub(): Argument #1 ($stub) must be of type string, array given -A Phar stub cannot be set in a plain tar archive -Phar::setDefaultStub(): Argument #1 ($index) must be of type ?string, array given -Cannot change stub: phar.readonly=1 -Cannot set signature algorithm, phar is read-only -Phar::compress(): Argument #1 ($compression) must be of type int, array given -Cannot compress phar archive, phar is read-only -Phar::compressFiles(): Argument #1 ($compression) must be of type int, array given -Phar is readonly, cannot change compression -Phar::copy() expects exactly 2 arguments, 1 given -Cannot copy "a" to "b", phar is read-only -Phar::offsetExists(): Argument #1 ($localName) must be of type string, array given -Phar::offsetGet(): Argument #1 ($localName) must be of type string, array given -Phar::offsetSet() expects exactly 2 arguments, 1 given -PharData::offsetUnset(): Argument #1 ($localName) must be of type string, array given -Write operations disabled by the php.ini setting phar.readonly -Phar::addEmptyDir(): Argument #1 ($directory) must be of type string, array given -Phar::addFile(): Argument #1 ($filename) must be of type string, array given -Phar::addFromString() expects exactly 2 arguments, 1 given -Write operations disabled by the php.ini setting phar.readonly -Phar::setMetadata() expects exactly 1 argument, 2 given -Write operations disabled by the php.ini setting phar.readonly +UnexpectedValueException: Cannot write out phar archive, phar is read-only +UnexpectedValueException: A Phar alias cannot be set in a plain tar archive +TypeError: Phar::setAlias(): Argument #1 ($alias) must be of type string, array given +UnexpectedValueException: Cannot change stub, phar is read-only +UnexpectedValueException: A Phar stub cannot be set in a plain tar archive +TypeError: Phar::setStub(): Argument #1 ($stub) must be of type string, array given +UnexpectedValueException: A Phar stub cannot be set in a plain tar archive +TypeError: Phar::setDefaultStub(): Argument #1 ($index) must be of type ?string, array given +UnexpectedValueException: Cannot change stub: phar.readonly=1 +UnexpectedValueException: Cannot set signature algorithm, phar is read-only +TypeError: Phar::compress(): Argument #1 ($compression) must be of type int, array given +UnexpectedValueException: Cannot compress phar archive, phar is read-only +TypeError: Phar::compressFiles(): Argument #1 ($compression) must be of type int, array given +BadMethodCallException: Phar is readonly, cannot change compression +ArgumentCountError: Phar::copy() expects exactly 2 arguments, 1 given +UnexpectedValueException: Cannot copy "a" to "b", phar is read-only +TypeError: Phar::offsetExists(): Argument #1 ($localName) must be of type string, array given +TypeError: Phar::offsetGet(): Argument #1 ($localName) must be of type string, array given +ArgumentCountError: Phar::offsetSet() expects exactly 2 arguments, 1 given +TypeError: PharData::offsetUnset(): Argument #1 ($localName) must be of type string, array given +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly +TypeError: Phar::addEmptyDir(): Argument #1 ($directory) must be of type string, array given +TypeError: Phar::addFile(): Argument #1 ($filename) must be of type string, array given +ArgumentCountError: Phar::addFromString() expects exactly 2 arguments, 1 given +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly +ArgumentCountError: Phar::setMetadata() expects exactly 1 argument, 2 given +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/bug13786.phpt b/ext/phar/tests/bug13786.phpt index d190343b68e6..422b1f9b6e58 100644 --- a/ext/phar/tests/bug13786.phpt +++ b/ext/phar/tests/bug13786.phpt @@ -21,10 +21,10 @@ for ($i = 0; $i < 2; $i++) { echo("\nWritten files: $i\n"); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- string(26) "file 0 in DataArchive.phar" -unable to seek to start of file "0" while creating new phar "%sDataArchive.phar" +PharException: unable to seek to start of file "0" while creating new phar "%sDataArchive.phar" diff --git a/ext/phar/tests/bug45218_SLOWTEST.phpt b/ext/phar/tests/bug45218_SLOWTEST.phpt index a0ac5922b840..01eacd3899de 100644 --- a/ext/phar/tests/bug45218_SLOWTEST.phpt +++ b/ext/phar/tests/bug45218_SLOWTEST.phpt @@ -49,8 +49,7 @@ try { } var_dump($ret); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/bug48377.2.phpt b/ext/phar/tests/bug48377.2.phpt index 547e908b11b8..a0638b81b3ab 100644 --- a/ext/phar/tests/bug48377.2.phpt +++ b/ext/phar/tests/bug48377.2.phpt @@ -14,10 +14,10 @@ $phar['x'] = 'hi'; try { $phar->convertToData(Phar::ZIP, Phar::NONE, 'phar.zip'); } catch (BadMethodCallException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECTF-- -data phar "%sbug48377.2.phar.zip" has invalid extension phar.zip +BadMethodCallException: data phar "%sbug48377.2.phar.zip" has invalid extension phar.zip diff --git a/ext/phar/tests/bug48377.phpt b/ext/phar/tests/bug48377.phpt index 6b964b97ef98..3fa3b1a3954a 100644 --- a/ext/phar/tests/bug48377.phpt +++ b/ext/phar/tests/bug48377.phpt @@ -17,11 +17,11 @@ $phar['x'] = 'hi'; try { $phar->convertToData(Phar::ZIP, Phar::NONE, 'zip'); } catch (BadMethodCallException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECTF-- -phar "%sbug48377.zip" exists and must be unlinked prior to conversion +BadMethodCallException: phar "%sbug48377.zip" exists and must be unlinked prior to conversion diff --git a/ext/phar/tests/bug54395.phpt b/ext/phar/tests/bug54395.phpt index 44c3de0e3226..0e4870c8b1a5 100644 --- a/ext/phar/tests/bug54395.phpt +++ b/ext/phar/tests/bug54395.phpt @@ -8,9 +8,9 @@ phar try { phar::mount(1,1); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(25) "Mounting of 1 to 1 failed" +PharException: Mounting of 1 to 1 failed diff --git a/ext/phar/tests/bug60261.phpt b/ext/phar/tests/bug60261.phpt index d56d8c16e9de..6c2a6185a98d 100644 --- a/ext/phar/tests/bug60261.phpt +++ b/ext/phar/tests/bug60261.phpt @@ -9,9 +9,9 @@ try { $nx = new Phar(); $nx->getLinkTarget(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Phar::__construct() expects at least 1 argument, 0 given +ArgumentCountError: Phar::__construct() expects at least 1 argument, 0 given diff --git a/ext/phar/tests/bug64931/bug64931.phpt b/ext/phar/tests/bug64931/bug64931.phpt index 20f708f8294f..9475ef38a766 100644 --- a/ext/phar/tests/bug64931/bug64931.phpt +++ b/ext/phar/tests/bug64931/bug64931.phpt @@ -15,31 +15,31 @@ $phar->addFile(__DIR__."/src/.pharignore", ".pharignore"); try { $phar->addFile(__DIR__."/src/.pharignore", ".phar/gotcha"); } catch (Exception $e) { - echo "CAUGHT: ". $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFromString(".phar", "gotcha"); } catch (Exception $e) { - echo "CAUGHT: ". $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFromString(".phar//", "gotcha"); } catch (Exception $e) { - echo "CAUGHT: ". $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFromString(".phar\\", "gotcha"); } catch (Exception $e) { - echo "CAUGHT: ". $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addFromString(".phar\0", "gotcha"); } catch (ValueError $e) { - echo "CAUGHT: ". $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -49,8 +49,8 @@ try { ?> --EXPECT-- Test -CAUGHT: Cannot create any files in magic ".phar" directory -CAUGHT: Cannot create any files in magic ".phar" directory -CAUGHT: Cannot create any files in magic ".phar" directory -CAUGHT: Cannot create any files in magic ".phar" directory -CAUGHT: Phar::addFromString(): Argument #1 ($localName) must not contain any null bytes +BadMethodCallException: Cannot create any files in magic ".phar" directory +BadMethodCallException: Cannot create any files in magic ".phar" directory +BadMethodCallException: Cannot create any files in magic ".phar" directory +BadMethodCallException: Cannot create any files in magic ".phar" directory +ValueError: Phar::addFromString(): Argument #1 ($localName) must not contain any null bytes diff --git a/ext/phar/tests/bug65028.phpt b/ext/phar/tests/bug65028.phpt index 4acf364bc4f5..436d3e7cb458 100644 --- a/ext/phar/tests/bug65028.phpt +++ b/ext/phar/tests/bug65028.phpt @@ -143,7 +143,7 @@ try } catch(UnexpectedValueException $ex) { - echo "Exception thrown: " . $ex->getMessage() . "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/bug65414.phpt b/ext/phar/tests/bug65414.phpt index d3ff77947144..4e752b018d05 100644 --- a/ext/phar/tests/bug65414.phpt +++ b/ext/phar/tests/bug65414.phpt @@ -19,14 +19,14 @@ foreach ($bads as $bad) { $phar->addFromString($bad, 'this content is injected'); echo 'Failed to throw expected exception'; } catch (BadMethodCallException $ex) { - echo $ex->getMessage() . PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } } echo 'done' . PHP_EOL; ?> --EXPECT-- -.phar/injected-1.txt:Cannot create any files in magic ".phar" directory -/.phar/injected-2.txt:Cannot create any files in magic ".phar" directory -//.phar/injected-3.txt:Entry //.phar/injected-3.txt does not exist and cannot be created: phar error: invalid path "//.phar/injected-3.txt" contains double slash -/.phar/:Cannot create any files in magic ".phar" directory +.phar/injected-1.txt:BadMethodCallException: Cannot create any files in magic ".phar" directory +/.phar/injected-2.txt:BadMethodCallException: Cannot create any files in magic ".phar" directory +//.phar/injected-3.txt:BadMethodCallException: Entry //.phar/injected-3.txt does not exist and cannot be created: phar error: invalid path "//.phar/injected-3.txt" contains double slash +/.phar/:BadMethodCallException: Cannot create any files in magic ".phar" directory done diff --git a/ext/phar/tests/bug69324.phpt b/ext/phar/tests/bug69324.phpt index be7df7ec2531..d6ddbea76574 100644 --- a/ext/phar/tests/bug69324.phpt +++ b/ext/phar/tests/bug69324.phpt @@ -9,8 +9,8 @@ $p = new Phar(__DIR__.'/bug69324.phar', 0); $meta=$p->getMetadata(); var_dump($meta); } catch(Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -internal corruption of phar "%s" (truncated manifest entry) +UnexpectedValueException: internal corruption of phar "%s" (truncated manifest entry) diff --git a/ext/phar/tests/bug71498.phpt b/ext/phar/tests/bug71498.phpt index 62b5bbec76b9..a426a6597db8 100644 --- a/ext/phar/tests/bug71498.phpt +++ b/ext/phar/tests/bug71498.phpt @@ -7,11 +7,12 @@ phar try { $p = new PharData(__DIR__."/bug71498.zip"); } catch(UnexpectedValueException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> DONE --EXPECTF-- -phar error: end of central directory not found in zip-based phar "%s%ebug71498.zip" +UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%s%ebug71498.zip" + DONE diff --git a/ext/phar/tests/bug72321.phpt b/ext/phar/tests/bug72321.phpt index 1184be869ac0..8c8edb572d43 100644 --- a/ext/phar/tests/bug72321.phpt +++ b/ext/phar/tests/bug72321.phpt @@ -12,7 +12,7 @@ $phar = new PharData("72321_2.zip"); try { $phar->extractTo("test72321"); } catch(PharException $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE @@ -21,5 +21,5 @@ DONE rmdir(__DIR__."/test72321"); ?> --EXPECTF-- -Extraction from phar "%s72321_2.zip" failed: Cannot extract "AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b/c", could not create directory "test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b" +PharException: Extraction from phar "%s72321_2.zip" failed: Cannot extract "AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b/c", could not create directory "test72321/AAAAAAAAxxxxBBBBCCCCCCCCxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx/b" DONE diff --git a/ext/phar/tests/bug72928.phpt b/ext/phar/tests/bug72928.phpt index 352e1b5c34d1..e2a1f99437ea 100644 --- a/ext/phar/tests/bug72928.phpt +++ b/ext/phar/tests/bug72928.phpt @@ -9,10 +9,10 @@ try { $phar = new PharData('bug72928.zip'); var_dump($phar); } catch(UnexpectedValueException $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECTF-- -phar error: signature cannot be read in zip-based phar "%sbug72928.zip" +UnexpectedValueException: phar error: signature cannot be read in zip-based phar "%sbug72928.zip" DONE diff --git a/ext/phar/tests/bug73035.phpt b/ext/phar/tests/bug73035.phpt index 24965128b727..aba9feb8760c 100644 --- a/ext/phar/tests/bug73035.phpt +++ b/ext/phar/tests/bug73035.phpt @@ -9,10 +9,10 @@ try { $phar = new PharData('bug73035.tar'); var_dump($phar); } catch(UnexpectedValueException $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECTF-- -phar error: tar-based phar "%sbug73035.tar" signature cannot be read +UnexpectedValueException: phar error: tar-based phar "%sbug73035.tar" signature cannot be read DONE diff --git a/ext/phar/tests/bug73764.phpt b/ext/phar/tests/bug73764.phpt index 7082049b1948..4e52efb3ccb0 100644 --- a/ext/phar/tests/bug73764.phpt +++ b/ext/phar/tests/bug73764.phpt @@ -9,8 +9,8 @@ try { $p = Phar::LoadPhar('bug73764.phar', 'alias.phar'); echo "OK\n"; } catch(PharException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -internal corruption of phar "%sbug73764.phar" (truncated manifest entry) +PharException: internal corruption of phar "%sbug73764.phar" (truncated manifest entry) diff --git a/ext/phar/tests/bug73768.phpt b/ext/phar/tests/bug73768.phpt index be73d45cfd57..7de6966130f9 100644 --- a/ext/phar/tests/bug73768.phpt +++ b/ext/phar/tests/bug73768.phpt @@ -9,8 +9,8 @@ try { $p = Phar::LoadPhar('bug73768.phar', 'alias.phar'); echo "OK\n"; } catch(PharException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -internal corruption of phar "%sbug73768.phar" (truncated manifest header) +PharException: internal corruption of phar "%sbug73768.phar" (truncated manifest header) diff --git a/ext/phar/tests/bug73809.phpt b/ext/phar/tests/bug73809.phpt index 375bb7e5e763..c6eaa2dfd947 100644 --- a/ext/phar/tests/bug73809.phpt +++ b/ext/phar/tests/bug73809.phpt @@ -16,7 +16,7 @@ var_dump($zip->close()); try { $phar = new PharData(__DIR__ . '/73809.zip'); } catch (Exception $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --CLEAN-- @@ -25,4 +25,4 @@ try { ?> --EXPECTF-- bool(true) -phar error: signatures larger than 64 KiB are not supported in zip-based phar "%s" +UnexpectedValueException: phar error: signatures larger than 64 KiB are not supported in zip-based phar "%s" diff --git a/ext/phar/tests/bug77143.phpt b/ext/phar/tests/bug77143.phpt index 21b52d6427cd..668c90f13217 100644 --- a/ext/phar/tests/bug77143.phpt +++ b/ext/phar/tests/bug77143.phpt @@ -11,8 +11,8 @@ try { var_dump(new Phar('bug77143.phar',0,'project.phar')); echo "OK\n"; } catch(UnexpectedValueException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -internal corruption of phar "%sbug77143.phar" (truncated manifest header) +UnexpectedValueException: internal corruption of phar "%sbug77143.phar" (truncated manifest header) diff --git a/ext/phar/tests/bug77247.phpt b/ext/phar/tests/bug77247.phpt index acd97a837967..0421f6fa044e 100644 --- a/ext/phar/tests/bug77247.phpt +++ b/ext/phar/tests/bug77247.phpt @@ -11,4 +11,4 @@ var_dump(new Phar('a/.b', 0,'test.phar')); } ?> --EXPECT-- -OK \ No newline at end of file +OK diff --git a/ext/phar/tests/bug77396.phpt b/ext/phar/tests/bug77396.phpt index b6c33ab0fcf8..fb0eec18d9cb 100644 --- a/ext/phar/tests/bug77396.phpt +++ b/ext/phar/tests/bug77396.phpt @@ -8,8 +8,8 @@ $path = '../' . str_repeat("x", PHP_MAXPATHLEN) . '.tar'; try { $phar = new PharData($path); } catch (UnexpectedValueException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Phar creation or opening failed +UnexpectedValueException: Phar creation or opening failed diff --git a/ext/phar/tests/bug79503.phpt b/ext/phar/tests/bug79503.phpt index 921ad8d18db9..3295f95f316f 100644 --- a/ext/phar/tests/bug79503.phpt +++ b/ext/phar/tests/bug79503.phpt @@ -7,8 +7,8 @@ phar try { new Phar(__DIR__ . '/bug79503.phar'); } catch (UnexpectedValueException $ex) { - echo $ex->getMessage(); + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECTF-- -phar error: tar-based phar "%s%ebug79503.phar" has invalid metadata in magic file ".phar/.metadata.bin" +UnexpectedValueException: phar error: tar-based phar "%s%ebug79503.phar" has invalid metadata in magic file ".phar/.metadata.bin" diff --git a/ext/phar/tests/bug81211.phpt b/ext/phar/tests/bug81211.phpt index fe7b1326aa68..ffeb18af5504 100644 --- a/ext/phar/tests/bug81211.phpt +++ b/ext/phar/tests/bug81211.phpt @@ -24,12 +24,12 @@ $archive = new PharData(__DIR__ . '/bug81211/archive.tar'); try { $archive->buildFromDirectory(__DIR__ . '/bug81211/foo'); } catch (UnexpectedValueException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } try { $archive->buildFromIterator(new RecursiveDirectoryIterator(__DIR__ . '/bug81211/foo', FilesystemIterator::SKIP_DOTS), __DIR__ . '/bug81211/foo'); } catch (UnexpectedValueException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --CLEAN-- @@ -42,5 +42,5 @@ try { @rmdir(__DIR__ . '/bug81211'); ?> --EXPECTF-- -Iterator RecursiveIteratorIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo" -Iterator RecursiveDirectoryIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo" +UnexpectedValueException: Iterator RecursiveIteratorIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo" +UnexpectedValueException: Iterator RecursiveDirectoryIterator returned a path "%s%ebug81211%efoobar%efile" that is not in the base directory "%s%ebug81211%efoo" diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt index f43a7a496a76..b6fefa03e027 100644 --- a/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt +++ b/ext/phar/tests/buildFromIterator_user_overrides/getMTime_errors.phpt @@ -78,7 +78,7 @@ for ($i = 0; $i < 4; $i++) { ); $phar->stopBuffering(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; if ($previous = $e->getPrevious()) { echo "Previous: ", $previous->getMessage(), "\n"; } @@ -101,17 +101,17 @@ $workdir = __DIR__.'/getMTime_errors'; --- Iteration 0 --- [ Found: %shello.txt ] [MTime] -Entry content%chello.txt cannot be created: timestamp is limited to 32-bit +BadMethodCallException: Entry content%chello.txt cannot be created: timestamp is limited to 32-bit --- Iteration 1 --- [ Found: %shello.txt ] [MTime] -Entry content%chello.txt cannot be created: getMTime() must return an int +BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int --- Iteration 2 --- [ Found: %shello.txt ] [MTime] -Entry content%chello.txt cannot be created: getMTime() must return an int +BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int Previous: Throwing an exception inside getMTime() --- Iteration 3 --- [ Found: %shello.txt ] [MTime] -Entry content%chello.txt cannot be created: getMTime() must return an int +BadMethodCallException: Entry content%chello.txt cannot be created: getMTime() must return an int diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt index 86b66050a973..d14a63bded44 100644 --- a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt +++ b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_exception.phpt @@ -40,7 +40,7 @@ try { $workdir ); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; if ($previous = $e->getPrevious()) { echo "Previous: ", $previous->getMessage(), "\n"; } @@ -59,5 +59,5 @@ $workdir = __DIR__.'/getPathname_exception'; [ Found: %shello.txt ] [getPathname] string(%d) "%shello.txt" -getPathname() must return a string +UnexpectedValueException: getPathname() must return a string Previous: exception in getPathname() diff --git a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt index dfb3fb5f2c55..1c9cd01df2fb 100644 --- a/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt +++ b/ext/phar/tests/buildFromIterator_user_overrides/getPathname_wrong_type.phpt @@ -40,7 +40,7 @@ try { $workdir ); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $phar->stopBuffering(); @@ -55,4 +55,4 @@ $workdir = __DIR__.'/getPathname_wrong_type'; --EXPECTF-- [ Found: %scontent%chello.txt ] [getPathname] -getPathname() must return a string +UnexpectedValueException: getPathname() must return a string diff --git a/ext/phar/tests/create_new_phar_b.phpt b/ext/phar/tests/create_new_phar_b.phpt index 9d9c8640dd5f..d5c54cbbb33f 100644 --- a/ext/phar/tests/create_new_phar_b.phpt +++ b/ext/phar/tests/create_new_phar_b.phpt @@ -18,4 +18,3 @@ Warning: file_put_contents(): Failed to open stream: phar error: write operation Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.php/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d - diff --git a/ext/phar/tests/create_path_error.phpt b/ext/phar/tests/create_path_error.phpt index 13a0fea2bb7f..5e730248d69e 100644 --- a/ext/phar/tests/create_path_error.phpt +++ b/ext/phar/tests/create_path_error.phpt @@ -55,7 +55,7 @@ foreach($checks as $check) } catch (ValueError $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -78,4 +78,4 @@ string(5) "query" 11:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character 12:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character 13:Error: file_put_contents(): Failed to open stream: phar error: invalid path "%s" contains illegal character -Exception: Phar::offsetSet(): Argument #1 ($localName) must not contain any null bytes +ValueError: Phar::offsetSet(): Argument #1 ($localName) must not contain any null bytes diff --git a/ext/phar/tests/delete_in_phar.phpt b/ext/phar/tests/delete_in_phar.phpt index 78149bf87619..215b2b41df38 100644 --- a/ext/phar/tests/delete_in_phar.phpt +++ b/ext/phar/tests/delete_in_phar.phpt @@ -44,4 +44,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.php" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d - diff --git a/ext/phar/tests/delete_in_phar_b.phpt b/ext/phar/tests/delete_in_phar_b.phpt index 1cc372d53c3a..cd73d73ebaff 100644 --- a/ext/phar/tests/delete_in_phar_b.phpt +++ b/ext/phar/tests/delete_in_phar_b.phpt @@ -41,4 +41,3 @@ Warning: unlink(): phar error: write operations disabled by the php.ini setting This is a This is b This is b/c - diff --git a/ext/phar/tests/delete_in_phar_confirm.phpt b/ext/phar/tests/delete_in_phar_confirm.phpt index 215f20ddf9cf..5839382a2b9c 100644 --- a/ext/phar/tests/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/delete_in_phar_confirm.phpt @@ -48,4 +48,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.php" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.php/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d - diff --git a/ext/phar/tests/fgc_edgecases.phpt b/ext/phar/tests/fgc_edgecases.phpt index 1daa3a13e59b..33c9ca90c391 100644 --- a/ext/phar/tests/fgc_edgecases.phpt +++ b/ext/phar/tests/fgc_edgecases.phpt @@ -15,7 +15,7 @@ $pname = 'phar://' . $fname; try { file_get_contents(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } chdir(__DIR__); file_put_contents($fname, "blah\n"); @@ -50,7 +50,7 @@ include $pname . '/foo/hi'; --EXPECTF-- -file_get_contents(): Argument #1 ($filename) must be of type string, array given +TypeError: file_get_contents(): Argument #1 ($filename) must be of type string, array given blah getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } chdir(__DIR__); file_put_contents($fname, "blah\n"); @@ -37,7 +37,7 @@ include $pname . '/foo/hi'; --EXPECTF-- -fopen(): Argument #1 ($filename) must be of type string, array given +TypeError: fopen(): Argument #1 ($filename) must be of type string, array given blah test diff --git a/ext/phar/tests/gh13833.phpt b/ext/phar/tests/gh13833.phpt index 8430bd5e605b..a8aa51f9b570 100644 --- a/ext/phar/tests/gh13833.phpt +++ b/ext/phar/tests/gh13833.phpt @@ -30,7 +30,7 @@ copy($fname, $fname_new); try { new Phar($fname_new); } catch (UnexpectedValueException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXTENSIONS-- @@ -44,4 +44,4 @@ unlink(__DIR__ . '/gh13833.phar.copy.phar'); Yuancheng Jiang Felix De Vliegher --EXPECTF-- -internal corruption of phar "%sgh13833.phar.copy.phar" (trying to read past buffer end) +UnexpectedValueException: internal corruption of phar "%sgh13833.phar.copy.phar" (trying to read past buffer end) diff --git a/ext/phar/tests/gh14603.phpt b/ext/phar/tests/gh14603.phpt index 95b9fa30fd55..409e94bff6df 100644 Binary files a/ext/phar/tests/gh14603.phpt and b/ext/phar/tests/gh14603.phpt differ diff --git a/ext/phar/tests/gh17518.phpt b/ext/phar/tests/gh17518.phpt index 6a45e390edd0..1761ce4e8c9c 100644 --- a/ext/phar/tests/gh17518.phpt +++ b/ext/phar/tests/gh17518.phpt @@ -12,7 +12,7 @@ $phar['a'] = 'b'; try { $phar->extractTo(__DIR__ . '/gh17518', ''); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/gh19752.phpt b/ext/phar/tests/gh19752.phpt index 94ee8691305e..4c19c7712fbd 100644 --- a/ext/phar/tests/gh19752.phpt +++ b/ext/phar/tests/gh19752.phpt @@ -8,8 +8,8 @@ $phar = new PharData(__DIR__.'/gh19752.1'); try { $phar->decompress("*"); } catch (BadMethodCallException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -data phar converted from "%sgh19752.1" has invalid extension * +BadMethodCallException: data phar converted from "%sgh19752.1" has invalid extension * diff --git a/ext/phar/tests/gh20302.phpt b/ext/phar/tests/gh20302.phpt index 0cbd253d54fc..69277327b448 100644 --- a/ext/phar/tests/gh20302.phpt +++ b/ext/phar/tests/gh20302.phpt @@ -23,7 +23,7 @@ include __DIR__.'/files/phar_test.inc'; try { new Phar($fname); } catch (UnexpectedValueException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -33,4 +33,4 @@ try { @rmdir(__DIR__.'/gh20302'); ?> --EXPECTF-- -Cannot open archive "%sgh20302.phar", alias is already in use by existing archive +UnexpectedValueException: Cannot open archive "%sgh20302.phar", alias is already in use by existing archive diff --git a/ext/phar/tests/gh20882.phpt b/ext/phar/tests/gh20882.phpt index 8928178a22a9..3e437fdfe02b 100644 --- a/ext/phar/tests/gh20882.phpt +++ b/ext/phar/tests/gh20882.phpt @@ -15,8 +15,8 @@ try { null ); } catch (BadMethodCallException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Iterator RecursiveIteratorIterator returns an SplFileInfo object, so base directory must be specified +BadMethodCallException: Iterator RecursiveIteratorIterator returns an SplFileInfo object, so base directory must be specified diff --git a/ext/phar/tests/gh21798-offsetget-temp-entry.phpt b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt index b5b11ad43634..e4b16cfb1140 100644 --- a/ext/phar/tests/gh21798-offsetget-temp-entry.phpt +++ b/ext/phar/tests/gh21798-offsetget-temp-entry.phpt @@ -16,24 +16,24 @@ $phar = new Phar($fname); try { $phar->offsetGet('.phar/stub.php'); } catch (BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->offsetGet('.phar/alias.txt'); } catch (BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->offsetGet('.phar/internal'); } catch (BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "no crash\n"; ?> --CLEAN-- --EXPECT-- -Entry .phar/stub.php does not exist -Entry .phar/alias.txt does not exist -Entry .phar/internal does not exist +BadMethodCallException: Entry .phar/stub.php does not exist +BadMethodCallException: Entry .phar/alias.txt does not exist +BadMethodCallException: Entry .phar/internal does not exist no crash diff --git a/ext/phar/tests/invalid_alias.phpt b/ext/phar/tests/invalid_alias.phpt index 231dd9fdb315..1f85b5cfdcb3 100644 --- a/ext/phar/tests/invalid_alias.phpt +++ b/ext/phar/tests/invalid_alias.phpt @@ -12,28 +12,28 @@ $p = new Phar($fname); try { $p->setAlias('hi/'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p->setAlias('hi\\l'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p->setAlias('hil;'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p->setAlias(':hil'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Invalid alias "hi/" specified for phar "%sinvalid_alias.phar" -Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar" -Invalid alias "hil;" specified for phar "%sinvalid_alias.phar" -Invalid alias ":hil" specified for phar "%sinvalid_alias.phar" +UnexpectedValueException: Invalid alias "hi/" specified for phar "%sinvalid_alias.phar" +UnexpectedValueException: Invalid alias "hi\l" specified for phar "%sinvalid_alias.phar" +UnexpectedValueException: Invalid alias "hil;" specified for phar "%sinvalid_alias.phar" +UnexpectedValueException: Invalid alias ":hil" specified for phar "%sinvalid_alias.phar" diff --git a/ext/phar/tests/invalid_setstubalias.phpt b/ext/phar/tests/invalid_setstubalias.phpt index bcbcb2666928..642cdf8b3670 100644 --- a/ext/phar/tests/invalid_setstubalias.phpt +++ b/ext/phar/tests/invalid_setstubalias.phpt @@ -13,28 +13,28 @@ $p = new Phar($fname); try { $p['.phar/stub.php'] = 'hi'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p['.phar/alias.txt'] = 'hi'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $p = new Phar($fname2); try { $p['.phar/stub.php'] = 'hi'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p['.phar/alias.txt'] = 'hi'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.tar", use setStub -Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias -Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub -Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias +BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.tar", use setStub +BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.tar", use setAlias +BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sinvalid_setstubalias.phar.zip", use setStub +BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sinvalid_setstubalias.phar.zip", use setAlias diff --git a/ext/phar/tests/invalid_string_phar_mungserver.phpt b/ext/phar/tests/invalid_string_phar_mungserver.phpt index 8128987dacbc..86116c90974d 100644 --- a/ext/phar/tests/invalid_string_phar_mungserver.phpt +++ b/ext/phar/tests/invalid_string_phar_mungserver.phpt @@ -9,9 +9,9 @@ $str = 'invalid'; try { Phar::mungServer([&$str]); } catch (PharException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME +PharException: Invalid value passed to Phar::mungServer(), expecting an array of any of these strings: PHP_SELF, REQUEST_URI, SCRIPT_FILENAME, SCRIPT_NAME diff --git a/ext/phar/tests/mkdir.phpt b/ext/phar/tests/mkdir.phpt index 9955574caacd..86835b866b71 100644 --- a/ext/phar/tests/mkdir.phpt +++ b/ext/phar/tests/mkdir.phpt @@ -22,12 +22,12 @@ $a->addEmptyDir('bb'); try { $a->addEmptyDir('.phar'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->addEmptyDir('/.phar'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $a->addEmptyDir('/.pharx'); var_dump(is_dir($pname . '/.pharx')); @@ -49,6 +49,6 @@ Warning: rmdir(): phar error: cannot remove directory "phar://", no phar archive Warning: rmdir(): phar error: cannot remove directory "" in phar "foo.phar", directory does not exist in %smkdir.php on line %d Warning: rmdir(): phar error: cannot remove directory "a" in phar "%smkdir.phar.php", phar error: path "a" exists and is not a directory in %smkdir.php on line %d -Cannot create a directory in magic ".phar" directory -Cannot create a directory in magic ".phar" directory +BadMethodCallException: Cannot create a directory in magic ".phar" directory +BadMethodCallException: Cannot create a directory in magic ".phar" directory bool(true) diff --git a/ext/phar/tests/mounteddir.phpt b/ext/phar/tests/mounteddir.phpt index e9f9bbec4689..923e3efebb98 100644 --- a/ext/phar/tests/mounteddir.phpt +++ b/ext/phar/tests/mounteddir.phpt @@ -62,22 +62,22 @@ foreach ($out as $b) { try { Phar::mount($pname . '/testit', 'another\\..\\mistake'); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::mount($pname . '/notfound', __DIR__ . '/this/does/not/exist'); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::mount($pname . '/testit', __DIR__); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::mount($pname . '/testit/extfile.php', __DIR__); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -109,7 +109,7 @@ extfile2.php phar://%stempmanifest1.phar.php/testit%cdirectory phar://%stempmanifest1.phar.php/testit%cextfile.php phar://%stempmanifest1.phar.php/testit%cextfile2.php -Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed -Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed -Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed -Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed +PharException: Mounting of /testit to another\..\mistake within phar %stempmanifest1.phar.php failed +PharException: Mounting of /notfound to %stests/this/does/not/exist within phar %stempmanifest1.phar.php failed +PharException: Mounting of /testit to %stests within phar %stests/tempmanifest1.phar.php failed +PharException: Mounting of /testit/extfile.php to %stests within phar %stests/tempmanifest1.phar.php failed diff --git a/ext/phar/tests/open_for_write_newfile_b.phpt b/ext/phar/tests/open_for_write_newfile_b.phpt index 76248ceeb6f4..844eb939f941 100644 --- a/ext/phar/tests/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/open_for_write_newfile_b.phpt @@ -32,4 +32,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.php" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d - diff --git a/ext/phar/tests/open_for_write_newfile_c.phpt b/ext/phar/tests/open_for_write_newfile_c.phpt index 9a940823dd36..a118bf29a6ce 100644 --- a/ext/phar/tests/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/open_for_write_newfile_c.phpt @@ -32,4 +32,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.php" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.php/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d - diff --git a/ext/phar/tests/opendir_edgecases.phpt b/ext/phar/tests/opendir_edgecases.phpt index 4d35f0655c92..b316537868d4 100644 --- a/ext/phar/tests/opendir_edgecases.phpt +++ b/ext/phar/tests/opendir_edgecases.phpt @@ -15,7 +15,7 @@ $pname = 'phar://' . $fname; try { opendir(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } mkdir(__DIR__ . '/opendir_edgecases'); @@ -55,7 +55,7 @@ include $pname . '/foo'; buildFromDirectory(1); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -%s(24) "UnexpectedValueException" -Cannot write to archive - write operations restricted by INI setting +UnexpectedValueException: Cannot write to archive - write operations restricted by INI setting diff --git a/ext/phar/tests/phar_buildfromdirectory2.phpt b/ext/phar/tests/phar_buildfromdirectory2.phpt index b5f14671dbfc..a13d99ebdfeb 100644 --- a/ext/phar/tests/phar_buildfromdirectory2.phpt +++ b/ext/phar/tests/phar_buildfromdirectory2.phpt @@ -15,10 +15,8 @@ try { $phar = new Phar(__DIR__ . '/buildfromdirectory2.phar'); $phar->buildFromDirectory(1); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -%s(24) "UnexpectedValueException" -RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory +UnexpectedValueException: RecursiveDirectoryIterator::__construct(): Failed to open directory: No such file or directory diff --git a/ext/phar/tests/phar_buildfromdirectory4.phpt b/ext/phar/tests/phar_buildfromdirectory4.phpt index 79bb51caa00c..d7c077e9c280 100644 --- a/ext/phar/tests/phar_buildfromdirectory4.phpt +++ b/ext/phar/tests/phar_buildfromdirectory4.phpt @@ -20,8 +20,7 @@ try { asort($a); var_dump($a); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_exists(__DIR__ . '/buildfromdirectory4.phar')); diff --git a/ext/phar/tests/phar_buildfromdirectory5.phpt b/ext/phar/tests/phar_buildfromdirectory5.phpt index 2d468fe3535b..e4a5b524531d 100644 --- a/ext/phar/tests/phar_buildfromdirectory5.phpt +++ b/ext/phar/tests/phar_buildfromdirectory5.phpt @@ -19,8 +19,7 @@ try { asort($a); var_dump($a); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_exists(__DIR__ . '/buildfromdirectory5.phar')); diff --git a/ext/phar/tests/phar_buildfromdirectory6.phpt b/ext/phar/tests/phar_buildfromdirectory6.phpt index a652a89921db..c5dd0a58fe2b 100644 --- a/ext/phar/tests/phar_buildfromdirectory6.phpt +++ b/ext/phar/tests/phar_buildfromdirectory6.phpt @@ -17,8 +17,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromdirectory6.phar'); var_dump($phar->buildFromDirectory(__DIR__ . '/testdir6', '/\.php$/')); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_exists(__DIR__ . '/buildfromdirectory6.phar')); diff --git a/ext/phar/tests/phar_buildfromiterator1.phpt b/ext/phar/tests/phar_buildfromiterator1.phpt index 23daf212054e..812191fea91b 100644 --- a/ext/phar/tests/phar_buildfromiterator1.phpt +++ b/ext/phar/tests/phar_buildfromiterator1.phpt @@ -13,10 +13,8 @@ try { $phar->buildFromIterator(new ArrayIterator([])); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -%s(24) "UnexpectedValueException" -Cannot write out phar archive, phar is read-only +UnexpectedValueException: Cannot write out phar archive, phar is read-only diff --git a/ext/phar/tests/phar_buildfromiterator10.phpt b/ext/phar/tests/phar_buildfromiterator10.phpt index 495f177fabb2..b4bf10490405 100644 --- a/ext/phar/tests/phar_buildfromiterator10.phpt +++ b/ext/phar/tests/phar_buildfromiterator10.phpt @@ -18,8 +18,7 @@ try { asort($a); var_dump($a); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/phar_buildfromiterator4.phpt b/ext/phar/tests/phar_buildfromiterator4.phpt index e7bccc27c956..30c73cd670c6 100644 --- a/ext/phar/tests/phar_buildfromiterator4.phpt +++ b/ext/phar/tests/phar_buildfromiterator4.phpt @@ -47,8 +47,7 @@ try { '.phar/oops' => basename(__FILE__, 'php') . 'phpt', )))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/phar_buildfromiterator5.phpt b/ext/phar/tests/phar_buildfromiterator5.phpt index 2ddf1c282ece..f1545789763b 100644 --- a/ext/phar/tests/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/phar_buildfromiterator5.phpt @@ -40,13 +40,11 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator5.phar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass)))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- rewind valid current -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) +UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) diff --git a/ext/phar/tests/phar_buildfromiterator6.phpt b/ext/phar/tests/phar_buildfromiterator6.phpt index 4e4f09f74aa7..2ff938c8c68c 100644 --- a/ext/phar/tests/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/phar_buildfromiterator6.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator6.phar'); var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid key (must return a string) +UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string) diff --git a/ext/phar/tests/phar_buildfromiterator7.phpt b/ext/phar/tests/phar_buildfromiterator7.phpt index 646bcdac2a5c..662cbdfe09ad 100644 --- a/ext/phar/tests/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/phar_buildfromiterator7.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator7.phar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" +UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" diff --git a/ext/phar/tests/phar_buildfromiterator8.phpt b/ext/phar/tests/phar_buildfromiterator8.phpt index 6dbe9dcd3f92..9a4c069a4cef 100644 --- a/ext/phar/tests/phar_buildfromiterator8.phpt +++ b/ext/phar/tests/phar_buildfromiterator8.phpt @@ -13,8 +13,7 @@ try { asort($a); var_dump($a); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/phar_buildfromiterator9.phpt b/ext/phar/tests/phar_buildfromiterator9.phpt index a2cb24d8cc7f..45a217a92ba6 100644 --- a/ext/phar/tests/phar_buildfromiterator9.phpt +++ b/ext/phar/tests/phar_buildfromiterator9.phpt @@ -41,8 +41,7 @@ try { var_dump($phar->buildFromIterator(new myIterator(array('a' => $a = fopen(basename(__FILE__, 'php') . 'phpt', 'r'))))); fclose($a); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/phar_bz2.phpt b/ext/phar/tests/phar_bz2.phpt index bb0a98101fac..4c52231b7a89 100644 --- a/ext/phar/tests/phar_bz2.phpt +++ b/ext/phar/tests/phar_bz2.phpt @@ -41,7 +41,7 @@ var_dump($b->isCompressed() == Phar::BZ2); try { $b->isFileFormat(25); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -54,4 +54,4 @@ string(9) "it worked" string(%d) "phar://%sphar_bz2.phar/tar_004.php" bool(true) bool(true) -Unknown file format specified +PharException: Unknown file format specified diff --git a/ext/phar/tests/phar_construct_invalidurl.phpt b/ext/phar/tests/phar_construct_invalidurl.phpt index af281a56fe8f..f47156c63329 100644 --- a/ext/phar/tests/phar_construct_invalidurl.phpt +++ b/ext/phar/tests/phar_construct_invalidurl.phpt @@ -9,20 +9,20 @@ phar try { $a = new Phar('http://should.fail.com'); } catch (UnexpectedValueException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = new Phar('http://'); } catch (UnexpectedValueException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = new Phar('http:/'); } catch (UnexpectedValueException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files -Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files -Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist +UnexpectedValueException: Cannot create a phar archive from a URL like "http://should.fail.com". Phar objects can only be created from local files +UnexpectedValueException: Cannot create a phar archive from a URL like "http://". Phar objects can only be created from local files +UnexpectedValueException: Cannot create phar 'http:/', file extension (or combination) not recognised or the directory does not exist diff --git a/ext/phar/tests/phar_convert_again.phpt b/ext/phar/tests/phar_convert_again.phpt index 008d28ad80f6..831e1075d225 100644 --- a/ext/phar/tests/phar_convert_again.phpt +++ b/ext/phar/tests/phar_convert_again.phpt @@ -33,7 +33,7 @@ echo $tbz->getPath() . "\n"; try { $phar = $tbz->convertToExecutable(Phar::PHAR, Phar::NONE); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } copy($tbz->getPath(), $fname2); $tbz = new PharData($fname2); @@ -50,17 +50,17 @@ echo $data->getPath() . "\n"; try { $data->setStub('hi'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $data->setDefaultStub(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $data->setAlias('hi'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $tar = $phar->convertToExecutable(Phar::TAR); echo $tar->getPath() . "\n"; @@ -71,85 +71,85 @@ echo $tgz->getPath() . "\n"; try { $tgz->convertToExecutable(25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToExecutable(Phar::ZIP, Phar::GZ); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToExecutable(Phar::ZIP, Phar::BZ2); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->convertToData(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::PHAR); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::ZIP, Phar::GZ); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::ZIP, Phar::BZ2); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToExecutable(Phar::TAR, 25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::TAR, 25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } // extra code coverage try { $data->setStub('hi'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $data->setAlias('hi'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $data->setDefaultStub(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::TAR, Phar::GZ, '.phar.tgz.oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->convertToExecutable(Phar::TAR, Phar::GZ, '.tgz.oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $tgz->convertToData(Phar::TAR, Phar::GZ, '.phar/.tgz.oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -171,30 +171,30 @@ __HALT_COMPILER(); %sphar_convert_again.zip %sphar_convert_again.tar.gz %sphar_convert_again.tar.bz2 -Unable to add newly converted phar "%sphar_convert_again.phar" to the list of phars, a phar with that name already exists +BadMethodCallException: Unable to add newly converted phar "%sphar_convert_again.phar" to the list of phars, a phar with that name already exists %sphar_convert_again2.phar %sphar_convert_again2.phar.zip hi %sphar_convert_again2.zip -A Phar stub cannot be set in a plain zip archive -A Phar stub cannot be set in a plain zip archive -A Phar alias cannot be set in a plain zip archive +UnexpectedValueException: A Phar stub cannot be set in a plain zip archive +UnexpectedValueException: A Phar stub cannot be set in a plain zip archive +UnexpectedValueException: A Phar alias cannot be set in a plain zip archive %sphar_convert_again2.phar.tar %sphar_convert_again2.tar %sphar_convert_again2.phar.tar.gz -Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP -Cannot compress entire archive with gzip, zip archives do not support whole-archive compression -Cannot compress entire archive with bz2, zip archives do not support whole-archive compression -Cannot write out data phar archive, use Phar::TAR or Phar::ZIP -Cannot write out data phar archive, use Phar::TAR or Phar::ZIP -Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP -Cannot compress entire archive with gzip, zip archives do not support whole-archive compression -Cannot compress entire archive with bz2, zip archives do not support whole-archive compression -Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 -Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 -A Phar stub cannot be set in a plain tar archive -A Phar alias cannot be set in a plain tar archive -A Phar stub cannot be set in a plain tar archive -data phar "%sphar_convert_again2.phar.tgz.oops" has invalid extension phar.tgz.oops -phar "%sphar_convert_again2.tgz.oops" has invalid extension tgz.oops -data phar "%sphar_convert_again2.phar/.tgz.oops" has invalid extension phar/.tgz.oops +BadMethodCallException: Unknown file format specified, please pass one of Phar::PHAR, Phar::TAR or Phar::ZIP +BadMethodCallException: Cannot compress entire archive with gzip, zip archives do not support whole-archive compression +BadMethodCallException: Cannot compress entire archive with bz2, zip archives do not support whole-archive compression +UnexpectedValueException: Cannot write out data phar archive, use Phar::TAR or Phar::ZIP +UnexpectedValueException: Cannot write out data phar archive, use Phar::TAR or Phar::ZIP +BadMethodCallException: Unknown file format specified, please pass one of Phar::TAR or Phar::ZIP +BadMethodCallException: Cannot compress entire archive with gzip, zip archives do not support whole-archive compression +BadMethodCallException: Cannot compress entire archive with bz2, zip archives do not support whole-archive compression +BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 +BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 +UnexpectedValueException: A Phar stub cannot be set in a plain tar archive +UnexpectedValueException: A Phar alias cannot be set in a plain tar archive +UnexpectedValueException: A Phar stub cannot be set in a plain tar archive +BadMethodCallException: data phar "%sphar_convert_again2.phar.tgz.oops" has invalid extension phar.tgz.oops +BadMethodCallException: phar "%sphar_convert_again2.tgz.oops" has invalid extension tgz.oops +BadMethodCallException: data phar "%sphar_convert_again2.phar/.tgz.oops" has invalid extension phar/.tgz.oops diff --git a/ext/phar/tests/phar_convert_metadata_leak.phpt b/ext/phar/tests/phar_convert_metadata_leak.phpt index 61a240c8888d..1b2a64c13e0c 100644 --- a/ext/phar/tests/phar_convert_metadata_leak.phpt +++ b/ext/phar/tests/phar_convert_metadata_leak.phpt @@ -15,10 +15,10 @@ $phar['x'] = 'hi'; try { $phar->convertToData(Phar::ZIP, Phar::NONE, 'phar.zip'); } catch (BadMethodCallException $e) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECTF-- -data phar "%s" has invalid extension phar.zip +BadMethodCallException: data phar "%s" has invalid extension phar.zip diff --git a/ext/phar/tests/phar_convert_repeated_b.phpt b/ext/phar/tests/phar_convert_repeated_b.phpt index 8adb581276f7..ae2d52c5fd2c 100644 --- a/ext/phar/tests/phar_convert_repeated_b.phpt +++ b/ext/phar/tests/phar_convert_repeated_b.phpt @@ -50,7 +50,7 @@ try { var_dump(strlen($phar->getStub())); var_dump($phar->getAlias()); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "================ convertToTar(GZ) ====================\n"; @@ -72,7 +72,7 @@ try { var_dump(strlen($phar->getStub())); var_dump($phar->getAlias()); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -102,7 +102,7 @@ bool(true) string(0) "" NULL ================= convertToPhar() ==================== -Cannot write out executable phar archive, phar is read-only +UnexpectedValueException: Cannot write out executable phar archive, phar is read-only ================ convertToTar(GZ) ==================== bool(false) bool(true) @@ -110,4 +110,4 @@ bool(false) string(0) "" NULL ================= convertToPhar() ==================== -Cannot write out executable phar archive, phar is read-only +UnexpectedValueException: Cannot write out executable phar archive, phar is read-only diff --git a/ext/phar/tests/phar_create_in_cwd.phpt b/ext/phar/tests/phar_create_in_cwd.phpt index 7aed3a5d5903..f13418b325ad 100644 --- a/ext/phar/tests/phar_create_in_cwd.phpt +++ b/ext/phar/tests/phar_create_in_cwd.phpt @@ -22,7 +22,7 @@ __HALT_COMPILER(); ?>"); var_dump($p->getStub()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/phar_createdefaultstub.phpt b/ext/phar/tests/phar_createdefaultstub.phpt index 8c2878b71e05..fc17ef72c689 100644 --- a/ext/phar/tests/phar_createdefaultstub.phpt +++ b/ext/phar/tests/phar_createdefaultstub.phpt @@ -16,7 +16,7 @@ echo "========================================================================== echo "============================================================================\n"; var_dump(Phar::createDefaultStub(str_repeat('a', 401))); } catch(Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } echo "============================================================================\n"; echo "============================================================================\n"; @@ -29,7 +29,7 @@ echo "========================================================================== var_dump(strlen(Phar::createDefaultStub('index.php', str_repeat('a', 400)))); var_dump(Phar::createDefaultStub('hio', str_repeat('a', 401))); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -636,7 +636,7 @@ __HALT_COMPILER(); ?>" int(7050) ============================================================================ ============================================================================ -Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed +PharException: Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed ============================================================================ ============================================================================ ============================================================================ @@ -942,4 +942,4 @@ __HALT_COMPILER(); ?>" ============================================================================ ============================================================================ int(7050) -Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed +PharException: Illegal web filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed diff --git a/ext/phar/tests/phar_decompress.phpt b/ext/phar/tests/phar_decompress.phpt index 0983b77fcb5c..a8a558c624e3 100644 --- a/ext/phar/tests/phar_decompress.phpt +++ b/ext/phar/tests/phar_decompress.phpt @@ -37,12 +37,12 @@ ini_set('phar.readonly', 1); try { $gz->decompress(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $zip->decompress(); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -60,5 +60,5 @@ int(4096) %sphar_decompress2.phar %sphar_decompress.phar %sphar_decompress.hooba.phar -Cannot decompress phar archive, phar is read-only -Cannot decompress zip-based archives with whole-archive compression +UnexpectedValueException: Cannot decompress phar archive, phar is read-only +UnexpectedValueException: Cannot decompress zip-based archives with whole-archive compression diff --git a/ext/phar/tests/phar_extract.phpt b/ext/phar/tests/phar_extract.phpt index 7d50a3bed749..691aa831ab83 100644 --- a/ext/phar/tests/phar_extract.phpt +++ b/ext/phar/tests/phar_extract.phpt @@ -47,19 +47,19 @@ var_dump(is_dir(__DIR__ . '/extract1-2/one/level')); try { $a->extractTo(__DIR__ . '/whatever', new stdClass()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->extractTo(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->extractTo(''); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } file_put_contents(__DIR__ . '/oops', 'I is file'); @@ -67,19 +67,19 @@ file_put_contents(__DIR__ . '/oops', 'I is file'); try { $a->extractTo(__DIR__ . '/oops', 'file1.txt'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->extractTo(__DIR__ . '/oops1', array(array(), 'file1.txt')); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a->extractTo(__DIR__ . '/extract', 'file1.txt'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } file_put_contents(__DIR__ . '/extract/file1.txt', 'first'); @@ -91,7 +91,7 @@ var_dump(file_get_contents(__DIR__ . '/extract/file1.txt')); try { $a->extractTo(str_repeat('a', 20000), 'file1.txt'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $a[str_repeat('a', 20000)] = 'long'; @@ -99,7 +99,7 @@ $a[str_repeat('a', 20000)] = 'long'; try { $a->extractTo(__DIR__ . '/extract', str_repeat('a', 20000)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -138,13 +138,13 @@ string(2) "hi" string(3) "hi3" string(3) "hi2" bool(false) -Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given -Phar::extractTo(): Argument #1 ($directory) must be of type string, array given -Invalid argument, extraction path must be non-zero length -Unable to use path "%soops" for extraction, it is a file, must be a directory -Invalid argument, array of filenames to extract contains non-string value -Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "%sextract/file1.txt", path already exists +TypeError: Phar::extractTo(): Argument #2 ($files) must be of type array|string|null, stdClass given +TypeError: Phar::extractTo(): Argument #1 ($directory) must be of type string, array given +InvalidArgumentException: Invalid argument, extraction path must be non-zero length +RuntimeException: Unable to use path "%soops" for extraction, it is a file, must be a directory +InvalidArgumentException: Invalid argument, array of filenames to extract contains non-string value +PharException: Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "file1.txt" to "%sextract/file1.txt", path already exists string(5) "first" string(2) "hi" -Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem -Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "%s...", extracted filename is too long for filesystem +InvalidArgumentException: Cannot extract to "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...", destination directory is too long for filesystem +PharException: Extraction from phar "%stempmanifest1.phar.php" failed: Cannot extract "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." to "%s...", extracted filename is too long for filesystem diff --git a/ext/phar/tests/phar_extract3.phpt b/ext/phar/tests/phar_extract3.phpt index 1bd46781b2a9..381070b2c8b0 100644 --- a/ext/phar/tests/phar_extract3.phpt +++ b/ext/phar/tests/phar_extract3.phpt @@ -16,7 +16,7 @@ $phar = new PharData($fname); try { $phar->extractTo($extract); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $phar = new PharData($fname2); @@ -27,7 +27,7 @@ foreach ($phar as $filename) { try { $phar->extractTo($extract); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -39,6 +39,6 @@ $dir = __DIR__ . '/test-extract3/'; @rmdir($dir); ?> --EXPECTF-- -Invalid argument, %sfiles/bogus.zip cannot be found +InvalidArgumentException: Invalid argument, %sfiles/bogus.zip cannot be found phar://%sfiles/notbogus.zip%cnonsense.txt phar://%sfiles/notbogus.zip%cstuff.txt diff --git a/ext/phar/tests/phar_magic_dir_prefix.phpt b/ext/phar/tests/phar_magic_dir_prefix.phpt index e1f1c517632e..33783a8c6c67 100644 --- a/ext/phar/tests/phar_magic_dir_prefix.phpt +++ b/ext/phar/tests/phar_magic_dir_prefix.phpt @@ -43,13 +43,13 @@ var_dump($subdir); try { $phar->addFromString('.phar/still-magic.txt', 'no'); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->addEmptyDir('/.phar'); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -76,5 +76,5 @@ array(3) { [2]=> string(15) "from-string.txt" } -Cannot create any files in magic ".phar" directory -Cannot create a directory in magic ".phar" directory +BadMethodCallException: Cannot create any files in magic ".phar" directory +BadMethodCallException: Cannot create a directory in magic ".phar" directory diff --git a/ext/phar/tests/phar_metadata_write4.phpt b/ext/phar/tests/phar_metadata_write4.phpt index ad9f4d47d91c..31bed1699f96 100644 --- a/ext/phar/tests/phar_metadata_write4.phpt +++ b/ext/phar/tests/phar_metadata_write4.phpt @@ -55,7 +55,7 @@ var_dump($phar['a']->getMetadata(['allowed_classes' => true])); try { var_dump($phar['a']->setMetadata(new ThrowsOnSerialize())); } catch (RuntimeException $e) { - echo "Caught {$e->getMessage()} at {$e->getFile()}:{$e->getLine()}\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; unset($e); } var_dump($phar['a']->getMetadata([])); @@ -90,7 +90,7 @@ In __wakeup 2 object(EchoesOnWakeup)#2 (0) { } In __destruct 2 -Caught In sleep at %sphar_metadata_write4.php:12 +RuntimeException: In sleep in %sphar_metadata_write4.php on line 12 In __wakeup 3 object(EchoesOnWakeup)#3 (0) { } @@ -98,4 +98,4 @@ In __destruct 3 object(__PHP_Incomplete_Class)#4 (1) { ["__PHP_Incomplete_Class_Name"]=> string(14) "EchoesOnWakeup" -} \ No newline at end of file +} diff --git a/ext/phar/tests/phar_mount.phpt b/ext/phar/tests/phar_mount.phpt index ca3838398481..4dfcb7f139f7 100644 --- a/ext/phar/tests/phar_mount.phpt +++ b/ext/phar/tests/phar_mount.phpt @@ -39,12 +39,12 @@ __HALT_COMPILER();'); try { include $fname2; } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::mount($pname . '/oops', '/home/oops/../../etc/passwd:'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } Phar::mount($pname . '/testit2', $pname . '/testit1'); echo substr($a['testit2']->getContent(),0, 50),"\n"; @@ -55,7 +55,7 @@ echo substr($a['testit2']->getContent(),0, 50),"\n"; --EXPECTF-- Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.php failed Can only mount internal paths within a phar archive, use a relative path instead of "phar://%sphar_mount.phar.php/testit1" -Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.tar failed -Mounting of /oops to /home/oops/../../etc/passwd: within phar %sphar_mount.phar.php failed +PharException: Mounting of testit to %sphar_mount.php within phar %sphar_mount.phar.tar failed +PharException: Mounting of /oops to /home/oops/../../etc/passwd: within phar %sphar_mount.phar.php failed offsetGet('.phar/stub.php'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->offsetGet('.phar/alias.txt'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->offsetSet('.phar/stub.php', ''); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(strlen($phar->getStub())); @@ -40,7 +40,7 @@ var_dump(strlen($phar->getStub())); try { $phar->offsetUnset('.phar/stub.php'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(strlen($phar->getStub())); @@ -48,7 +48,7 @@ var_dump(strlen($phar->getStub())); try { $phar->offsetSet('.phar/alias.txt', 'dolly'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getAlias()); @@ -56,7 +56,7 @@ var_dump($phar->getAlias()); try { $phar->offsetUnset('.phar/alias.txt'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getAlias()); @@ -65,11 +65,11 @@ var_dump($phar->getAlias()); --CLEAN-- --EXPECTF-- -Entry .phar/stub.php does not exist -Entry .phar/alias.txt does not exist -Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub +BadMethodCallException: Entry .phar/stub.php does not exist +BadMethodCallException: Entry .phar/alias.txt does not exist +BadMethodCallException: Cannot set stub ".phar/stub.php" directly in phar "%sphar_offset_check.phar.php", use setStub int(6661) int(6661) -Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias +BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sphar_offset_check.phar.php", use setAlias string(5) "susan" string(5) "susan" diff --git a/ext/phar/tests/phar_offset_get_error.phpt b/ext/phar/tests/phar_offset_get_error.phpt index b97971f8c3e5..aa33ab5bd433 100644 --- a/ext/phar/tests/phar_offset_get_error.phpt +++ b/ext/phar/tests/phar_offset_get_error.phpt @@ -22,7 +22,7 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } include($pname . $iname); @@ -31,18 +31,18 @@ include($pname . $iname); try { $p['.phar/oops'] = 'hi'; } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = $p['.phar/stub.php']; } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECT-- -Entry /error/.. does not exist and cannot be created: phar error: invalid path "/error/.." contains upper directory reference +BadMethodCallException: Entry /error/.. does not exist and cannot be created: phar error: invalid path "/error/.." contains upper directory reference foobar -Cannot set any files or directories in magic ".phar" directory -Entry .phar/stub.php does not exist +BadMethodCallException: Cannot set any files or directories in magic ".phar" directory +BadMethodCallException: Entry .phar/stub.php does not exist diff --git a/ext/phar/tests/phar_oo_001.phpt b/ext/phar/tests/phar_oo_001.phpt index e30d112109f1..7cde23fcf737 100644 --- a/ext/phar/tests/phar_oo_001.phpt +++ b/ext/phar/tests/phar_oo_001.phpt @@ -28,14 +28,14 @@ try } catch (LogicException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar = new Phar('test.phar'); $phar->__construct('oops'); } catch (LogicException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,5 +47,5 @@ __halt_compiler(); --EXPECT-- string(5) "1.0.0" int(5) -string(50) "Cannot call method on an uninitialized Phar object" -string(29) "Cannot call constructor twice" +BadMethodCallException: Cannot call method on an uninitialized Phar object +BadMethodCallException: Cannot call constructor twice diff --git a/ext/phar/tests/phar_oo_006.phpt b/ext/phar/tests/phar_oo_006.phpt index a21f8188415b..627da36d5bc9 100644 --- a/ext/phar/tests/phar_oo_006.phpt +++ b/ext/phar/tests/phar_oo_006.phpt @@ -25,7 +25,7 @@ try } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $phar->setInfoClass('MyFile'); @@ -40,7 +40,7 @@ unlink(__DIR__ . '/files/phar_oo_006.phar.php'); __halt_compiler(); ?> --EXPECTF-- -SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, SplFileInfo given +TypeError: SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, SplFileInfo given MyFile::__construct(phar://%s/a.php) a.php MyFile::__construct(phar://%s/b/c.php) diff --git a/ext/phar/tests/phar_oo_011b.phpt b/ext/phar/tests/phar_oo_011b.phpt index 44677732cfbb..e4841f55fe73 100644 --- a/ext/phar/tests/phar_oo_011b.phpt +++ b/ext/phar/tests/phar_oo_011b.phpt @@ -23,7 +23,7 @@ try } catch (BadMethodCallException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -33,4 +33,4 @@ unlink(__DIR__ . '/files/phar_oo_011b.phar.php'); __halt_compiler(); ?> --EXPECT-- -Exception: Write operations disabled by the php.ini setting phar.readonly +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/phar_oo_012b.phpt b/ext/phar/tests/phar_oo_012b.phpt index 296d2e04f898..5b1daa182ccf 100644 --- a/ext/phar/tests/phar_oo_012b.phpt +++ b/ext/phar/tests/phar_oo_012b.phpt @@ -26,7 +26,7 @@ try } catch (BadMethodCallException $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -36,4 +36,4 @@ unlink(__DIR__ . '/files/phar_oo_012b.phar.php'); __halt_compiler(); ?> --EXPECT-- -Exception: Write operations disabled by the php.ini setting phar.readonly +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/phar_oo_compressallgz.phpt b/ext/phar/tests/phar_oo_compressallgz.phpt index c0b8ea9da2d1..b634eff09697 100644 --- a/ext/phar/tests/phar_oo_compressallgz.phpt +++ b/ext/phar/tests/phar_oo_compressallgz.phpt @@ -42,7 +42,7 @@ var_dump($phar['b']->isCompressed(Phar::BZ2)); try { $phar->compressFiles(25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -65,4 +65,4 @@ bool(false) string(1) "c" bool(true) bool(false) -Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 +BadMethodCallException: Unknown compression specified, please pass one of Phar::GZ or Phar::BZ2 diff --git a/ext/phar/tests/phar_oo_getcontents.phpt b/ext/phar/tests/phar_oo_getcontents.phpt index 7883610ff7fd..2e360f3607c0 100644 --- a/ext/phar/tests/phar_oo_getcontents.phpt +++ b/ext/phar/tests/phar_oo_getcontents.phpt @@ -16,12 +16,12 @@ echo $phar['a/b']->getContent() . "\n"; try { echo $phar['a']->getContent(), "\n"; } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $phar['hi']->getContent(), "\n"; } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -32,5 +32,5 @@ __halt_compiler(); --EXPECTF-- file contents this works -phar error: Cannot retrieve contents, "a" in phar "%sphar_oo_getcontents.phar.php" is a directory -phar error: Cannot retrieve contents, "hi" in phar "%sphar_oo_getcontents.phar.php" is a directory +BadMethodCallException: phar error: Cannot retrieve contents, "a" in phar "%sphar_oo_getcontents.phar.php" is a directory +BadMethodCallException: phar error: Cannot retrieve contents, "hi" in phar "%sphar_oo_getcontents.phar.php" is a directory diff --git a/ext/phar/tests/phar_setalias2.phpt b/ext/phar/tests/phar_setalias2.phpt index 7944af8330bd..d1d5fbd8268a 100644 --- a/ext/phar/tests/phar_setalias2.phpt +++ b/ext/phar/tests/phar_setalias2.phpt @@ -27,12 +27,12 @@ $phar = new Phar(__DIR__ . '/notphar.phar'); try { $phar->setAlias('test'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = new Phar(__DIR__ . '/nope.phar', 0, 'test'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -42,5 +42,5 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.php'); --EXPECTF-- hio test -alias "test" is already used for archive "%sphar_setalias2.phar.php" and cannot be used for other archives -alias "test" is already used for archive "%sphar_setalias2.phar.php" cannot be overloaded with "%snope.phar" +PharException: alias "test" is already used for archive "%sphar_setalias2.phar.php" and cannot be used for other archives +UnexpectedValueException: alias "test" is already used for archive "%sphar_setalias2.phar.php" cannot be overloaded with "%snope.phar" diff --git a/ext/phar/tests/phar_setdefaultstub.phpt b/ext/phar/tests/phar_setdefaultstub.phpt index ea05a03bc1a7..f736de253141 100644 --- a/ext/phar/tests/phar_setdefaultstub.phpt +++ b/ext/phar/tests/phar_setdefaultstub.phpt @@ -44,7 +44,7 @@ try { var_dump(strlen($phar->getStub())); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -957,4 +957,4 @@ __HALT_COMPILER(); ?> ============================================================================ ============================================================================ int(7052) -Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed +UnexpectedValueException: Illegal filename passed in for stub creation, was 401 characters long, and only 400 or less is allowed diff --git a/ext/phar/tests/phar_stub.phpt b/ext/phar/tests/phar_stub.phpt index 0ede5f011e11..98b36ad1e5e2 100644 --- a/ext/phar/tests/phar_stub.phpt +++ b/ext/phar/tests/phar_stub.phpt @@ -61,7 +61,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { $phar->setStub($fp); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } set_error_handler(null); fclose($fp); @@ -106,7 +106,7 @@ __HALT_COMPILER(); Deprecated: Calling Phar::setStub(resource $stub, int $length) is deprecated in %s on line %d booya -Calling Phar::setStub(resource $stub, int $length) is deprecated +Exception: Calling Phar::setStub(resource $stub, int $length) is deprecated Deprecated: Calling Phar::setStub(resource $stub, int $length) is deprecated in %s on line %d diff --git a/ext/phar/tests/phar_stub_error.phpt b/ext/phar/tests/phar_stub_error.phpt index 9515e8675a4b..ed5afc3beda1 100644 --- a/ext/phar/tests/phar_stub_error.phpt +++ b/ext/phar/tests/phar_stub_error.phpt @@ -29,7 +29,7 @@ try } catch(exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); @@ -47,7 +47,7 @@ __HALT_COMPILER(); string(48) "" string(48) "" bool(true) -Exception: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing) +PharException: illegal stub for phar "%sphar_stub_error.phar.php" (__HALT_COMPILER(); is missing) string(48) "" bool(true) string(48) "" diff --git a/ext/phar/tests/phar_unlinkarchive.phpt b/ext/phar/tests/phar_unlinkarchive.phpt index c76669be17bd..729c48c69c3b 100644 --- a/ext/phar/tests/phar_unlinkarchive.phpt +++ b/ext/phar/tests/phar_unlinkarchive.phpt @@ -11,7 +11,7 @@ phar.readonly=0 try { Phar::unlinkArchive(""); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $fname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar'; @@ -20,18 +20,18 @@ $pdname = __DIR__ . '/' . basename(__FILE__, '.php') . '.phar.tar'; try { Phar::unlinkArchive($fname); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } file_put_contents($pdname, 'blahblah'); try { Phar::unlinkArchive($pdname); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { Phar::unlinkArchive(array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $pname = 'phar://' . $fname; @@ -53,7 +53,7 @@ var_dump($phar->getStub()); try { Phar::unlinkArchive($fname); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $phar = $phar->convertToExecutable(Phar::ZIP); var_dump($phar->isFileFormat(Phar::ZIP)); @@ -89,13 +89,13 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); __HALT_COMPILER(); ?> --EXPECTF-- -Unknown phar archive "" -Unknown phar archive "%sphar_unlinkarchive.phar" -Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry) -Phar::unlinkArchive(): Argument #1 ($filename) must be of type string, array given +PharException: Unknown phar archive "" +PharException: Unknown phar archive "%sphar_unlinkarchive.phar" +PharException: Unknown phar archive "%sphar_unlinkarchive.phar.tar": internal corruption of phar "%sphar_unlinkarchive.phar.tar" (truncated entry) +TypeError: Phar::unlinkArchive(): Argument #1 ($filename) must be of type string, array given bool(false) string(48) "" -phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive() +PharException: phar archive "%sphar_unlinkarchive.phar" has open file handles or objects. fclose() all file handles, and unset() all objects prior to calling unlinkArchive() bool(true) string(60) "chmod(066); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } lstat($pname . '/a/b'); // sets BG(CurrentLStatFile) $b->chmod(0666); @@ -25,4 +25,4 @@ $b->chmod(0666); --CLEAN-- --EXPECT-- -Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod +BadMethodCallException: Phar entry "a" is a temporary directory (not an actual entry in the archive), cannot chmod diff --git a/ext/phar/tests/pharfileinfo_compression.phpt b/ext/phar/tests/pharfileinfo_compression.phpt index ec016cc9d2b8..7f15aee233cb 100644 --- a/ext/phar/tests/pharfileinfo_compression.phpt +++ b/ext/phar/tests/pharfileinfo_compression.phpt @@ -20,12 +20,12 @@ $b = $phar['a/b']; try { $b->isCompressed(25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->compress(25); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $tar = $phar->convertToData(Phar::TAR); @@ -33,18 +33,18 @@ $c = $tar['a/b']; try { $c->compress(Phar::GZ); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar['a']->compress(Phar::GZ); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $b->compress(Phar::GZ); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); var_dump($b->compress(Phar::GZ)); @@ -58,13 +58,13 @@ ini_set('phar.readonly', 1); try { $phar['a/b']->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 0); try { $phar['a']->decompress(); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($b->decompress()); var_dump($b->decompress()); @@ -74,17 +74,17 @@ var_dump($b->decompress()); --EXPECT-- -Unknown compression type specified -Unknown compression type specified -Cannot compress with Gzip compression, not possible with tar-based phar archives -Phar entry is a directory, cannot set compression -Phar is readonly, cannot change compression +BadMethodCallException: Unknown compression type specified +BadMethodCallException: Unknown compression type specified +BadMethodCallException: Cannot compress with Gzip compression, not possible with tar-based phar archives +BadMethodCallException: Phar entry is a directory, cannot set compression +BadMethodCallException: Phar is readonly, cannot change compression bool(true) bool(true) bool(true) bool(true) decompress -Phar is readonly, cannot decompress -Phar entry is a directory, cannot set compression +BadMethodCallException: Phar is readonly, cannot decompress +BadMethodCallException: Phar entry is a directory, cannot set compression bool(true) bool(true) diff --git a/ext/phar/tests/pharfileinfo_construct.phpt b/ext/phar/tests/pharfileinfo_construct.phpt index 4839b8ebf8b4..8b8ad6761fa3 100644 --- a/ext/phar/tests/pharfileinfo_construct.phpt +++ b/ext/phar/tests/pharfileinfo_construct.phpt @@ -13,14 +13,14 @@ try { file_put_contents($fname, 'blah'); $a = new PharFileInfo($pname . '/oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; unlink($fname); } try { $a = new PharFileInfo(array()); } catch (TypeError $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $a = new Phar($fname); @@ -30,26 +30,26 @@ $b = $a['a']; try { $a = new PharFileInfo($pname . '/oops/I/do/not/exist'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->__construct('oops'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = new PharFileInfo(__FILE__); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECTF-- -Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry) -PharFileInfo::__construct(): Argument #1 ($filename) must be of type string, array given -Cannot access phar file entry '%s' in archive '%s' -Cannot call constructor twice -'%s' is not a valid phar archive URL (must have at least phar://filename.phar) +RuntimeException: Cannot open phar file 'phar://%spharfileinfo_construct.phar/oops': internal corruption of phar "%spharfileinfo_construct.phar" (truncated entry) +TypeError: PharFileInfo::__construct(): Argument #1 ($filename) must be of type string, array given +RuntimeException: Cannot access phar file entry '%s' in archive '%s' +BadMethodCallException: Cannot call constructor twice +RuntimeException: '%s' is not a valid phar archive URL (must have at least phar://filename.phar) diff --git a/ext/phar/tests/pharfileinfo_getcrc32.phpt b/ext/phar/tests/pharfileinfo_getcrc32.phpt index e9c682317c8b..5ced6b1beedc 100644 --- a/ext/phar/tests/pharfileinfo_getcrc32.phpt +++ b/ext/phar/tests/pharfileinfo_getcrc32.phpt @@ -23,25 +23,25 @@ $b = new PharFileInfo($pname . '/a/subdir'); try { var_dump($b->getCRC32()); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $b = new PharFileInfo($pname . '/a/subdir/here'); try { var_dump($b->getCRC32()); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } $a = file_get_contents($pname . '/a/subdir/here'); try { var_dump($b->getCRC32()); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECTF-- -Phar entry is a directory, does not have a CRC -Phar entry was not CRC checked +BadMethodCallException: Phar entry is a directory, does not have a CRC +BadMethodCallException: Phar entry was not CRC checked int(%s) diff --git a/ext/phar/tests/pharfileinfo_setmetadata.phpt b/ext/phar/tests/pharfileinfo_setmetadata.phpt index 46990f46f142..cb0790ae29f0 100644 --- a/ext/phar/tests/pharfileinfo_setmetadata.phpt +++ b/ext/phar/tests/pharfileinfo_setmetadata.phpt @@ -18,30 +18,30 @@ $b = $phar['a/b']; try { $phar['a']->setMetadata('hi'); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar['a']->delMetadata(); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly', 1); try { $b->setMetadata('hi'); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b->delMetadata(); } catch (Exception $e) { -echo $e->getMessage(), "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- --EXPECT-- -Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata -Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata -Write operations disabled by the php.ini setting phar.readonly -Write operations disabled by the php.ini setting phar.readonly +BadMethodCallException: Phar entry is a temporary directory (not an actual entry in the archive), cannot set metadata +BadMethodCallException: Phar entry is a temporary directory (not an actual entry in the archive), cannot delete metadata +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly +BadMethodCallException: Write operations disabled by the php.ini setting phar.readonly diff --git a/ext/phar/tests/tar/033.phpt b/ext/phar/tests/tar/033.phpt index f13121951fe5..7f55168d0dc4 100644 --- a/ext/phar/tests/tar/033.phpt +++ b/ext/phar/tests/tar/033.phpt @@ -36,7 +36,7 @@ try { $phar['test']->chmod(0666); var_dump($phar['test']->isReadable()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/phar/tests/tar/033a.phpt b/ext/phar/tests/tar/033a.phpt index f0f3faf58e09..ba442bcb31da 100644 --- a/ext/phar/tests/tar/033a.phpt +++ b/ext/phar/tests/tar/033a.phpt @@ -37,7 +37,7 @@ try { $phar['test']->chmod(0666); var_dump($phar['test']->isReadable()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -46,4 +46,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); ?> --EXPECTF-- bool(false) -Cannot modify permissions for file "a.php" in phar "%s033a.phar.tar", write operations are prohibited +PharException: Cannot modify permissions for file "a.php" in phar "%s033a.phar.tar", write operations are prohibited diff --git a/ext/phar/tests/tar/alias_acrobatics.phpt b/ext/phar/tests/tar/alias_acrobatics.phpt index c3d9134a5a48..5e532ad3923f 100644 --- a/ext/phar/tests/tar/alias_acrobatics.phpt +++ b/ext/phar/tests/tar/alias_acrobatics.phpt @@ -17,19 +17,19 @@ $p['unused'] = 'hi'; try { $a = new Phar($fname2, 0, 'foo'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } copy($fname, $fname2); echo "2\n"; try { $a = new Phar($fname2); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = new Phar($fname, 0, 'another'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -38,7 +38,7 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.tar'); ?> --EXPECTF-- -alias "foo" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.2.phar.tar" +UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.2.phar.tar" 2 -phar error: Unable to add tar-based phar "%salias_acrobatics.2.phar.tar", alias is already in use -alias "another" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.phar.tar" +UnexpectedValueException: phar error: Unable to add tar-based phar "%salias_acrobatics.2.phar.tar", alias is already in use +UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar.tar" cannot be overloaded with "%salias_acrobatics.phar.tar" diff --git a/ext/phar/tests/tar/badalias.phpt b/ext/phar/tests/tar/badalias.phpt index a660192e95bf..b876e70314b9 100644 --- a/ext/phar/tests/tar/badalias.phpt +++ b/ext/phar/tests/tar/badalias.phpt @@ -11,13 +11,13 @@ for ($i = 1; $i <= 5; $i++) { try { new Phar($e . "badalias$i.phar.tar"); } catch (Exception $ee) { -echo $ee->getMessage(), "\n"; +echo $ee::class, ': ', $ee->getMessage(), "\n"; } } ?> --EXPECTF-- -phar error: invalid alias "hi/thereaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." in tar-based phar "%sbadalias1.phar.tar" -phar error: invalid alias "hi\there" in tar-based phar "%sbadalias2.phar.tar" -phar error: invalid alias "hi;there" in tar-based phar "%sbadalias3.phar.tar" -phar error: invalid alias "hi:there" in tar-based phar "%sbadalias4.phar.tar" -phar error: tar-based phar "%sbadalias5.phar.tar" has alias that is larger than 511 bytes, cannot process +UnexpectedValueException: phar error: invalid alias "hi/thereaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..." in tar-based phar "%sbadalias1.phar.tar" +UnexpectedValueException: phar error: invalid alias "hi\there" in tar-based phar "%sbadalias2.phar.tar" +UnexpectedValueException: phar error: invalid alias "hi;there" in tar-based phar "%sbadalias3.phar.tar" +UnexpectedValueException: phar error: invalid alias "hi:there" in tar-based phar "%sbadalias4.phar.tar" +UnexpectedValueException: phar error: tar-based phar "%sbadalias5.phar.tar" has alias that is larger than 511 bytes, cannot process diff --git a/ext/phar/tests/tar/badchecksum.phpt b/ext/phar/tests/tar/badchecksum.phpt index be74dd531c2e..ffb4ec4f9cee 100644 --- a/ext/phar/tests/tar/badchecksum.phpt +++ b/ext/phar/tests/tar/badchecksum.phpt @@ -16,7 +16,7 @@ $a->close(); try { $p = new PharData($fname); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,4 +25,4 @@ try { unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?> --EXPECTF-- -phar error: "%sbadchecksum.tar" is a corrupted tar file (checksum mismatch of file "hithere") +UnexpectedValueException: phar error: "%sbadchecksum.tar" is a corrupted tar file (checksum mismatch of file "hithere") diff --git a/ext/phar/tests/tar/bignames.phpt b/ext/phar/tests/tar/bignames.phpt index 0c5d3cbca713..135265d9544c 100644 --- a/ext/phar/tests/tar/bignames.phpt +++ b/ext/phar/tests/tar/bignames.phpt @@ -23,21 +23,21 @@ echo $p2[str_repeat('a', 155) . '/' . str_repeat('b', 100)]->getContent() . "\n" try { $p2[str_repeat('a', 400)] = 'yuck'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p2 = new PharData($fname3); $p2[str_repeat('a', 101)] = 'yuck'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p2 = new PharData($fname4); $p2[str_repeat('b', 160) . '/' . str_repeat('a', 90)] = 'yuck'; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -50,6 +50,6 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.tar'); --EXPECTF-- hi hi2 -tar-based phar "%sbignames.2.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format -tar-based phar "%sbignames.3.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format -tar-based phar "%sbignames.4.tar" cannot be created, filename "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format +PharException: tar-based phar "%sbignames.2.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format +PharException: tar-based phar "%sbignames.3.tar" cannot be created, filename "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format +PharException: tar-based phar "%sbignames.4.tar" cannot be created, filename "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" is too long for tar file format diff --git a/ext/phar/tests/tar/bug71317-duplicate-filename.phpt b/ext/phar/tests/tar/bug71317-duplicate-filename.phpt index 1e45789d6db7..0e7d26dbdb4f 100644 --- a/ext/phar/tests/tar/bug71317-duplicate-filename.phpt +++ b/ext/phar/tests/tar/bug71317-duplicate-filename.phpt @@ -32,7 +32,7 @@ try { throw new Exception(sprintf('Contents of file2.txt ("%s") is invalid, expected "%s"', $fileContent, $expectedContent)); } } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ===DONE=== diff --git a/ext/phar/tests/tar/bug71504.phpt b/ext/phar/tests/tar/bug71504.phpt index bf1627a71210..33332bea4109 100644 --- a/ext/phar/tests/tar/bug71504.phpt +++ b/ext/phar/tests/tar/bug71504.phpt @@ -9,7 +9,7 @@ $fname = str_replace('\\', '/', __DIR__ . '/files/HTML_CSS-1.5.4.tgz'); try { $tar = new PharData($fname); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ===DONE=== diff --git a/ext/phar/tests/tar/create_new_phar_b.phpt b/ext/phar/tests/tar/create_new_phar_b.phpt index 2c09c0470cd6..c67f99d2ea25 100644 --- a/ext/phar/tests/tar/create_new_phar_b.phpt +++ b/ext/phar/tests/tar/create_new_phar_b.phpt @@ -18,4 +18,3 @@ Warning: file_put_contents(): Failed to open stream: phar error: write operation Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.tar/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d - diff --git a/ext/phar/tests/tar/delete_in_phar.phpt b/ext/phar/tests/tar/delete_in_phar.phpt index 79aeeba0d0f3..5f05481850f3 100644 --- a/ext/phar/tests/tar/delete_in_phar.phpt +++ b/ext/phar/tests/tar/delete_in_phar.phpt @@ -45,4 +45,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.tar" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d - diff --git a/ext/phar/tests/tar/delete_in_phar_b.phpt b/ext/phar/tests/tar/delete_in_phar_b.phpt index 812a43755b2e..a1c4f3be9cb6 100644 --- a/ext/phar/tests/tar/delete_in_phar_b.phpt +++ b/ext/phar/tests/tar/delete_in_phar_b.phpt @@ -44,4 +44,3 @@ Warning: unlink(): phar error: write operations disabled by the php.ini setting This is a This is b This is b/c - diff --git a/ext/phar/tests/tar/delete_in_phar_confirm.phpt b/ext/phar/tests/tar/delete_in_phar_confirm.phpt index cdd08441e86c..0a1ca676be1c 100644 --- a/ext/phar/tests/tar/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/tar/delete_in_phar_confirm.phpt @@ -48,4 +48,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.tar" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.tar/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d - diff --git a/ext/phar/tests/tar/exists_as_phar.phpt b/ext/phar/tests/tar/exists_as_phar.phpt index 9007d73e5fa5..c2d6cb8a3d84 100644 --- a/ext/phar/tests/tar/exists_as_phar.phpt +++ b/ext/phar/tests/tar/exists_as_phar.phpt @@ -23,7 +23,7 @@ $phar->setAlias('hio2'); try { $p = new Phar($tname); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -33,4 +33,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> --EXPECTF-- -phar tar error: "%sexists_as_phar.phar.tar" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar +UnexpectedValueException: phar tar error: "%sexists_as_phar.phar.tar" already exists as a regular phar and must be deleted from disk prior to creating as a tar-based phar diff --git a/ext/phar/tests/tar/links.phpt b/ext/phar/tests/tar/links.phpt index cde880a74017..21034f9c6a54 100644 --- a/ext/phar/tests/tar/links.phpt +++ b/ext/phar/tests/tar/links.phpt @@ -11,7 +11,7 @@ copy(__DIR__ . '/files/links.tar', $fname); try { $p = new PharData($fname); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($p['testit/link']->getContent()); var_dump($p['testit/hard']->getContent()); diff --git a/ext/phar/tests/tar/links2.phpt b/ext/phar/tests/tar/links2.phpt index 9d0292e7101d..70b8d935227f 100644 --- a/ext/phar/tests/tar/links2.phpt +++ b/ext/phar/tests/tar/links2.phpt @@ -22,7 +22,7 @@ $a->close(); try { $p = new PharData($fname); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -30,4 +30,4 @@ try { unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.tar'); ?> --EXPECTF-- -phar error: "%slinks2.tar" is a corrupted tar file - hard link to non-existent file "internal/file.txt" +UnexpectedValueException: phar error: "%slinks2.tar" is a corrupted tar file - hard link to non-existent file "internal/file.txt" diff --git a/ext/phar/tests/tar/links3.phpt b/ext/phar/tests/tar/links3.phpt index a887f5046f30..93f9598328aa 100644 --- a/ext/phar/tests/tar/links3.phpt +++ b/ext/phar/tests/tar/links3.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 try { $p = new PharData(__DIR__ . '/files/biglink.tar'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $p['file.txt']->getContent(); echo $p['my/file']->getContent(); diff --git a/ext/phar/tests/tar/links4.phpt b/ext/phar/tests/tar/links4.phpt index aa026e6e1ea0..912356428e31 100644 --- a/ext/phar/tests/tar/links4.phpt +++ b/ext/phar/tests/tar/links4.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 try { $p = new PharData(__DIR__ . '/files/tinylink.tar'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $p['file.txt']->getContent(); echo $p['link.txt']->getContent(); diff --git a/ext/phar/tests/tar/links5.phpt b/ext/phar/tests/tar/links5.phpt index 05ab8ce53f99..00fe44295154 100644 --- a/ext/phar/tests/tar/links5.phpt +++ b/ext/phar/tests/tar/links5.phpt @@ -9,7 +9,7 @@ phar.require_hash=0 try { $p = new PharData(__DIR__ . '/files/subdirlink.tar'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $p['hi/test.txt']->getContent(); echo $p['hi/link.txt']->getContent(); diff --git a/ext/phar/tests/tar/links6.phpt b/ext/phar/tests/tar/links6.phpt index 614c3bd66e5c..adb0c1adaed6 100644 --- a/ext/phar/tests/tar/links6.phpt +++ b/ext/phar/tests/tar/links6.phpt @@ -22,4 +22,3 @@ hi there hi there there - diff --git a/ext/phar/tests/tar/open_for_write_existing_b.phpt b/ext/phar/tests/tar/open_for_write_existing_b.phpt index b8afb8b21c02..53d95b3b4972 100644 --- a/ext/phar/tests/tar/open_for_write_existing_b.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_b.phpt @@ -39,4 +39,3 @@ include $alias . '/b/c.php'; Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_b.php on line %d bool(false) This is b/c - diff --git a/ext/phar/tests/tar/open_for_write_existing_c.phpt b/ext/phar/tests/tar/open_for_write_existing_c.phpt index 0cba841f2d86..677797ed1a16 100644 --- a/ext/phar/tests/tar/open_for_write_existing_c.phpt +++ b/ext/phar/tests/tar/open_for_write_existing_c.phpt @@ -39,4 +39,3 @@ include $alias . '/b/c.php'; Warning: fopen(): Failed to open stream: phar error: write operations disabled by the php.ini setting phar.readonly in %sopen_for_write_existing_c.php on line %d bool(false) This is b/c - diff --git a/ext/phar/tests/tar/open_for_write_newfile_b.phpt b/ext/phar/tests/tar/open_for_write_newfile_b.phpt index 794d02d8acf4..7ca3831b11c9 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_b.phpt @@ -44,4 +44,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.tar" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d - diff --git a/ext/phar/tests/tar/open_for_write_newfile_c.phpt b/ext/phar/tests/tar/open_for_write_newfile_c.phpt index 13c80ec857ae..5f92fa7e9d27 100644 --- a/ext/phar/tests/tar/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/tar/open_for_write_newfile_c.phpt @@ -43,4 +43,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.tar" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.tar/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d - diff --git a/ext/phar/tests/tar/phar_buildfromiterator5.phpt b/ext/phar/tests/tar/phar_buildfromiterator5.phpt index 6a81c1df65d2..89b62ed0c92c 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator5.phpt @@ -40,13 +40,11 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass)))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- rewind valid current -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) +UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) diff --git a/ext/phar/tests/tar/phar_buildfromiterator6.phpt b/ext/phar/tests/tar/phar_buildfromiterator6.phpt index 918203697998..0408c0be6117 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator6.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar'); var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid key (must return a string) +UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string) diff --git a/ext/phar/tests/tar/phar_buildfromiterator7.phpt b/ext/phar/tests/tar/phar_buildfromiterator7.phpt index 297b40b5eedd..8549a182ea18 100644 --- a/ext/phar/tests/tar/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/tar/phar_buildfromiterator7.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.tar'); var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" +UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" diff --git a/ext/phar/tests/tar/phar_copy.phpt b/ext/phar/tests/tar/phar_copy.phpt index 52b42b6c46e2..4fb1686699dc 100644 --- a/ext/phar/tests/tar/phar_copy.phpt +++ b/ext/phar/tests/tar/phar_copy.phpt @@ -33,7 +33,7 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly',1); $p2 = new Phar($fname2); @@ -49,7 +49,7 @@ echo 'c: ' ,file_get_contents($p2['c']->getPathName()); --EXPECTF-- hihibool(true) -file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s +UnexpectedValueException: file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s bool(true) a: hib: hic: hi===DONE=== diff --git a/ext/phar/tests/tar/phar_setalias2.phpt b/ext/phar/tests/tar/phar_setalias2.phpt index 31df9ae59aa1..cc82ec4456fd 100644 --- a/ext/phar/tests/tar/phar_setalias2.phpt +++ b/ext/phar/tests/tar/phar_setalias2.phpt @@ -35,7 +35,7 @@ $phar = new Phar(__DIR__ . '/notphar.phar'); try { $phar->setAlias('test'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -46,4 +46,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.tar'); --EXPECTF-- hio test -alias "test" is already used for archive "%sphar_setalias2.phar.tar" and cannot be used for other archives +PharException: alias "test" is already used for archive "%sphar_setalias2.phar.tar" and cannot be used for other archives diff --git a/ext/phar/tests/tar/phar_setdefaultstub.phpt b/ext/phar/tests/tar/phar_setdefaultstub.phpt index ffb1887c2339..8ce1f12943dd 100644 --- a/ext/phar/tests/tar/phar_setdefaultstub.phpt +++ b/ext/phar/tests/tar/phar_setdefaultstub.phpt @@ -23,7 +23,7 @@ try { $phar->setDefaultStub(); $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -34,13 +34,13 @@ echo "========================================================================== try { $phar->setDefaultStub('my/custom/thingy.php'); } catch(ValueError $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -51,13 +51,13 @@ echo "========================================================================== try { $phar->setDefaultStub('my/custom/thingy.php', 'the/web.php'); } catch(ValueError $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -76,11 +76,11 @@ string(60) "'; try { $phar->setStub($newstub); } catch(exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -44,7 +44,7 @@ __HALT_COMPILER(); string(50) " " bool(true) -Exception: illegal stub for tar-based phar "%sphar_stub_error.phar.tar" +PharException: illegal stub for tar-based phar "%sphar_stub_error.phar.tar" string(50) " " bool(true) diff --git a/ext/phar/tests/tar/require_hash.phpt b/ext/phar/tests/tar/require_hash.phpt index f3463343b480..cd41d84fc6d2 100644 --- a/ext/phar/tests/tar/require_hash.phpt +++ b/ext/phar/tests/tar/require_hash.phpt @@ -24,7 +24,7 @@ try { $phar = new Phar($fname); var_dump($phar->getStub()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.require_hash', 0); try { @@ -34,7 +34,7 @@ try { $phar->setSignatureAlgorithm(Phar::MD5); var_dump($phar->getSignature()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -44,7 +44,7 @@ try { @unlink(__DIR__ . '/require_hash.tar'); ?> --EXPECTF-- -tar-based phar "%srequire_hash.phar.tar" does not have a signature +UnexpectedValueException: tar-based phar "%srequire_hash.phar.tar" does not have a signature bool(false) array(2) { ["hash"]=> diff --git a/ext/phar/tests/tar/tar_001.phpt b/ext/phar/tests/tar/tar_001.phpt index 2ddeae188e41..53f0e3189ee4 100644 --- a/ext/phar/tests/tar/tar_001.phpt +++ b/ext/phar/tests/tar/tar_001.phpt @@ -16,7 +16,7 @@ try { $phar = new Phar(__DIR__ . '/tar_001.phar.tar'); echo "should not execute\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -25,4 +25,4 @@ try { ?> --EXPECTF-- Warning: fopen(): Failed to open stream: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) in %star_001.php on line 9 -phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) +UnexpectedValueException: phar error: "%star_001.phar.tar" is a corrupted tar file (truncated) diff --git a/ext/phar/tests/tar/tar_002.phpt b/ext/phar/tests/tar/tar_002.phpt index 12c7ec3bbccc..260b5fefd634 100644 --- a/ext/phar/tests/tar/tar_002.phpt +++ b/ext/phar/tests/tar/tar_002.phpt @@ -19,7 +19,7 @@ try { $phar = new Phar(__DIR__ . '/tar_002.phar.tar'); echo "should not execute\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -28,4 +28,4 @@ try { ?> --EXPECTF-- Warning: fopen(): Failed to open stream: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) in %star_002.php on line 9 -phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) +UnexpectedValueException: phar error: "%star_002.phar.tar" is a corrupted tar file (truncated) diff --git a/ext/phar/tests/tar/tar_003.phpt b/ext/phar/tests/tar/tar_003.phpt index 388f8362a6a2..a2c081cb010d 100644 --- a/ext/phar/tests/tar/tar_003.phpt +++ b/ext/phar/tests/tar/tar_003.phpt @@ -28,7 +28,7 @@ echo file_get_contents($alias . '/internal/file/here'); try { $tar = opendir($alias . '/'); } catch (Exception $e) { -echo $e->getMessage()."\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } while (false !== ($v = readdir($tar))) { diff --git a/ext/phar/tests/tar/tar_nohash.phpt b/ext/phar/tests/tar/tar_nohash.phpt index eeec4411f456..579be240aabb 100644 --- a/ext/phar/tests/tar/tar_nohash.phpt +++ b/ext/phar/tests/tar/tar_nohash.phpt @@ -12,7 +12,7 @@ try { $phar = new PharData(__DIR__ . '/files/Net_URL-1.0.15.tgz'); var_dump($phar->getStub()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/phar/tests/tar/tar_nostub.phpt b/ext/phar/tests/tar/tar_nostub.phpt index 708354f82dca..c1da9455bb7c 100644 --- a/ext/phar/tests/tar/tar_nostub.phpt +++ b/ext/phar/tests/tar/tar_nostub.phpt @@ -22,7 +22,7 @@ try { $phar = new Phar($fname); var_dump($phar->getStub()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } copy($fname, $fname2); @@ -31,7 +31,7 @@ try { $phar = new PharData($fname2); var_dump($phar->getStub()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -41,6 +41,6 @@ try { @unlink(__DIR__ . '/tar_nostub.tar'); ?> --EXPECTF-- -RecursiveDirectoryIterator::__construct(): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive +UnexpectedValueException: RecursiveDirectoryIterator::__construct(): Failed to open directory: '%star_nostub.phar.tar' is not a phar archive. Use PharData::__construct() for a standard zip or tar archive phar url "phar://%star_nostub.phar.tar/" is unknown string(0) "" diff --git a/ext/phar/tests/tar/tar_openssl_hash.phpt b/ext/phar/tests/tar/tar_openssl_hash.phpt index f361440a1400..eb8c8f214c35 100644 --- a/ext/phar/tests/tar/tar_openssl_hash.phpt +++ b/ext/phar/tests/tar/tar_openssl_hash.phpt @@ -12,7 +12,7 @@ phar.require_hash=1 try { $phar = new PharData(__DIR__ . '/files/P1-1.0.0.tgz'); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/phar/tests/tar/truncated.phpt b/ext/phar/tests/tar/truncated.phpt index 95ed3c1c7524..0284b2947763 100644 --- a/ext/phar/tests/tar/truncated.phpt +++ b/ext/phar/tests/tar/truncated.phpt @@ -7,9 +7,9 @@ phar try { $p = new PharData(__DIR__ . '/files/trunc.tar'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: "%strunc.tar" is a corrupted tar file (truncated) +UnexpectedValueException: phar error: "%strunc.tar" is a corrupted tar file (truncated) diff --git a/ext/phar/tests/test_alias_unset.phpt b/ext/phar/tests/test_alias_unset.phpt index 0b332514a34b..fcbc1a3fb245 100644 --- a/ext/phar/tests/test_alias_unset.phpt +++ b/ext/phar/tests/test_alias_unset.phpt @@ -25,7 +25,7 @@ $a = fopen($pname . '/file1.txt', 'r'); // this works because there are no refer try { $phar2 = new Phar($fname2); // fails because references open to $fname } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($a); $phar2 = new Phar($fname2); // succeeds because all refs are closed @@ -37,7 +37,7 @@ $a = file_get_contents($pname . '/file1.txt'); // this fails because $fname2 ref --EXPECTF-- -Cannot open archive "%stest_alias_unset.2.phar.php", alias is already in use by existing archive +UnexpectedValueException: Cannot open archive "%stest_alias_unset.2.phar.php", alias is already in use by existing archive string(5) "first" Warning: file_get_contents(): Failed to open stream: Cannot open archive "%stest_alias_unset.phar.php", alias is already in use by existing archive in %stest_alias_unset.php on line %d diff --git a/ext/phar/tests/test_unset.phpt b/ext/phar/tests/test_unset.phpt index 8aa422cb072c..ddc50598a8dc 100644 --- a/ext/phar/tests/test_unset.phpt +++ b/ext/phar/tests/test_unset.phpt @@ -22,7 +22,7 @@ $phar['b'] = 'whatever'; // flushed try { $phar->setAlias('first'); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $phar = new Phar($fname); diff --git a/ext/phar/tests/webphar_compilefail.phpt b/ext/phar/tests/webphar_compilefail.phpt index 0f6e38e260f4..71e629b3cfe1 100644 --- a/ext/phar/tests/webphar_compilefail.phpt +++ b/ext/phar/tests/webphar_compilefail.phpt @@ -9,9 +9,9 @@ phar.readonly=1 try { Phar::webPhar('oopsiedaisy.phar', '/index.php'); } catch (Exception $e) { -echo $e->getMessage() . "\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } __HALT_COMPILER(); ?> --EXPECTF-- -internal corruption of phar "%swebphar_compilefail.php" (truncated manifest at manifest length) +PharException: internal corruption of phar "%swebphar_compilefail.php" (truncated manifest at manifest length) diff --git a/ext/phar/tests/zip/033.phpt b/ext/phar/tests/zip/033.phpt index cf5ccd9a5105..582ffbf8267e 100644 --- a/ext/phar/tests/zip/033.phpt +++ b/ext/phar/tests/zip/033.phpt @@ -41,7 +41,7 @@ try { $phar['test']->chmod(0666); var_dump($phar['test']->isReadable()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- diff --git a/ext/phar/tests/zip/033a.phpt b/ext/phar/tests/zip/033a.phpt index b11ea44ed32f..33d9e17acb92 100644 --- a/ext/phar/tests/zip/033a.phpt +++ b/ext/phar/tests/zip/033a.phpt @@ -37,7 +37,7 @@ try { $phar['test']->chmod(0666); var_dump($phar['test']->isExecutable()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -46,4 +46,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); ?> --EXPECTF-- bool(false) -Cannot modify permissions for file "a.php" in phar "%sa.phar.zip", write operations are prohibited +PharException: Cannot modify permissions for file "a.php" in phar "%sa.phar.zip", write operations are prohibited diff --git a/ext/phar/tests/zip/alias_acrobatics.phpt b/ext/phar/tests/zip/alias_acrobatics.phpt index 2ff5fd5dcc7d..a8133ef32e0e 100644 --- a/ext/phar/tests/zip/alias_acrobatics.phpt +++ b/ext/phar/tests/zip/alias_acrobatics.phpt @@ -17,19 +17,19 @@ $p['unused'] = 'hi'; try { $a = new Phar($fname2, 0, 'foo'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } copy($fname, $fname2); echo "2\n"; try { $a = new Phar($fname2); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } try { $b = new Phar($fname, 0, 'another'); } catch (Exception $e) { -echo $e->getMessage(),"\n"; +echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -38,7 +38,7 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.2.phar.zip'); ?> --EXPECTF-- -alias "foo" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.2.phar.zip" +UnexpectedValueException: alias "foo" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.2.phar.zip" 2 -phar error: Unable to add zip-based phar "%salias_acrobatics.2.phar.zip" with implicit alias, alias is already in use -alias "another" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.phar.zip" +UnexpectedValueException: phar error: Unable to add zip-based phar "%salias_acrobatics.2.phar.zip" with implicit alias, alias is already in use +UnexpectedValueException: alias "another" is already used for archive "%salias_acrobatics.phar.zip" cannot be overloaded with "%salias_acrobatics.phar.zip" diff --git a/ext/phar/tests/zip/badalias.phpt b/ext/phar/tests/zip/badalias.phpt index 39a3261c0884..7d31eaf9103b 100644 --- a/ext/phar/tests/zip/badalias.phpt +++ b/ext/phar/tests/zip/badalias.phpt @@ -13,13 +13,13 @@ for ($i = 1; $i <= 5; $i++) { try { new Phar($e . "badalias$i.phar.zip"); } catch (Exception $ee) { -echo $ee->getMessage(), "\n"; +echo $ee::class, ': ', $ee->getMessage(), "\n"; } } ?> --EXPECTF-- -phar error: invalid alias "hi/there" in zip-based phar "%sbadalias1.phar.zip" -phar error: invalid alias "hi\there" in zip-based phar "%sbadalias2.phar.zip" -phar error: invalid alias "hi\there" in zip-based phar "%sbadalias3.phar.zip" -phar error: invalid alias "hi;there" in zip-based phar "%sbadalias4.phar.zip" -phar error: invalid alias "hi:there" in zip-based phar "%sbadalias5.phar.zip" +UnexpectedValueException: phar error: invalid alias "hi/there" in zip-based phar "%sbadalias1.phar.zip" +UnexpectedValueException: phar error: invalid alias "hi\there" in zip-based phar "%sbadalias2.phar.zip" +UnexpectedValueException: phar error: invalid alias "hi\there" in zip-based phar "%sbadalias3.phar.zip" +UnexpectedValueException: phar error: invalid alias "hi;there" in zip-based phar "%sbadalias4.phar.zip" +UnexpectedValueException: phar error: invalid alias "hi:there" in zip-based phar "%sbadalias5.phar.zip" diff --git a/ext/phar/tests/zip/bzip2.phpt b/ext/phar/tests/zip/bzip2.phpt index 51535d981d98..9c1a3a769209 100644 --- a/ext/phar/tests/zip/bzip2.phpt +++ b/ext/phar/tests/zip/bzip2.phpt @@ -15,7 +15,7 @@ try { $a = new Phar(dirname(__FILE__) . '/files/bz2_alias.phar.zip'); var_dump($a->getAlias()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/phar/tests/zip/corrupt_001.phpt b/ext/phar/tests/zip/corrupt_001.phpt index 69edece7163b..63da5e9be3ad 100644 --- a/ext/phar/tests/zip/corrupt_001.phpt +++ b/ext/phar/tests/zip/corrupt_001.phpt @@ -7,14 +7,14 @@ phar try { new PharData(__DIR__ . '/files/count1.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/count2.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip" -phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip" +UnexpectedValueException: phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount1.zip" +UnexpectedValueException: phar error: corrupt zip archive, conflicting file count in end of central directory record in zip-based phar "%scount2.zip" diff --git a/ext/phar/tests/zip/corrupt_002.phpt b/ext/phar/tests/zip/corrupt_002.phpt index 6650196504d3..8f9fd80a628e 100644 --- a/ext/phar/tests/zip/corrupt_002.phpt +++ b/ext/phar/tests/zip/corrupt_002.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/nozipend.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: end of central directory not found in zip-based phar "%snozipend.zip" +UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%snozipend.zip" diff --git a/ext/phar/tests/zip/corrupt_003.phpt b/ext/phar/tests/zip/corrupt_003.phpt index 150289ca8a8f..efb2c2e0344a 100644 --- a/ext/phar/tests/zip/corrupt_003.phpt +++ b/ext/phar/tests/zip/corrupt_003.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/filecomment.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: end of central directory not found in zip-based phar "%sfilecomment.zip" +UnexpectedValueException: phar error: end of central directory not found in zip-based phar "%sfilecomment.zip" diff --git a/ext/phar/tests/zip/corrupt_004.phpt b/ext/phar/tests/zip/corrupt_004.phpt index e005488e3a13..48eb75e4cc9f 100644 --- a/ext/phar/tests/zip/corrupt_004.phpt +++ b/ext/phar/tests/zip/corrupt_004.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/cdir_offset.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: corrupted central directory entry, no magic signature in zip-based phar "%scdir_offset.zip" +UnexpectedValueException: phar error: corrupted central directory entry, no magic signature in zip-based phar "%scdir_offset.zip" diff --git a/ext/phar/tests/zip/corrupt_005.phpt b/ext/phar/tests/zip/corrupt_005.phpt index 027d0f6e94d4..2f4c1246fdad 100644 --- a/ext/phar/tests/zip/corrupt_005.phpt +++ b/ext/phar/tests/zip/corrupt_005.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/encrypted.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: Cannot process encrypted zip files in zip-based phar "%sencrypted.zip" +UnexpectedValueException: phar error: Cannot process encrypted zip files in zip-based phar "%sencrypted.zip" diff --git a/ext/phar/tests/zip/corrupt_006.phpt b/ext/phar/tests/zip/corrupt_006.phpt index 045bd77dcdac..25fed4de2595 100644 --- a/ext/phar/tests/zip/corrupt_006.phpt +++ b/ext/phar/tests/zip/corrupt_006.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/stdin.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip" +UnexpectedValueException: phar error: Cannot process zips created from stdin (zero-length filename) in zip-based phar "%sstdin.zip" diff --git a/ext/phar/tests/zip/corrupt_007.phpt b/ext/phar/tests/zip/corrupt_007.phpt index 03bcae58ce6b..5212ad83f86f 100644 --- a/ext/phar/tests/zip/corrupt_007.phpt +++ b/ext/phar/tests/zip/corrupt_007.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/truncfilename.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: corrupted central directory entry, no magic signature in zip-based phar "%struncfilename.zip" +UnexpectedValueException: phar error: corrupted central directory entry, no magic signature in zip-based phar "%struncfilename.zip" diff --git a/ext/phar/tests/zip/corrupt_008.phpt b/ext/phar/tests/zip/corrupt_008.phpt index db9f51d6ce05..50960a4f32c3 100644 --- a/ext/phar/tests/zip/corrupt_008.phpt +++ b/ext/phar/tests/zip/corrupt_008.phpt @@ -7,92 +7,92 @@ phar try { new PharData(__DIR__ . '/files/compress_unsup1.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup2.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup3.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup4.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup5.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup6.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup7.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup9.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup10.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup14.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup18.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup19.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup97.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsup98.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new PharData(__DIR__ . '/files/compress_unsupunknown.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: unsupported compression method (Shrunk) used in this zip in zip-based phar "%scompress_unsup1.zip" -phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup2.zip" -phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup3.zip" -phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup4.zip" -phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup5.zip" -phar error: unsupported compression method (Implode) used in this zip in zip-based phar "%scompress_unsup6.zip" -phar error: unsupported compression method (Tokenize) used in this zip in zip-based phar "%scompress_unsup7.zip" -phar error: unsupported compression method (Deflate64) used in this zip in zip-based phar "%scompress_unsup9.zip" -phar error: unsupported compression method (PKWare Implode/old IBM TERSE) used in this zip in zip-based phar "%scompress_unsup10.zip" -phar error: unsupported compression method (LZMA) used in this zip in zip-based phar "%scompress_unsup14.zip" -phar error: unsupported compression method (IBM TERSE) used in this zip in zip-based phar "%scompress_unsup18.zip" -phar error: unsupported compression method (IBM LZ77) used in this zip in zip-based phar "%scompress_unsup19.zip" -phar error: unsupported compression method (WavPack) used in this zip in zip-based phar "%scompress_unsup97.zip" -phar error: unsupported compression method (PPMd) used in this zip in zip-based phar "%scompress_unsup98.zip" -phar error: unsupported compression method (unknown) used in this zip in zip-based phar "%scompress_unsupunknown.zip" +UnexpectedValueException: phar error: unsupported compression method (Shrunk) used in this zip in zip-based phar "%scompress_unsup1.zip" +UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup2.zip" +UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup3.zip" +UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup4.zip" +UnexpectedValueException: phar error: unsupported compression method (Reduce) used in this zip in zip-based phar "%scompress_unsup5.zip" +UnexpectedValueException: phar error: unsupported compression method (Implode) used in this zip in zip-based phar "%scompress_unsup6.zip" +UnexpectedValueException: phar error: unsupported compression method (Tokenize) used in this zip in zip-based phar "%scompress_unsup7.zip" +UnexpectedValueException: phar error: unsupported compression method (Deflate64) used in this zip in zip-based phar "%scompress_unsup9.zip" +UnexpectedValueException: phar error: unsupported compression method (PKWare Implode/old IBM TERSE) used in this zip in zip-based phar "%scompress_unsup10.zip" +UnexpectedValueException: phar error: unsupported compression method (LZMA) used in this zip in zip-based phar "%scompress_unsup14.zip" +UnexpectedValueException: phar error: unsupported compression method (IBM TERSE) used in this zip in zip-based phar "%scompress_unsup18.zip" +UnexpectedValueException: phar error: unsupported compression method (IBM LZ77) used in this zip in zip-based phar "%scompress_unsup19.zip" +UnexpectedValueException: phar error: unsupported compression method (WavPack) used in this zip in zip-based phar "%scompress_unsup97.zip" +UnexpectedValueException: phar error: unsupported compression method (PPMd) used in this zip in zip-based phar "%scompress_unsup98.zip" +UnexpectedValueException: phar error: unsupported compression method (unknown) used in this zip in zip-based phar "%scompress_unsupunknown.zip" diff --git a/ext/phar/tests/zip/corrupt_009.phpt b/ext/phar/tests/zip/corrupt_009.phpt index 76059bb60122..fd812d57800c 100644 --- a/ext/phar/tests/zip/corrupt_009.phpt +++ b/ext/phar/tests/zip/corrupt_009.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/extralen_toolong.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: Unable to process extra field header for file in central directory in zip-based phar "%sextralen_toolong.zip" +UnexpectedValueException: phar error: Unable to process extra field header for file in central directory in zip-based phar "%sextralen_toolong.zip" diff --git a/ext/phar/tests/zip/corrupt_010.phpt b/ext/phar/tests/zip/corrupt_010.phpt index 549be171e3c2..3a6d929327cf 100644 --- a/ext/phar/tests/zip/corrupt_010.phpt +++ b/ext/phar/tests/zip/corrupt_010.phpt @@ -7,8 +7,8 @@ phar try { new PharData(__DIR__ . '/files/disknumber.zip'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -phar error: split archives spanning multiple zips cannot be processed in zip-based phar "%sdisknumber.zip" +UnexpectedValueException: phar error: split archives spanning multiple zips cannot be processed in zip-based phar "%sdisknumber.zip" diff --git a/ext/phar/tests/zip/create_new_phar_b.phpt b/ext/phar/tests/zip/create_new_phar_b.phpt index c976a3a2dde0..7744656bb83e 100644 --- a/ext/phar/tests/zip/create_new_phar_b.phpt +++ b/ext/phar/tests/zip/create_new_phar_b.phpt @@ -18,4 +18,3 @@ Warning: file_put_contents(): Failed to open stream: phar error: write operation Warning: include(): Failed to open stream: %s in %screate_new_phar_b.php on line %d Warning: include(): Failed opening 'phar://%screate_new_phar_b.phar.zip/a.php' for inclusion (include_path='%s') in %screate_new_phar_b.php on line %d - diff --git a/ext/phar/tests/zip/delete_in_phar.phpt b/ext/phar/tests/zip/delete_in_phar.phpt index 8ebdd95cd2de..1aaf2ab9641c 100644 --- a/ext/phar/tests/zip/delete_in_phar.phpt +++ b/ext/phar/tests/zip/delete_in_phar.phpt @@ -44,4 +44,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar.phar.zip" in %sdelete_in_phar.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar.php on line %d - diff --git a/ext/phar/tests/zip/delete_in_phar_b.phpt b/ext/phar/tests/zip/delete_in_phar_b.phpt index c9a1c25fe276..338b09ebe1da 100644 --- a/ext/phar/tests/zip/delete_in_phar_b.phpt +++ b/ext/phar/tests/zip/delete_in_phar_b.phpt @@ -43,4 +43,3 @@ Warning: unlink(): phar error: write operations disabled by the php.ini setting This is a This is b This is b/c - diff --git a/ext/phar/tests/zip/delete_in_phar_confirm.phpt b/ext/phar/tests/zip/delete_in_phar_confirm.phpt index 14a2a78b62e0..0fcff2da43fc 100644 --- a/ext/phar/tests/zip/delete_in_phar_confirm.phpt +++ b/ext/phar/tests/zip/delete_in_phar_confirm.phpt @@ -49,4 +49,3 @@ This is b Warning: include(): Failed to open stream: phar error: "b/c.php" is not a file in phar "%sdelete_in_phar_confirm.phar.zip" in %sdelete_in_phar_confirm.php on line %d Warning: include(): Failed opening 'phar://%sdelete_in_phar_confirm.phar.zip/b/c.php' for inclusion (include_path='%s') in %sdelete_in_phar_confirm.php on line %d - diff --git a/ext/phar/tests/zip/exists_as_phar.phpt b/ext/phar/tests/zip/exists_as_phar.phpt index 1dbab22a3d87..31ec74b16919 100644 --- a/ext/phar/tests/zip/exists_as_phar.phpt +++ b/ext/phar/tests/zip/exists_as_phar.phpt @@ -23,7 +23,7 @@ $phar->setAlias('hio2'); try { $p = new Phar($tname); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -33,4 +33,4 @@ unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar.zip'); unlink(__DIR__ . '/' . basename(__FILE__, '.clean.php') . '.phar'); ?> --EXPECTF-- -phar zip error: phar "%sexists_as_phar.phar.zip" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar +UnexpectedValueException: phar zip error: phar "%sexists_as_phar.phar.zip" already exists as a regular phar and must be deleted from disk prior to creating as a zip-based phar diff --git a/ext/phar/tests/zip/getalias.phpt b/ext/phar/tests/zip/getalias.phpt index 8f3edd6ee32d..e462d0c6d8ac 100644 --- a/ext/phar/tests/zip/getalias.phpt +++ b/ext/phar/tests/zip/getalias.phpt @@ -34,7 +34,7 @@ var_dump($phar->getAlias()); try { $phar['.phar/alias.txt'] = 'pinocchio'; } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getAlias()); @@ -53,6 +53,6 @@ string(%d) "%sgetalias.phar.zip" string(%d) "%sgetalias.phar.zip" string(13) "jiminycricket" string(13) "jiminycricket" -Cannot set alias ".phar/alias.txt" directly in phar "%sgetalias.phar.zip", use setAlias +BadMethodCallException: Cannot set alias ".phar/alias.txt" directly in phar "%sgetalias.phar.zip", use setAlias string(13) "jiminycricket" string(9) "pinocchio" diff --git a/ext/phar/tests/zip/odt.phpt b/ext/phar/tests/zip/odt.phpt index 53683c4ae110..483dd706a8ea 100644 --- a/ext/phar/tests/zip/odt.phpt +++ b/ext/phar/tests/zip/odt.phpt @@ -17,7 +17,7 @@ foreach (new RecursiveIteratorIterator($a, RecursiveIteratorIterator::LEAVES_ONL try { $b = new Phar(__DIR__ . '/files/odt.odt'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -29,4 +29,4 @@ phar://%sodt.odt%cmeta.xml phar://%sodt.odt%cmimetype phar://%sodt.odt%csettings.xml phar://%sodt.odt%cstyles.xml -Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist +UnexpectedValueException: Cannot create phar '%sodt.odt', file extension (or combination) not recognised or the directory does not exist diff --git a/ext/phar/tests/zip/open_for_write_newfile_b.phpt b/ext/phar/tests/zip/open_for_write_newfile_b.phpt index 4ca15e58c29d..f80b2f7e4c1e 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_b.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_b.phpt @@ -43,4 +43,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_b.phar.zip" in %sopen_for_write_newfile_b.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_b.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_b.php on line %d - diff --git a/ext/phar/tests/zip/open_for_write_newfile_c.phpt b/ext/phar/tests/zip/open_for_write_newfile_c.phpt index 89a380d345a9..a6ad9b697d38 100644 --- a/ext/phar/tests/zip/open_for_write_newfile_c.phpt +++ b/ext/phar/tests/zip/open_for_write_newfile_c.phpt @@ -43,4 +43,3 @@ This is b/c Warning: include(): Failed to open stream: phar error: "b/new.php" is not a file in phar "%sopen_for_write_newfile_c.phar.zip" in %sopen_for_write_newfile_c.php on line %d Warning: include(): Failed opening 'phar://%sopen_for_write_newfile_c.phar.zip/b/new.php' for inclusion (include_path='%s') in %sopen_for_write_newfile_c.php on line %d - diff --git a/ext/phar/tests/zip/phar_buildfromiterator5.phpt b/ext/phar/tests/zip/phar_buildfromiterator5.phpt index 3c587dfc9c87..4a3797ed46f7 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator5.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator5.phpt @@ -40,13 +40,11 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip'); var_dump($phar->buildFromIterator(new myIterator(array('a' => new stdClass)))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- rewind valid current -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) +UnexpectedValueException: Iterator myIterator returned an invalid value (must return a string, a stream, or an SplFileInfo object) diff --git a/ext/phar/tests/zip/phar_buildfromiterator6.phpt b/ext/phar/tests/zip/phar_buildfromiterator6.phpt index 9d9140bc3433..99387bf7dc77 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator6.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator6.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip'); var_dump($phar->buildFromIterator(new myIterator(array(basename(__FILE__, 'php') . 'phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned an invalid key (must return a string) +UnexpectedValueException: Iterator myIterator returned an invalid key (must return a string) diff --git a/ext/phar/tests/zip/phar_buildfromiterator7.phpt b/ext/phar/tests/zip/phar_buildfromiterator7.phpt index f62be404a1e0..59ee896b003c 100644 --- a/ext/phar/tests/zip/phar_buildfromiterator7.phpt +++ b/ext/phar/tests/zip/phar_buildfromiterator7.phpt @@ -40,8 +40,7 @@ try { $phar = new Phar(__DIR__ . '/buildfromiterator.phar.zip'); var_dump($phar->buildFromIterator(new myIterator(array('a' => basename(__FILE__, 'php') . '/oopsie/there.phpt')))); } catch (Exception $e) { - var_dump(get_class($e)); - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -49,5 +48,4 @@ rewind valid current key -%s(24) "UnexpectedValueException" -Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" +UnexpectedValueException: Iterator myIterator returned a file that could not be opened "phar_buildfromiterator7./oopsie/there.phpt" diff --git a/ext/phar/tests/zip/phar_copy.phpt b/ext/phar/tests/zip/phar_copy.phpt index de9b1c9dd76d..344640d27ff9 100644 --- a/ext/phar/tests/zip/phar_copy.phpt +++ b/ext/phar/tests/zip/phar_copy.phpt @@ -32,7 +32,7 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.readonly',1); $p2 = new Phar($fname2); @@ -48,7 +48,7 @@ echo 'c: ' ,file_get_contents($p2['c']->getPathName()); --EXPECTF-- hihibool(true) -file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s +UnexpectedValueException: file "/error/.." contains invalid characters upper directory reference, cannot be copied from "a" in phar %s bool(true) a: hib: hic: hi===DONE=== diff --git a/ext/phar/tests/zip/phar_setalias2.phpt b/ext/phar/tests/zip/phar_setalias2.phpt index 2d113fbf2c5d..d5bdc37fc883 100644 --- a/ext/phar/tests/zip/phar_setalias2.phpt +++ b/ext/phar/tests/zip/phar_setalias2.phpt @@ -33,7 +33,7 @@ $phar = new Phar(__DIR__ . '/notphar.phar'); try { $phar->setAlias('test'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -44,4 +44,4 @@ __HALT_COMPILER(); --EXPECTF-- hio test -alias "test" is already used for archive "%sphar_setalias2.phar.zip" and cannot be used for other archives +PharException: alias "test" is already used for archive "%sphar_setalias2.phar.zip" and cannot be used for other archives diff --git a/ext/phar/tests/zip/phar_setdefaultstub.phpt b/ext/phar/tests/zip/phar_setdefaultstub.phpt index e979b59b1a4a..6d1cd0b42bb8 100644 --- a/ext/phar/tests/zip/phar_setdefaultstub.phpt +++ b/ext/phar/tests/zip/phar_setdefaultstub.phpt @@ -23,7 +23,7 @@ try { $phar->setDefaultStub(); $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -34,13 +34,13 @@ echo "========================================================================== try { $phar->setDefaultStub('my/custom/thingy.php'); } catch(Error $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -51,13 +51,13 @@ echo "========================================================================== try { $phar->setDefaultStub('my/custom/thingy.php', 'the/web.php'); } catch(ValueError $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $phar->stopBuffering(); } catch(Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); @@ -76,11 +76,11 @@ string(60) "getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($phar->getStub()); var_dump($phar->getStub() == $stub); @@ -44,7 +44,7 @@ __HALT_COMPILER(); string(50) " " bool(true) -Exception: illegal stub for zip-based phar "%sphar_stub_error.phar.zip" +PharException: illegal stub for zip-based phar "%sphar_stub_error.phar.zip" string(50) " " bool(true) diff --git a/ext/phar/tests/zip/require_hash.phpt b/ext/phar/tests/zip/require_hash.phpt index 0d94083683c3..c688de5a9c74 100644 --- a/ext/phar/tests/zip/require_hash.phpt +++ b/ext/phar/tests/zip/require_hash.phpt @@ -25,7 +25,7 @@ try { $phar = new Phar($fname); var_dump($phar->getStub()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ini_set('phar.require_hash', 0); try { @@ -35,7 +35,7 @@ try { $phar->setSignatureAlgorithm(Phar::MD5); var_dump($phar->getSignature()); } catch (Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -46,12 +46,12 @@ try { @unlink(__DIR__ . '/require_hash.zip'); ?> --EXPECTF-- -phar error: signature is missing in zip-based phar "%srequire_hash.phar.zip" -bool(false) -array(2) { - ["hash"]=> - string(32) "%s" - ["hash_type"]=> - string(3) "MD5" -} +UnexpectedValueException: phar error: signature is missing in zip-based phar "%srequire_hash.phar.zip" +bool(false) +array(2) { + ["hash"]=> + string(32) "%s" + ["hash_type"]=> + string(3) "MD5" +} ===DONE=== diff --git a/ext/phar/tests/zip/zip_extra_underflow.phpt b/ext/phar/tests/zip/zip_extra_underflow.phpt index e37a3493b663..77595dc9b2f2 100644 --- a/ext/phar/tests/zip/zip_extra_underflow.phpt +++ b/ext/phar/tests/zip/zip_extra_underflow.phpt @@ -80,7 +80,7 @@ try { echo "Loaded corrupt ZIP\n"; echo $phar[$entry]->getMTime(), "\n"; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -88,4 +88,4 @@ try { @unlink(__DIR__ . '/zip_extra_underflow.zip'); ?> --EXPECTF-- -phar error: Unable to process extra field header for file in central directory in zip-based phar "%szip_extra_underflow.zip" +UnexpectedValueException: phar error: Unable to process extra field header for file in central directory in zip-based phar "%szip_extra_underflow.zip" diff --git a/ext/phar/tests/zip/zlib.phpt b/ext/phar/tests/zip/zlib.phpt index 4f33761b0923..9f444904a3a4 100644 --- a/ext/phar/tests/zip/zlib.phpt +++ b/ext/phar/tests/zip/zlib.phpt @@ -11,7 +11,7 @@ try { $a = new Phar(__DIR__ . '/files/zlib_alias.phar.zip'); var_dump($a->getAlias()); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/posix/tests/posix_access_flags.phpt b/ext/posix/tests/posix_access_flags.phpt index 0989e2a2bc66..ba2104e6dc1f 100644 --- a/ext/posix/tests/posix_access_flags.phpt +++ b/ext/posix/tests/posix_access_flags.phpt @@ -18,19 +18,19 @@ file_put_contents($testfile, "hello"); try { posix_access($testfile, -1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { posix_access($testfile, 01000); // S_ISVTX bit (sticky) } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { posix_access($testfile, 02000); // S_ISGID bit } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (posix_access($testfile, POSIX_R_OK | POSIX_W_OK)) { @@ -47,8 +47,8 @@ if (posix_access($testfile, POSIX_F_OK)) { @unlink(__DIR__ . '/testfile.txt'); ?> --EXPECTF-- -posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK -posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK -posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK +ValueError: posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK +ValueError: posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK +ValueError: posix_access(): Argument #2 ($flags) must be a bitmask of POSIX_F_OK, POSIX_R_OK, POSIX_W_OK, and POSIX_X_OK Read/write access OK File exists OK diff --git a/ext/posix/tests/posix_eaccess.phpt b/ext/posix/tests/posix_eaccess.phpt index 4211e6ef13e7..22c1577e4938 100644 --- a/ext/posix/tests/posix_eaccess.phpt +++ b/ext/posix/tests/posix_eaccess.phpt @@ -12,9 +12,9 @@ if (!function_exists("posix_eaccess")) die("skip only platforms with posix_eacce try { posix_eaccess(str_repeat('bogus path', 1042)); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -posix_eaccess(): Argument #1 ($filename) must not be empty +ValueError: posix_eaccess(): Argument #1 ($filename) must not be empty diff --git a/ext/posix/tests/posix_fpathconf.phpt b/ext/posix/tests/posix_fpathconf.phpt index 91918d5901bb..f0cb749228a3 100644 --- a/ext/posix/tests/posix_fpathconf.phpt +++ b/ext/posix/tests/posix_fpathconf.phpt @@ -14,17 +14,16 @@ var_dump(posix_strerror(posix_errno())); try { posix_fpathconf("string arg", POSIX_PC_PATH_MAX); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $fd = fopen(__DIR__, "r"); var_dump(posix_fpathconf($fd, POSIX_PC_PATH_MAX)); fclose($fd); ?> --EXPECTF-- - Warning: posix_fpathconf(): Argument #1 ($file_descriptor) must be between 0 and %d in %s on line %d bool(false) bool(true) string(%d) "Bad file %r(descriptor|number)%r" -posix_fpathconf(): Argument #1 ($file_descriptor) must be of type int|resource, string given +TypeError: posix_fpathconf(): Argument #1 ($file_descriptor) must be of type int|resource, string given int(%d) diff --git a/ext/posix/tests/posix_getsid_error.phpt b/ext/posix/tests/posix_getsid_error.phpt index 68f168554997..39a1d146e481 100644 --- a/ext/posix/tests/posix_getsid_error.phpt +++ b/ext/posix/tests/posix_getsid_error.phpt @@ -12,8 +12,8 @@ posix try { posix_getsid(-1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -posix_getsid(): Argument #1 ($process_id) must be between 0 and %d +ValueError: posix_getsid(): Argument #1 ($process_id) must be between 0 and %d diff --git a/ext/posix/tests/posix_kill_pidoverflow.phpt b/ext/posix/tests/posix_kill_pidoverflow.phpt index 0e8b8c7b7df1..9d70ef413d91 100644 --- a/ext/posix/tests/posix_kill_pidoverflow.phpt +++ b/ext/posix/tests/posix_kill_pidoverflow.phpt @@ -11,15 +11,15 @@ pcntl try { posix_kill(PHP_INT_MAX, SIGTERM); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_kill(PHP_INT_MIN, SIGTERM); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -posix_kill(): Argument #1 ($process_id) must be between %i and %d -posix_kill(): Argument #1 ($process_id) must be between %i and %d +ValueError: posix_kill(): Argument #1 ($process_id) must be between %i and %d +ValueError: posix_kill(): Argument #1 ($process_id) must be between %i and %d diff --git a/ext/posix/tests/posix_pathconf.phpt b/ext/posix/tests/posix_pathconf.phpt index ba451c62df97..2cb92894bdc0 100644 --- a/ext/posix/tests/posix_pathconf.phpt +++ b/ext/posix/tests/posix_pathconf.phpt @@ -11,14 +11,14 @@ if (!function_exists("posix_pathconf")) die("skip only platforms with posix_path try { posix_pathconf('', POSIX_PC_PATH_MAX); } catch (\ValueError $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(posix_pathconf(str_repeat('non_existent', 4096), POSIX_PC_NAME_MAX)); var_dump(posix_errno() != 0); var_dump(posix_pathconf(sys_get_temp_dir(), POSIX_PC_PATH_MAX)); ?> --EXPECTF-- -posix_pathconf(): Argument #1 ($path) must not be empty +ValueError: posix_pathconf(): Argument #1 ($path) must not be empty bool(false) bool(true) int(%d) diff --git a/ext/posix/tests/posix_setpgid_error.phpt b/ext/posix/tests/posix_setpgid_error.phpt index 0d00dd87c60f..f1d2dc334c52 100644 --- a/ext/posix/tests/posix_setpgid_error.phpt +++ b/ext/posix/tests/posix_setpgid_error.phpt @@ -9,26 +9,26 @@ posix try { posix_setpgid(PHP_INT_MAX, 1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_setpgid(-2, 1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_setpgid(1, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_setpgid(1, -2); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -posix_setpgid(): Argument #1 ($process_id) must be between 0 and %d -posix_setpgid(): Argument #1 ($process_id) must be between 0 and %d -posix_setpgid(): Argument #2 ($process_group_id) must be between 0 and %d -posix_setpgid(): Argument #2 ($process_group_id) must be between 0 and %d +ValueError: posix_setpgid(): Argument #1 ($process_id) must be between 0 and %d +ValueError: posix_setpgid(): Argument #1 ($process_id) must be between 0 and %d +ValueError: posix_setpgid(): Argument #2 ($process_group_id) must be between 0 and %d +ValueError: posix_setpgid(): Argument #2 ($process_group_id) must be between 0 and %d diff --git a/ext/posix/tests/posix_setrlimit.phpt b/ext/posix/tests/posix_setrlimit.phpt index 51638793f9d4..ea81a944e431 100644 --- a/ext/posix/tests/posix_setrlimit.phpt +++ b/ext/posix/tests/posix_setrlimit.phpt @@ -15,22 +15,22 @@ var_dump(posix_setrlimit(POSIX_RLIMIT_NOFILE, 128, 128)); try { posix_setrlimit(POSIX_RLIMIT_NOFILE, 129, 128); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_setrlimit(POSIX_RLIMIT_NOFILE, -2, -1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { posix_setrlimit(POSIX_RLIMIT_NOFILE, -1, -2); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128 -posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1 -posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1 +ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be lower or equal to 128 +ValueError: posix_setrlimit(): Argument #2 ($soft_limit) must be greater or equal to -1 +ValueError: posix_setrlimit(): Argument #3 ($hard_limit) must be greater or equal to -1 diff --git a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt index e35cd637a7fc..c00d02143e93 100644 --- a/ext/posix/tests/posix_ttyname_error_wrongparams.phpt +++ b/ext/posix/tests/posix_ttyname_error_wrongparams.phpt @@ -22,9 +22,9 @@ $process = proc_open('echo "foo";', $descriptors, $pipes); try { var_dump(posix_ttyname($process)); // wrong resource type } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -posix_ttyname(): supplied resource is not a valid stream resource +TypeError: posix_ttyname(): supplied resource is not a valid stream resource diff --git a/ext/random/tests/01_functions/bug46587.phpt b/ext/random/tests/01_functions/bug46587.phpt index d9b3044406ff..d6282da5a80c 100644 --- a/ext/random/tests/01_functions/bug46587.phpt +++ b/ext/random/tests/01_functions/bug46587.phpt @@ -7,12 +7,12 @@ var_dump(mt_rand(3,8)); try { var_dump(mt_rand(8,3)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done.\n"; ?> --EXPECTF-- int(%d) -mt_rand(): Argument #2 ($max) must be greater than or equal to argument #1 ($min) +ValueError: mt_rand(): Argument #2 ($max) must be greater than or equal to argument #1 ($min) Done. diff --git a/ext/random/tests/01_functions/mt_rand_basic.phpt b/ext/random/tests/01_functions/mt_rand_basic.phpt index 87a7d2bd4b53..7c7eba5a64f9 100644 --- a/ext/random/tests/01_functions/mt_rand_basic.phpt +++ b/ext/random/tests/01_functions/mt_rand_basic.phpt @@ -60,4 +60,3 @@ PASSED: range min = 100 max = 1000 PASSED: range min = 10500 max = 1050000 PASSED: range min = 16 max = 65536 PASSED: range min = 256 max = 448 - diff --git a/ext/random/tests/01_functions/random_bytes_error.phpt b/ext/random/tests/01_functions/random_bytes_error.phpt index bc0c1ccc2048..6b175f8f9cb5 100644 --- a/ext/random/tests/01_functions/random_bytes_error.phpt +++ b/ext/random/tests/01_functions/random_bytes_error.phpt @@ -7,16 +7,16 @@ Test error operation of random_bytes() try { $bytes = random_bytes(); } catch (TypeError $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $bytes = random_bytes(0); } catch (Error $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -random_bytes() expects exactly 1 argument, 0 given -random_bytes(): Argument #1 ($length) must be greater than 0 +ArgumentCountError: random_bytes() expects exactly 1 argument, 0 given +ValueError: random_bytes(): Argument #1 ($length) must be greater than 0 diff --git a/ext/random/tests/01_functions/random_int_error.phpt b/ext/random/tests/01_functions/random_int_error.phpt index fe461275c951..79f2d9e7675b 100644 --- a/ext/random/tests/01_functions/random_int_error.phpt +++ b/ext/random/tests/01_functions/random_int_error.phpt @@ -7,23 +7,23 @@ Test error operation of random_int() try { $randomInt = random_int(); } catch (TypeError $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $randomInt = random_int(42); } catch (TypeError $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $randomInt = random_int(42,0); } catch (Error $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -random_int() expects exactly 2 arguments, 0 given -random_int() expects exactly 2 arguments, 1 given -random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max) +ArgumentCountError: random_int() expects exactly 2 arguments, 0 given +ArgumentCountError: random_int() expects exactly 2 arguments, 1 given +ValueError: random_int(): Argument #1 ($min) must be less than or equal to argument #2 ($max) diff --git a/ext/random/tests/02_engine/all_serialize_error.phpt b/ext/random/tests/02_engine/all_serialize_error.phpt index 056941514566..eb3f4a57cf0f 100644 --- a/ext/random/tests/02_engine/all_serialize_error.phpt +++ b/ext/random/tests/02_engine/all_serialize_error.phpt @@ -8,28 +8,28 @@ echo \Random\Engine\Mt19937::class, PHP_EOL; try { var_dump(unserialize('O:21:"Random\Engine\Mt19937":2:{i:0;a:0:{}i:1;a:626:{i:0;s:7:"5aa6b98";i:1;s:8:"8660cc14";i:2;s:8:"c0b631ca";i:3;s:8:"e85464ad";i:4;s:8:"70fa6108";i:5;s:8:"c5ed9c3c";i:6;s:8:"b05b7ff1";i:7;s:8:"faf33a3a";i:8;s:8:"ab7c0e61";i:9;s:8:"2d4c9c37";i:10;s:8:"daffe918";i:11;s:8:"644f25b9";i:12;s:8:"fdb352e5";i:13;s:8:"434dafa9";i:14;s:8:"a3c9826e";i:15;s:8:"923dfd8c";i:16;s:8:"f641a225";i:17;s:8:"d87134b3";i:18;s:8:"c3b7926e";i:19;s:8:"c880b60d";i:20;s:8:"975f362d";i:21;s:8:"48192b77";i:22;s:8:"6f7dd08b";i:23;s:8:"7d4ad4f8";i:24;s:8:"d805b910";i:25;s:8:"8c98b365";i:26;s:8:"89e54af9";i:27;s:8:"e5257a3c";i:28;s:8:"8f596624";i:29;s:8:"3f42f88a";i:30;s:8:"6a7e95cc";i:31;s:8:"e1349e4d";i:32;s:8:"4539bc92";i:33;s:8:"045a3148";i:34;s:8:"c27cf7b9";i:35;s:8:"c64e8009";i:36;s:8:"dc5ed02e";i:37;s:8:"5753c741";i:38;s:8:"50be0a82";i:39;s:8:"822da0ee";i:40;s:8:"42fdb3c6";i:41;s:8:"c668fc80";i:42;s:8:"262376c6";i:43;s:8:"17b998c6";i:44;s:8:"1f3aac02";i:45;s:8:"6f939c7e";i:46;s:8:"21c099f4";i:47;s:8:"0f4b5c76";i:48;s:8:"64799ac0";i:49;s:8:"45d3bb99";i:50;s:8:"8ff3eb79";i:51;s:8:"61996264";i:52;s:8:"2b9ab1f4";i:53;s:8:"a0d0c50f";i:54;s:8:"f08713ce";i:55;s:8:"6b1cf9d8";i:56;s:8:"52d92cc5";i:57;s:8:"34bcec6f";i:58;s:8:"83ffa063";i:59;s:8:"a002321d";i:60;s:8:"386c46d9";i:61;s:8:"45e2c63e";i:62;s:8:"f481bdf4";i:63;s:8:"df58facb";i:64;s:8:"1781e49b";i:65;s:8:"1d968a6b";i:66;s:8:"8aa7fdd2";i:67;s:8:"631ac8cd";i:68;s:8:"8090ff8e";i:69;s:8:"4ddd4a5d";i:70;s:8:"ff6d8193";i:71;s:8:"39e18244";i:72;s:8:"4efe15db";i:73;s:8:"3fe64cd5";i:74;s:8:"e693a97f";i:75;s:8:"807a34e9";i:76;s:8:"6dc16ae7";i:77;s:8:"a1e1ed1d";i:78;s:8:"605bdc86";i:79;s:8:"abb1830e";i:80;s:8:"2baabeda";i:81;s:8:"fc0f66ad";i:82;s:8:"9cf4fb96";i:83;s:8:"b50ff764";i:84;s:8:"67c37a3d";i:85;s:8:"15253035";i:86;s:8:"387fce47";i:87;s:8:"5c3299a5";i:88;s:8:"125602b9";i:89;s:8:"daeb445c";i:90;s:8:"289e5a8d";i:91;s:8:"b47cd48c";i:92;s:8:"8664db23";i:93;s:8:"b9352af8";i:94;s:8:"51684d88";i:95;s:8:"b204cbc9";i:96;s:8:"e1b6becc";i:97;s:8:"dbbe0ee6";i:98;s:8:"89e54027";i:99;s:8:"a6512564";i:100;s:8:"3aab8d17";i:101;s:8:"7cab5272";i:102;s:8:"1804e981";i:103;s:8:"0bfebe2c";i:104;s:8:"7c082a4c";i:105;s:8:"06bc80c3";i:106;s:8:"c63db839";i:107;s:8:"59edb59d";i:108;s:8:"b52d9655";i:109;s:8:"efce041b";i:110;s:8:"57c1f890";i:111;s:8:"15499697";i:112;s:8:"e0ad3e3a";i:113;s:8:"408d4c16";i:114;s:8:"e53cf468";i:115;s:8:"6ea3d84f";i:116;s:8:"0a2bc4f2";i:117;s:8:"27b59259";i:118;s:8:"d223514b";i:119;s:8:"434c4185";i:120;s:8:"999c71df";i:121;s:8:"46134706";i:122;s:8:"f7f048d0";i:123;s:8:"7f5cfe34";i:124;s:8:"9bdc475c";i:125;s:8:"c1cf42ea";i:126;s:8:"65be324b";i:127;s:8:"68c7a1dc";i:128;s:8:"a7c8c5a2";i:129;s:8:"ecc4cd8a";i:130;s:8:"a761615c";i:131;s:8:"718ec534";i:132;s:8:"c8b086fc";i:133;s:8:"ead759f9";i:134;s:8:"eb9df4a0";i:135;s:8:"ec5b25f9";i:136;s:8:"3a6ff94e";i:137;s:8:"4511a3de";i:138;s:8:"9034f1c6";i:139;s:8:"5c1c6d14";i:140;s:8:"a228ed46";i:141;s:8:"ffe19f2f";i:142;s:8:"f21f68cf";i:143;s:8:"6c2235a4";i:144;s:8:"e0aed51a";i:145;s:8:"2ade527b";i:146;s:8:"65f3c758";i:147;s:8:"f6e868b7";i:148;s:8:"49b770a5";i:149;s:8:"48ab9158";i:150;s:8:"ab07a671";i:151;s:8:"4ef74251";i:152;s:8:"f4cad644";i:153;s:8:"1576c59e";i:154;s:8:"3882bbd1";i:155;s:8:"e49f32c0";i:156;s:8:"c67b757c";i:157;s:8:"3528c5d8";i:158;s:8:"371c3e34";i:159;s:8:"7f1d614f";i:160;s:8:"b9e19e66";i:161;s:8:"80a1d97f";i:162;s:8:"7f93c9f3";i:163;s:8:"4e82ea48";i:164;s:8:"9675e170";i:165;s:8:"aa54caef";i:166;s:8:"3bb9838e";i:167;s:8:"9c0d0a2b";i:168;s:8:"2595d91f";i:169;s:8:"84cc7ff2";i:170;s:8:"9457c4ee";i:171;s:8:"405b6bc8";i:172;s:8:"5aa668a4";i:173;s:8:"e94dfca2";i:174;s:8:"89c0d739";i:175;s:8:"459f8eb3";i:176;s:8:"76b95b42";i:177;s:8:"0e5ceafb";i:178;s:8:"55d4eaee";i:179;s:8:"a55a4784";i:180;s:8:"8c23e133";i:181;s:8:"0994f794";i:182;s:8:"a8d4d1b7";i:183;s:8:"0a50b177";i:184;s:8:"65409f44";i:185;s:8:"acf34e81";i:186;s:8:"e32f278e";i:187;s:8:"7aa21660";i:188;s:8:"9da66881";i:189;s:8:"5c4df7c5";i:190;s:8:"b21f8a4e";i:191;s:8:"d2cc6756";i:192;s:8:"8716f97d";i:193;s:8:"aabd84c5";i:194;s:8:"2e0a965a";i:195;s:8:"b4acc29c";i:196;s:8:"ed3be992";i:197;s:8:"867d9400";i:198;s:8:"a696ba3e";i:199;s:8:"8e2af3d9";i:200;s:8:"8fd95ea9";i:201;s:8:"930903d8";i:202;s:8:"4508dbb1";i:203;s:8:"80598d21";i:204;s:8:"df87fb74";i:205;s:8:"9d019d24";i:206;s:8:"05d5ce2e";i:207;s:8:"ed69bcfe";i:208;s:8:"f83a8d70";i:209;s:8:"750b10bd";i:210;s:8:"c0df892c";i:211;s:8:"df41f215";i:212;s:8:"03df46e3";i:213;s:8:"4e6dce66";i:214;s:8:"ea45a428";i:215;s:8:"cbbf3ff6";i:216;s:8:"f931c7b2";i:217;s:8:"80d19eab";i:218;s:8:"0e2c13da";i:219;s:8:"4b99ee8b";i:220;s:8:"2311d69e";i:221;s:8:"ca9050a7";i:222;s:8:"a4d9eec1";i:223;s:8:"ee665c77";i:224;s:8:"0714f961";i:225;s:8:"81f5be46";i:226;s:8:"420ea4bf";i:227;s:8:"281c28f0";i:228;s:8:"9936ab3f";i:229;s:8:"e4ca8936";i:230;s:8:"224d247b";i:231;s:8:"a564dffe";i:232;s:8:"d15045d2";i:233;s:8:"97d01e8f";i:234;s:8:"71793232";i:235;s:8:"43fe461e";i:236;s:8:"3b50916b";i:237;s:8:"ff242439";i:238;s:8:"a748a0a9";i:239;s:8:"ff51a2a6";i:240;s:8:"dec0ad0d";i:241;s:8:"4bcf2a2e";i:242;s:8:"2be6a97f";i:243;s:8:"eb3e636a";i:244;s:8:"81e31d64";i:245;s:8:"6ca4db9d";i:246;s:8:"bc5bd290";i:247;s:8:"ed2d2ba4";i:248;s:8:"00c46d55";i:249;s:8:"27578407";i:250;s:8:"bedbbcd8";i:251;s:8:"18172abc";i:252;s:8:"eaa5b9cf";i:253;s:8:"9e87ab84";i:254;s:8:"a0e2741c";i:255;s:8:"3bb931ae";i:256;s:8:"3a7b75cd";i:257;s:8:"1052cbf5";i:258;s:8:"b7afd060";i:259;s:8:"1d143d51";i:260;s:8:"17fb7422";i:261;s:8:"523fd346";i:262;s:8:"50429afd";i:263;s:8:"308ece7b";i:264;s:8:"285aa5c1";i:265;s:8:"d8afd736";i:266;s:8:"2e30512e";i:267;s:8:"af78ce36";i:268;s:8:"5967e738";i:269;s:8:"e19795de";i:270;s:8:"6d416e39";i:271;s:8:"23570261";i:272;s:8:"23106924";i:273;s:8:"a4b9add9";i:274;s:8:"baa83e79";i:275;s:8:"97ca48d3";i:276;s:8:"f369a004";i:277;s:8:"fa521bf6";i:278;s:8:"312e9e5e";i:279;s:8:"3acdb850";i:280;s:8:"485cbad7";i:281;s:8:"ddc2d365";i:282;s:8:"d8b87c13";i:283;s:8:"51f6aa7a";i:284;s:8:"b1c231ce";i:285;s:8:"926b9e57";i:286;s:8:"32bd5241";i:287;s:8:"b72cf0a0";i:288;s:8:"0cd99f51";i:289;s:8:"80815c0e";i:290;s:8:"a3459115";i:291;s:8:"5bb05439";i:292;s:8:"ee67a282";i:293;s:8:"65e533c5";i:294;s:8:"62e57b7a";i:295;s:8:"0f4a42fe";i:296;s:8:"ff5b8045";i:297;s:8:"cb9d60cf";i:298;s:8:"ffc891cd";i:299;s:8:"514d6027";i:300;s:8:"5b92df3b";i:301;s:8:"1fb47b1a";i:302;s:8:"a2382db8";i:303;s:8:"6f8b23cd";i:304;s:8:"db72737a";i:305;s:8:"d2d5022b";i:306;s:8:"eef762a7";i:307;s:8:"771fc2ed";i:308;s:8:"6581afb1";i:309;s:8:"64d7ffbd";i:310;s:8:"93a15a65";i:311;s:8:"fdc8b81b";i:312;s:8:"6369357b";i:313;s:8:"a8a58d2e";i:314;s:8:"d9ab2ed6";i:315;s:8:"0465340d";i:316;s:8:"eed4e3f1";i:317;s:8:"7e15ef9d";i:318;s:8:"99444e57";i:319;s:8:"959a6881";i:320;s:8:"e7498e10";i:321;s:8:"d7d0699e";i:322;s:8:"12372566";i:323;s:8:"b9f97c89";i:324;s:8:"5e688172";i:325;s:8:"8105e3b8";i:326;s:8:"627e9227";i:327;s:8:"67edb47d";i:328;s:8:"74e69d5f";i:329;s:8:"b8c5df2c";i:330;s:8:"14f06e80";i:331;s:8:"1a0af27f";i:332;s:8:"fa6ad68b";i:333;s:8:"d5938b0d";i:334;s:8:"2df9b8cc";i:335;s:8:"d90bd16c";i:336;s:8:"18779d24";i:337;s:8:"e1b81866";i:338;s:8:"dc51e106";i:339;s:8:"5078c0ce";i:340;s:8:"8fde3be3";i:341;s:8:"85939b08";i:342;s:8:"50f5565d";i:343;s:8:"281ec5f0";i:344;s:8:"ee2c4dfb";i:345;s:8:"89df2863";i:346;s:8:"0444ef85";i:347;s:8:"d52671b6";i:348;s:8:"84695c5d";i:349;s:8:"ceb19fc9";i:350;s:8:"8cd19595";i:351;s:8:"9773504b";i:352;s:8:"72031351";i:353;s:8:"285de56c";i:354;s:8:"08d949a1";i:355;s:8:"d1d24d60";i:356;s:8:"41c57eff";i:357;s:8:"ded22dfc";i:358;s:8:"9f799eb2";i:359;s:8:"ac14c164";i:360;s:8:"23ab3dac";i:361;s:8:"76de10e0";i:362;s:8:"72c2ac0b";i:363;s:8:"cce93127";i:364;s:8:"32bbb7e5";i:365;s:8:"b8af671a";i:366;s:8:"24dfc65a";i:367;s:8:"d7c8431f";i:368;s:8:"5cf3dffd";i:369;s:8:"7a93645c";i:370;s:8:"36bb66f8";i:371;s:8:"dc055709";i:372;s:8:"93c58efc";i:373;s:8:"11b9a1e6";i:374;s:8:"e487f36b";i:375;s:8:"7c3bcb46";i:376;s:8:"e4d724a3";i:377;s:8:"b732d653";i:378;s:8:"afc9c219";i:379;s:8:"ea658830";i:380;s:8:"b9052af6";i:381;s:8:"aa46a473";i:382;s:8:"1b37a35e";i:383;s:8:"0ba14ee9";i:384;s:8:"c7e150ac";i:385;s:8:"055ffa96";i:386;s:8:"e2bf88fb";i:387;s:8:"88f1f936";i:388;s:8:"488c7bdb";i:389;s:8:"a9dacbd1";i:390;s:8:"aaeea26f";i:391;s:8:"237af1cb";i:392;s:8:"e3dbdb50";i:393;s:8:"c8e5949e";i:394;s:8:"e70a989a";i:395;s:8:"fa540d6d";i:396;s:8:"f055b2f2";i:397;s:8:"1fc8acd4";i:398;s:8:"accb1a9b";i:399;s:8:"bedfb89c";i:400;s:8:"3d243ec0";i:401;s:8:"d2f3f2d8";i:402;s:8:"d83e7c53";i:403;s:8:"4f12e12d";i:404;s:8:"f48f33d1";i:405;s:8:"9555d943";i:406;s:8:"db853a55";i:407;s:8:"506a95b4";i:408;s:8:"408155d1";i:409;s:8:"32a384a0";i:410;s:8:"21c34eb4";i:411;s:8:"93e2e1ae";i:412;s:8:"88582a10";i:413;s:8:"1f065648";i:414;s:8:"96c3c81b";i:415;s:8:"412bc358";i:416;s:8:"11a4e990";i:417;s:8:"805ead73";i:418;s:8:"ec8ca56e";i:419;s:8:"a2ed4bdc";i:420;s:8:"ac408a10";i:421;s:8:"4ca98f96";i:422;s:8:"0686b6df";i:423;s:8:"9e9f7ae4";i:424;s:8:"07d5f658";i:425;s:8:"1c121a0c";i:426;s:8:"c11c8e82";i:427;s:8:"13f2c6d7";i:428;s:8:"e9f6ad9c";i:429;s:8:"bc1dc285";i:430;s:8:"e271fe4b";i:431;s:8:"34114ee5";i:432;s:8:"92ad1c39";i:433;s:8:"5ab5504b";i:434;s:8:"4f7118a7";i:435;s:8:"d1ceec2f";i:436;s:8:"adfd7622";i:437;s:8:"f4f4a9c0";i:438;s:8:"2d4f21e3";i:439;s:8:"3b4bed9e";i:440;s:8:"42ac5810";i:441;s:8:"7eae8db5";i:442;s:8:"09dc329e";i:443;s:8:"3c723314";i:444;s:8:"7fb50c08";i:445;s:8:"71fd69dd";i:446;s:8:"013ce542";i:447;s:8:"0add0d73";i:448;s:8:"465d495a";i:449;s:8:"9f8ddb9d";i:450;s:8:"f293e79e";i:451;s:8:"d6f59d72";i:452;s:8:"ac22e38f";i:453;s:8:"e96d5751";i:454;s:8:"fba79717";i:455;s:8:"39fedf2f";i:456;s:8:"3fb25196";i:457;s:8:"fcdaa825";i:458;s:8:"9a960022";i:459;s:8:"5371af3d";i:460;s:8:"df7faf0a";i:461;s:8:"82c22c85";i:462;s:8:"dfbbae9f";i:463;s:8:"403a4b84";i:464;s:8:"bc938282";i:465;s:8:"d2355fbc";i:466;s:8:"8d72b179";i:467;s:8:"dced02b2";i:468;s:8:"227b82e3";i:469;s:8:"24c60db6";i:470;s:8:"45092b73";i:471;s:8:"767c0e1d";i:472;s:8:"7eb5c592";i:473;s:8:"d0b356d9";i:474;s:8:"dc95ee45";i:475;s:8:"39aa5820";i:476;s:8:"9e6e1868";i:477;s:8:"ffe72d78";i:478;s:8:"82ae0503";i:479;s:8:"2ea981ad";i:480;s:8:"6935faba";i:481;s:8:"69c2ba98";i:482;s:8:"69dd219f";i:483;s:8:"860e0d0d";i:484;s:8:"5f451aa3";i:485;s:8:"a9d5f07d";i:486;s:8:"ec623682";i:487;s:8:"04d8adba";i:488;s:8:"717e8c76";i:489;s:8:"f9c1fb75";i:490;s:8:"ab4c9e06";i:491;s:8:"3895ef4d";i:492;s:8:"37c09060";i:493;s:8:"f3b7c652";i:494;s:8:"74dc421e";i:495;s:8:"97d458be";i:496;s:8:"1a1ddea1";i:497;s:8:"001c68ad";i:498;s:8:"680f033f";i:499;s:8:"b2e9bd38";i:500;s:8:"54192958";i:501;s:8:"b6dd0693";i:502;s:8:"9d149906";i:503;s:8:"9ba5479a";i:504;s:8:"18ba25e8";i:505;s:8:"16fa3e51";i:506;s:8:"1e74b698";i:507;s:8:"c5932028";i:508;s:8:"5a6cf6cd";i:509;s:8:"6fa90e13";i:510;s:8:"bcabdecb";i:511;s:8:"ae23af9a";i:512;s:8:"76b297eb";i:513;s:8:"d1332632";i:514;s:8:"693a55c3";i:515;s:8:"7c4beb9b";i:516;s:8:"409a0a15";i:517;s:8:"60f68335";i:518;s:8:"febcb934";i:519;s:8:"f32c6f8c";i:520;s:8:"aacacf0d";i:521;s:8:"d1f56e99";i:522;s:8:"d65bcf00";i:523;s:8:"361c9633";i:524;s:8:"cd34d7f4";i:525;s:8:"37d38e62";i:526;s:8:"942dee9d";i:527;s:8:"f41c9445";i:528;s:8:"7e9a8b5d";i:529;s:8:"4b941ed7";i:530;s:8:"c6256dce";i:531;s:8:"6c285146";i:532;s:8:"5920147e";i:533;s:8:"934d59ed";i:534;s:8:"5f400a1d";i:535;s:8:"1a5de58c";i:536;s:8:"11e601de";i:537;s:8:"cf4da287";i:538;s:8:"756a54e4";i:539;s:8:"9f2b1015";i:540;s:8:"3a3df642";i:541;s:8:"5d024d64";i:542;s:8:"2d617393";i:543;s:8:"e1b4ec53";i:544;s:8:"24996b5e";i:545;s:8:"7a271bf1";i:546;s:8:"68d7da60";i:547;s:8:"06d3bc73";i:548;s:8:"f21095f7";i:549;s:8:"93e6bfd9";i:550;s:8:"e80b015b";i:551;s:8:"4ddd4ede";i:552;s:8:"cec3d813";i:553;s:8:"281f2a65";i:554;s:8:"ffa068fb";i:555;s:8:"60e712e7";i:556;s:8:"4abcecac";i:557;s:8:"eef01060";i:558;s:8:"8e79e897";i:559;s:8:"b0cd39fe";i:560;s:8:"28cc9604";i:561;s:8:"c7bd58e0";i:562;s:8:"c73b1765";i:563;s:8:"e87d5e07";i:564;s:8:"03b7710d";i:565;s:8:"5f64c5dc";i:566;s:8:"4ae7b6f1";i:567;s:8:"401b9876";i:568;s:8:"9a162522";i:569;s:8:"2a1d6390";i:570;s:8:"c115eeff";i:571;s:8:"e549f7df";i:572;s:8:"a159c579";i:573;s:8:"48a44ff6";i:574;s:8:"e65fd1fc";i:575;s:8:"bb74cd7b";i:576;s:8:"87cc0383";i:577;s:8:"052755ee";i:578;s:8:"eba29b21";i:579;s:8:"88e2efa9";i:580;s:8:"a1a521b9";i:581;s:8:"ffb6f27b";i:582;s:8:"4fea3248";i:583;s:8:"0f46ad03";i:584;s:8:"58902f76";i:585;s:8:"cfb3f87e";i:586;s:8:"efb3d85c";i:587;s:8:"1e0f4648";i:588;s:8:"f95eda47";i:589;s:8:"c5220b0b";i:590;s:8:"e6574ef8";i:591;s:8:"f34b162e";i:592;s:8:"09b08b14";i:593;s:8:"dae53353";i:594;s:8:"ccc600dd";i:595;s:8:"b3ae8f4f";i:596;s:8:"daed379c";i:597;s:8:"113f5973";i:598;s:8:"6a66bb0a";i:599;s:8:"697817f3";i:600;s:8:"00b78167";i:601;s:8:"1e7c2ed9";i:602;s:8:"65f8a3c5";i:603;s:8:"c50f5c14";i:604;s:8:"a1665ca7";i:605;s:8:"d31c5017";i:606;s:8:"2e421193";i:607;s:8:"cb8d29a9";i:608;s:8:"fa9723b5";i:609;s:8:"8a4d18e4";i:610;s:8:"88081a19";i:611;s:8:"242623e4";i:612;s:8:"86202155";i:613;s:8:"ab55982f";i:614;s:8:"f1a3c261";i:615;s:8:"c44eaa91";i:616;s:8:"06c4716f";i:617;s:8:"60a25216";i:618;s:8:"dcce86a3";i:619;s:8:"bfcec0cd";i:620;s:8:"fb4170ed";i:621;s:8:"9bf5e563";i:622;s:8:"04fa51af";i:623;s:8:"dd86eeb1";i:624;i:0;i:625;i:0;}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // invalid hex try { var_dump(unserialize('O:21:"Random\Engine\Mt19937":2:{i:0;a:0:{}i:1;a:626:{i:0;s:8:"5aa6b98g";i:1;s:8:"8660cc14";i:2;s:8:"c0b631ca";i:3;s:8:"e85464ad";i:4;s:8:"70fa6108";i:5;s:8:"c5ed9c3c";i:6;s:8:"b05b7ff1";i:7;s:8:"faf33a3a";i:8;s:8:"ab7c0e61";i:9;s:8:"2d4c9c37";i:10;s:8:"daffe918";i:11;s:8:"644f25b9";i:12;s:8:"fdb352e5";i:13;s:8:"434dafa9";i:14;s:8:"a3c9826e";i:15;s:8:"923dfd8c";i:16;s:8:"f641a225";i:17;s:8:"d87134b3";i:18;s:8:"c3b7926e";i:19;s:8:"c880b60d";i:20;s:8:"975f362d";i:21;s:8:"48192b77";i:22;s:8:"6f7dd08b";i:23;s:8:"7d4ad4f8";i:24;s:8:"d805b910";i:25;s:8:"8c98b365";i:26;s:8:"89e54af9";i:27;s:8:"e5257a3c";i:28;s:8:"8f596624";i:29;s:8:"3f42f88a";i:30;s:8:"6a7e95cc";i:31;s:8:"e1349e4d";i:32;s:8:"4539bc92";i:33;s:8:"045a3148";i:34;s:8:"c27cf7b9";i:35;s:8:"c64e8009";i:36;s:8:"dc5ed02e";i:37;s:8:"5753c741";i:38;s:8:"50be0a82";i:39;s:8:"822da0ee";i:40;s:8:"42fdb3c6";i:41;s:8:"c668fc80";i:42;s:8:"262376c6";i:43;s:8:"17b998c6";i:44;s:8:"1f3aac02";i:45;s:8:"6f939c7e";i:46;s:8:"21c099f4";i:47;s:8:"0f4b5c76";i:48;s:8:"64799ac0";i:49;s:8:"45d3bb99";i:50;s:8:"8ff3eb79";i:51;s:8:"61996264";i:52;s:8:"2b9ab1f4";i:53;s:8:"a0d0c50f";i:54;s:8:"f08713ce";i:55;s:8:"6b1cf9d8";i:56;s:8:"52d92cc5";i:57;s:8:"34bcec6f";i:58;s:8:"83ffa063";i:59;s:8:"a002321d";i:60;s:8:"386c46d9";i:61;s:8:"45e2c63e";i:62;s:8:"f481bdf4";i:63;s:8:"df58facb";i:64;s:8:"1781e49b";i:65;s:8:"1d968a6b";i:66;s:8:"8aa7fdd2";i:67;s:8:"631ac8cd";i:68;s:8:"8090ff8e";i:69;s:8:"4ddd4a5d";i:70;s:8:"ff6d8193";i:71;s:8:"39e18244";i:72;s:8:"4efe15db";i:73;s:8:"3fe64cd5";i:74;s:8:"e693a97f";i:75;s:8:"807a34e9";i:76;s:8:"6dc16ae7";i:77;s:8:"a1e1ed1d";i:78;s:8:"605bdc86";i:79;s:8:"abb1830e";i:80;s:8:"2baabeda";i:81;s:8:"fc0f66ad";i:82;s:8:"9cf4fb96";i:83;s:8:"b50ff764";i:84;s:8:"67c37a3d";i:85;s:8:"15253035";i:86;s:8:"387fce47";i:87;s:8:"5c3299a5";i:88;s:8:"125602b9";i:89;s:8:"daeb445c";i:90;s:8:"289e5a8d";i:91;s:8:"b47cd48c";i:92;s:8:"8664db23";i:93;s:8:"b9352af8";i:94;s:8:"51684d88";i:95;s:8:"b204cbc9";i:96;s:8:"e1b6becc";i:97;s:8:"dbbe0ee6";i:98;s:8:"89e54027";i:99;s:8:"a6512564";i:100;s:8:"3aab8d17";i:101;s:8:"7cab5272";i:102;s:8:"1804e981";i:103;s:8:"0bfebe2c";i:104;s:8:"7c082a4c";i:105;s:8:"06bc80c3";i:106;s:8:"c63db839";i:107;s:8:"59edb59d";i:108;s:8:"b52d9655";i:109;s:8:"efce041b";i:110;s:8:"57c1f890";i:111;s:8:"15499697";i:112;s:8:"e0ad3e3a";i:113;s:8:"408d4c16";i:114;s:8:"e53cf468";i:115;s:8:"6ea3d84f";i:116;s:8:"0a2bc4f2";i:117;s:8:"27b59259";i:118;s:8:"d223514b";i:119;s:8:"434c4185";i:120;s:8:"999c71df";i:121;s:8:"46134706";i:122;s:8:"f7f048d0";i:123;s:8:"7f5cfe34";i:124;s:8:"9bdc475c";i:125;s:8:"c1cf42ea";i:126;s:8:"65be324b";i:127;s:8:"68c7a1dc";i:128;s:8:"a7c8c5a2";i:129;s:8:"ecc4cd8a";i:130;s:8:"a761615c";i:131;s:8:"718ec534";i:132;s:8:"c8b086fc";i:133;s:8:"ead759f9";i:134;s:8:"eb9df4a0";i:135;s:8:"ec5b25f9";i:136;s:8:"3a6ff94e";i:137;s:8:"4511a3de";i:138;s:8:"9034f1c6";i:139;s:8:"5c1c6d14";i:140;s:8:"a228ed46";i:141;s:8:"ffe19f2f";i:142;s:8:"f21f68cf";i:143;s:8:"6c2235a4";i:144;s:8:"e0aed51a";i:145;s:8:"2ade527b";i:146;s:8:"65f3c758";i:147;s:8:"f6e868b7";i:148;s:8:"49b770a5";i:149;s:8:"48ab9158";i:150;s:8:"ab07a671";i:151;s:8:"4ef74251";i:152;s:8:"f4cad644";i:153;s:8:"1576c59e";i:154;s:8:"3882bbd1";i:155;s:8:"e49f32c0";i:156;s:8:"c67b757c";i:157;s:8:"3528c5d8";i:158;s:8:"371c3e34";i:159;s:8:"7f1d614f";i:160;s:8:"b9e19e66";i:161;s:8:"80a1d97f";i:162;s:8:"7f93c9f3";i:163;s:8:"4e82ea48";i:164;s:8:"9675e170";i:165;s:8:"aa54caef";i:166;s:8:"3bb9838e";i:167;s:8:"9c0d0a2b";i:168;s:8:"2595d91f";i:169;s:8:"84cc7ff2";i:170;s:8:"9457c4ee";i:171;s:8:"405b6bc8";i:172;s:8:"5aa668a4";i:173;s:8:"e94dfca2";i:174;s:8:"89c0d739";i:175;s:8:"459f8eb3";i:176;s:8:"76b95b42";i:177;s:8:"0e5ceafb";i:178;s:8:"55d4eaee";i:179;s:8:"a55a4784";i:180;s:8:"8c23e133";i:181;s:8:"0994f794";i:182;s:8:"a8d4d1b7";i:183;s:8:"0a50b177";i:184;s:8:"65409f44";i:185;s:8:"acf34e81";i:186;s:8:"e32f278e";i:187;s:8:"7aa21660";i:188;s:8:"9da66881";i:189;s:8:"5c4df7c5";i:190;s:8:"b21f8a4e";i:191;s:8:"d2cc6756";i:192;s:8:"8716f97d";i:193;s:8:"aabd84c5";i:194;s:8:"2e0a965a";i:195;s:8:"b4acc29c";i:196;s:8:"ed3be992";i:197;s:8:"867d9400";i:198;s:8:"a696ba3e";i:199;s:8:"8e2af3d9";i:200;s:8:"8fd95ea9";i:201;s:8:"930903d8";i:202;s:8:"4508dbb1";i:203;s:8:"80598d21";i:204;s:8:"df87fb74";i:205;s:8:"9d019d24";i:206;s:8:"05d5ce2e";i:207;s:8:"ed69bcfe";i:208;s:8:"f83a8d70";i:209;s:8:"750b10bd";i:210;s:8:"c0df892c";i:211;s:8:"df41f215";i:212;s:8:"03df46e3";i:213;s:8:"4e6dce66";i:214;s:8:"ea45a428";i:215;s:8:"cbbf3ff6";i:216;s:8:"f931c7b2";i:217;s:8:"80d19eab";i:218;s:8:"0e2c13da";i:219;s:8:"4b99ee8b";i:220;s:8:"2311d69e";i:221;s:8:"ca9050a7";i:222;s:8:"a4d9eec1";i:223;s:8:"ee665c77";i:224;s:8:"0714f961";i:225;s:8:"81f5be46";i:226;s:8:"420ea4bf";i:227;s:8:"281c28f0";i:228;s:8:"9936ab3f";i:229;s:8:"e4ca8936";i:230;s:8:"224d247b";i:231;s:8:"a564dffe";i:232;s:8:"d15045d2";i:233;s:8:"97d01e8f";i:234;s:8:"71793232";i:235;s:8:"43fe461e";i:236;s:8:"3b50916b";i:237;s:8:"ff242439";i:238;s:8:"a748a0a9";i:239;s:8:"ff51a2a6";i:240;s:8:"dec0ad0d";i:241;s:8:"4bcf2a2e";i:242;s:8:"2be6a97f";i:243;s:8:"eb3e636a";i:244;s:8:"81e31d64";i:245;s:8:"6ca4db9d";i:246;s:8:"bc5bd290";i:247;s:8:"ed2d2ba4";i:248;s:8:"00c46d55";i:249;s:8:"27578407";i:250;s:8:"bedbbcd8";i:251;s:8:"18172abc";i:252;s:8:"eaa5b9cf";i:253;s:8:"9e87ab84";i:254;s:8:"a0e2741c";i:255;s:8:"3bb931ae";i:256;s:8:"3a7b75cd";i:257;s:8:"1052cbf5";i:258;s:8:"b7afd060";i:259;s:8:"1d143d51";i:260;s:8:"17fb7422";i:261;s:8:"523fd346";i:262;s:8:"50429afd";i:263;s:8:"308ece7b";i:264;s:8:"285aa5c1";i:265;s:8:"d8afd736";i:266;s:8:"2e30512e";i:267;s:8:"af78ce36";i:268;s:8:"5967e738";i:269;s:8:"e19795de";i:270;s:8:"6d416e39";i:271;s:8:"23570261";i:272;s:8:"23106924";i:273;s:8:"a4b9add9";i:274;s:8:"baa83e79";i:275;s:8:"97ca48d3";i:276;s:8:"f369a004";i:277;s:8:"fa521bf6";i:278;s:8:"312e9e5e";i:279;s:8:"3acdb850";i:280;s:8:"485cbad7";i:281;s:8:"ddc2d365";i:282;s:8:"d8b87c13";i:283;s:8:"51f6aa7a";i:284;s:8:"b1c231ce";i:285;s:8:"926b9e57";i:286;s:8:"32bd5241";i:287;s:8:"b72cf0a0";i:288;s:8:"0cd99f51";i:289;s:8:"80815c0e";i:290;s:8:"a3459115";i:291;s:8:"5bb05439";i:292;s:8:"ee67a282";i:293;s:8:"65e533c5";i:294;s:8:"62e57b7a";i:295;s:8:"0f4a42fe";i:296;s:8:"ff5b8045";i:297;s:8:"cb9d60cf";i:298;s:8:"ffc891cd";i:299;s:8:"514d6027";i:300;s:8:"5b92df3b";i:301;s:8:"1fb47b1a";i:302;s:8:"a2382db8";i:303;s:8:"6f8b23cd";i:304;s:8:"db72737a";i:305;s:8:"d2d5022b";i:306;s:8:"eef762a7";i:307;s:8:"771fc2ed";i:308;s:8:"6581afb1";i:309;s:8:"64d7ffbd";i:310;s:8:"93a15a65";i:311;s:8:"fdc8b81b";i:312;s:8:"6369357b";i:313;s:8:"a8a58d2e";i:314;s:8:"d9ab2ed6";i:315;s:8:"0465340d";i:316;s:8:"eed4e3f1";i:317;s:8:"7e15ef9d";i:318;s:8:"99444e57";i:319;s:8:"959a6881";i:320;s:8:"e7498e10";i:321;s:8:"d7d0699e";i:322;s:8:"12372566";i:323;s:8:"b9f97c89";i:324;s:8:"5e688172";i:325;s:8:"8105e3b8";i:326;s:8:"627e9227";i:327;s:8:"67edb47d";i:328;s:8:"74e69d5f";i:329;s:8:"b8c5df2c";i:330;s:8:"14f06e80";i:331;s:8:"1a0af27f";i:332;s:8:"fa6ad68b";i:333;s:8:"d5938b0d";i:334;s:8:"2df9b8cc";i:335;s:8:"d90bd16c";i:336;s:8:"18779d24";i:337;s:8:"e1b81866";i:338;s:8:"dc51e106";i:339;s:8:"5078c0ce";i:340;s:8:"8fde3be3";i:341;s:8:"85939b08";i:342;s:8:"50f5565d";i:343;s:8:"281ec5f0";i:344;s:8:"ee2c4dfb";i:345;s:8:"89df2863";i:346;s:8:"0444ef85";i:347;s:8:"d52671b6";i:348;s:8:"84695c5d";i:349;s:8:"ceb19fc9";i:350;s:8:"8cd19595";i:351;s:8:"9773504b";i:352;s:8:"72031351";i:353;s:8:"285de56c";i:354;s:8:"08d949a1";i:355;s:8:"d1d24d60";i:356;s:8:"41c57eff";i:357;s:8:"ded22dfc";i:358;s:8:"9f799eb2";i:359;s:8:"ac14c164";i:360;s:8:"23ab3dac";i:361;s:8:"76de10e0";i:362;s:8:"72c2ac0b";i:363;s:8:"cce93127";i:364;s:8:"32bbb7e5";i:365;s:8:"b8af671a";i:366;s:8:"24dfc65a";i:367;s:8:"d7c8431f";i:368;s:8:"5cf3dffd";i:369;s:8:"7a93645c";i:370;s:8:"36bb66f8";i:371;s:8:"dc055709";i:372;s:8:"93c58efc";i:373;s:8:"11b9a1e6";i:374;s:8:"e487f36b";i:375;s:8:"7c3bcb46";i:376;s:8:"e4d724a3";i:377;s:8:"b732d653";i:378;s:8:"afc9c219";i:379;s:8:"ea658830";i:380;s:8:"b9052af6";i:381;s:8:"aa46a473";i:382;s:8:"1b37a35e";i:383;s:8:"0ba14ee9";i:384;s:8:"c7e150ac";i:385;s:8:"055ffa96";i:386;s:8:"e2bf88fb";i:387;s:8:"88f1f936";i:388;s:8:"488c7bdb";i:389;s:8:"a9dacbd1";i:390;s:8:"aaeea26f";i:391;s:8:"237af1cb";i:392;s:8:"e3dbdb50";i:393;s:8:"c8e5949e";i:394;s:8:"e70a989a";i:395;s:8:"fa540d6d";i:396;s:8:"f055b2f2";i:397;s:8:"1fc8acd4";i:398;s:8:"accb1a9b";i:399;s:8:"bedfb89c";i:400;s:8:"3d243ec0";i:401;s:8:"d2f3f2d8";i:402;s:8:"d83e7c53";i:403;s:8:"4f12e12d";i:404;s:8:"f48f33d1";i:405;s:8:"9555d943";i:406;s:8:"db853a55";i:407;s:8:"506a95b4";i:408;s:8:"408155d1";i:409;s:8:"32a384a0";i:410;s:8:"21c34eb4";i:411;s:8:"93e2e1ae";i:412;s:8:"88582a10";i:413;s:8:"1f065648";i:414;s:8:"96c3c81b";i:415;s:8:"412bc358";i:416;s:8:"11a4e990";i:417;s:8:"805ead73";i:418;s:8:"ec8ca56e";i:419;s:8:"a2ed4bdc";i:420;s:8:"ac408a10";i:421;s:8:"4ca98f96";i:422;s:8:"0686b6df";i:423;s:8:"9e9f7ae4";i:424;s:8:"07d5f658";i:425;s:8:"1c121a0c";i:426;s:8:"c11c8e82";i:427;s:8:"13f2c6d7";i:428;s:8:"e9f6ad9c";i:429;s:8:"bc1dc285";i:430;s:8:"e271fe4b";i:431;s:8:"34114ee5";i:432;s:8:"92ad1c39";i:433;s:8:"5ab5504b";i:434;s:8:"4f7118a7";i:435;s:8:"d1ceec2f";i:436;s:8:"adfd7622";i:437;s:8:"f4f4a9c0";i:438;s:8:"2d4f21e3";i:439;s:8:"3b4bed9e";i:440;s:8:"42ac5810";i:441;s:8:"7eae8db5";i:442;s:8:"09dc329e";i:443;s:8:"3c723314";i:444;s:8:"7fb50c08";i:445;s:8:"71fd69dd";i:446;s:8:"013ce542";i:447;s:8:"0add0d73";i:448;s:8:"465d495a";i:449;s:8:"9f8ddb9d";i:450;s:8:"f293e79e";i:451;s:8:"d6f59d72";i:452;s:8:"ac22e38f";i:453;s:8:"e96d5751";i:454;s:8:"fba79717";i:455;s:8:"39fedf2f";i:456;s:8:"3fb25196";i:457;s:8:"fcdaa825";i:458;s:8:"9a960022";i:459;s:8:"5371af3d";i:460;s:8:"df7faf0a";i:461;s:8:"82c22c85";i:462;s:8:"dfbbae9f";i:463;s:8:"403a4b84";i:464;s:8:"bc938282";i:465;s:8:"d2355fbc";i:466;s:8:"8d72b179";i:467;s:8:"dced02b2";i:468;s:8:"227b82e3";i:469;s:8:"24c60db6";i:470;s:8:"45092b73";i:471;s:8:"767c0e1d";i:472;s:8:"7eb5c592";i:473;s:8:"d0b356d9";i:474;s:8:"dc95ee45";i:475;s:8:"39aa5820";i:476;s:8:"9e6e1868";i:477;s:8:"ffe72d78";i:478;s:8:"82ae0503";i:479;s:8:"2ea981ad";i:480;s:8:"6935faba";i:481;s:8:"69c2ba98";i:482;s:8:"69dd219f";i:483;s:8:"860e0d0d";i:484;s:8:"5f451aa3";i:485;s:8:"a9d5f07d";i:486;s:8:"ec623682";i:487;s:8:"04d8adba";i:488;s:8:"717e8c76";i:489;s:8:"f9c1fb75";i:490;s:8:"ab4c9e06";i:491;s:8:"3895ef4d";i:492;s:8:"37c09060";i:493;s:8:"f3b7c652";i:494;s:8:"74dc421e";i:495;s:8:"97d458be";i:496;s:8:"1a1ddea1";i:497;s:8:"001c68ad";i:498;s:8:"680f033f";i:499;s:8:"b2e9bd38";i:500;s:8:"54192958";i:501;s:8:"b6dd0693";i:502;s:8:"9d149906";i:503;s:8:"9ba5479a";i:504;s:8:"18ba25e8";i:505;s:8:"16fa3e51";i:506;s:8:"1e74b698";i:507;s:8:"c5932028";i:508;s:8:"5a6cf6cd";i:509;s:8:"6fa90e13";i:510;s:8:"bcabdecb";i:511;s:8:"ae23af9a";i:512;s:8:"76b297eb";i:513;s:8:"d1332632";i:514;s:8:"693a55c3";i:515;s:8:"7c4beb9b";i:516;s:8:"409a0a15";i:517;s:8:"60f68335";i:518;s:8:"febcb934";i:519;s:8:"f32c6f8c";i:520;s:8:"aacacf0d";i:521;s:8:"d1f56e99";i:522;s:8:"d65bcf00";i:523;s:8:"361c9633";i:524;s:8:"cd34d7f4";i:525;s:8:"37d38e62";i:526;s:8:"942dee9d";i:527;s:8:"f41c9445";i:528;s:8:"7e9a8b5d";i:529;s:8:"4b941ed7";i:530;s:8:"c6256dce";i:531;s:8:"6c285146";i:532;s:8:"5920147e";i:533;s:8:"934d59ed";i:534;s:8:"5f400a1d";i:535;s:8:"1a5de58c";i:536;s:8:"11e601de";i:537;s:8:"cf4da287";i:538;s:8:"756a54e4";i:539;s:8:"9f2b1015";i:540;s:8:"3a3df642";i:541;s:8:"5d024d64";i:542;s:8:"2d617393";i:543;s:8:"e1b4ec53";i:544;s:8:"24996b5e";i:545;s:8:"7a271bf1";i:546;s:8:"68d7da60";i:547;s:8:"06d3bc73";i:548;s:8:"f21095f7";i:549;s:8:"93e6bfd9";i:550;s:8:"e80b015b";i:551;s:8:"4ddd4ede";i:552;s:8:"cec3d813";i:553;s:8:"281f2a65";i:554;s:8:"ffa068fb";i:555;s:8:"60e712e7";i:556;s:8:"4abcecac";i:557;s:8:"eef01060";i:558;s:8:"8e79e897";i:559;s:8:"b0cd39fe";i:560;s:8:"28cc9604";i:561;s:8:"c7bd58e0";i:562;s:8:"c73b1765";i:563;s:8:"e87d5e07";i:564;s:8:"03b7710d";i:565;s:8:"5f64c5dc";i:566;s:8:"4ae7b6f1";i:567;s:8:"401b9876";i:568;s:8:"9a162522";i:569;s:8:"2a1d6390";i:570;s:8:"c115eeff";i:571;s:8:"e549f7df";i:572;s:8:"a159c579";i:573;s:8:"48a44ff6";i:574;s:8:"e65fd1fc";i:575;s:8:"bb74cd7b";i:576;s:8:"87cc0383";i:577;s:8:"052755ee";i:578;s:8:"eba29b21";i:579;s:8:"88e2efa9";i:580;s:8:"a1a521b9";i:581;s:8:"ffb6f27b";i:582;s:8:"4fea3248";i:583;s:8:"0f46ad03";i:584;s:8:"58902f76";i:585;s:8:"cfb3f87e";i:586;s:8:"efb3d85c";i:587;s:8:"1e0f4648";i:588;s:8:"f95eda47";i:589;s:8:"c5220b0b";i:590;s:8:"e6574ef8";i:591;s:8:"f34b162e";i:592;s:8:"09b08b14";i:593;s:8:"dae53353";i:594;s:8:"ccc600dd";i:595;s:8:"b3ae8f4f";i:596;s:8:"daed379c";i:597;s:8:"113f5973";i:598;s:8:"6a66bb0a";i:599;s:8:"697817f3";i:600;s:8:"00b78167";i:601;s:8:"1e7c2ed9";i:602;s:8:"65f8a3c5";i:603;s:8:"c50f5c14";i:604;s:8:"a1665ca7";i:605;s:8:"d31c5017";i:606;s:8:"2e421193";i:607;s:8:"cb8d29a9";i:608;s:8:"fa9723b5";i:609;s:8:"8a4d18e4";i:610;s:8:"88081a19";i:611;s:8:"242623e4";i:612;s:8:"86202155";i:613;s:8:"ab55982f";i:614;s:8:"f1a3c261";i:615;s:8:"c44eaa91";i:616;s:8:"06c4716f";i:617;s:8:"60a25216";i:618;s:8:"dcce86a3";i:619;s:8:"bfcec0cd";i:620;s:8:"fb4170ed";i:621;s:8:"9bf5e563";i:622;s:8:"04fa51af";i:623;s:8:"dd86eeb1";i:624;i:0;i:625;i:0;}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // invalid count try { var_dump(unserialize('O:21:"Random\Engine\Mt19937":2:{i:0;a:0:{}i:1;a:626:{i:0;s:8:"5aa6b986";i:1;s:8:"8660cc14";i:2;s:8:"c0b631ca";i:3;s:8:"e85464ad";i:4;s:8:"70fa6108";i:5;s:8:"c5ed9c3c";i:6;s:8:"b05b7ff1";i:7;s:8:"faf33a3a";i:8;s:8:"ab7c0e61";i:9;s:8:"2d4c9c37";i:10;s:8:"daffe918";i:11;s:8:"644f25b9";i:12;s:8:"fdb352e5";i:13;s:8:"434dafa9";i:14;s:8:"a3c9826e";i:15;s:8:"923dfd8c";i:16;s:8:"f641a225";i:17;s:8:"d87134b3";i:18;s:8:"c3b7926e";i:19;s:8:"c880b60d";i:20;s:8:"975f362d";i:21;s:8:"48192b77";i:22;s:8:"6f7dd08b";i:23;s:8:"7d4ad4f8";i:24;s:8:"d805b910";i:25;s:8:"8c98b365";i:26;s:8:"89e54af9";i:27;s:8:"e5257a3c";i:28;s:8:"8f596624";i:29;s:8:"3f42f88a";i:30;s:8:"6a7e95cc";i:31;s:8:"e1349e4d";i:32;s:8:"4539bc92";i:33;s:8:"045a3148";i:34;s:8:"c27cf7b9";i:35;s:8:"c64e8009";i:36;s:8:"dc5ed02e";i:37;s:8:"5753c741";i:38;s:8:"50be0a82";i:39;s:8:"822da0ee";i:40;s:8:"42fdb3c6";i:41;s:8:"c668fc80";i:42;s:8:"262376c6";i:43;s:8:"17b998c6";i:44;s:8:"1f3aac02";i:45;s:8:"6f939c7e";i:46;s:8:"21c099f4";i:47;s:8:"0f4b5c76";i:48;s:8:"64799ac0";i:49;s:8:"45d3bb99";i:50;s:8:"8ff3eb79";i:51;s:8:"61996264";i:52;s:8:"2b9ab1f4";i:53;s:8:"a0d0c50f";i:54;s:8:"f08713ce";i:55;s:8:"6b1cf9d8";i:56;s:8:"52d92cc5";i:57;s:8:"34bcec6f";i:58;s:8:"83ffa063";i:59;s:8:"a002321d";i:60;s:8:"386c46d9";i:61;s:8:"45e2c63e";i:62;s:8:"f481bdf4";i:63;s:8:"df58facb";i:64;s:8:"1781e49b";i:65;s:8:"1d968a6b";i:66;s:8:"8aa7fdd2";i:67;s:8:"631ac8cd";i:68;s:8:"8090ff8e";i:69;s:8:"4ddd4a5d";i:70;s:8:"ff6d8193";i:71;s:8:"39e18244";i:72;s:8:"4efe15db";i:73;s:8:"3fe64cd5";i:74;s:8:"e693a97f";i:75;s:8:"807a34e9";i:76;s:8:"6dc16ae7";i:77;s:8:"a1e1ed1d";i:78;s:8:"605bdc86";i:79;s:8:"abb1830e";i:80;s:8:"2baabeda";i:81;s:8:"fc0f66ad";i:82;s:8:"9cf4fb96";i:83;s:8:"b50ff764";i:84;s:8:"67c37a3d";i:85;s:8:"15253035";i:86;s:8:"387fce47";i:87;s:8:"5c3299a5";i:88;s:8:"125602b9";i:89;s:8:"daeb445c";i:90;s:8:"289e5a8d";i:91;s:8:"b47cd48c";i:92;s:8:"8664db23";i:93;s:8:"b9352af8";i:94;s:8:"51684d88";i:95;s:8:"b204cbc9";i:96;s:8:"e1b6becc";i:97;s:8:"dbbe0ee6";i:98;s:8:"89e54027";i:99;s:8:"a6512564";i:100;s:8:"3aab8d17";i:101;s:8:"7cab5272";i:102;s:8:"1804e981";i:103;s:8:"0bfebe2c";i:104;s:8:"7c082a4c";i:105;s:8:"06bc80c3";i:106;s:8:"c63db839";i:107;s:8:"59edb59d";i:108;s:8:"b52d9655";i:109;s:8:"efce041b";i:110;s:8:"57c1f890";i:111;s:8:"15499697";i:112;s:8:"e0ad3e3a";i:113;s:8:"408d4c16";i:114;s:8:"e53cf468";i:115;s:8:"6ea3d84f";i:116;s:8:"0a2bc4f2";i:117;s:8:"27b59259";i:118;s:8:"d223514b";i:119;s:8:"434c4185";i:120;s:8:"999c71df";i:121;s:8:"46134706";i:122;s:8:"f7f048d0";i:123;s:8:"7f5cfe34";i:124;s:8:"9bdc475c";i:125;s:8:"c1cf42ea";i:126;s:8:"65be324b";i:127;s:8:"68c7a1dc";i:128;s:8:"a7c8c5a2";i:129;s:8:"ecc4cd8a";i:130;s:8:"a761615c";i:131;s:8:"718ec534";i:132;s:8:"c8b086fc";i:133;s:8:"ead759f9";i:134;s:8:"eb9df4a0";i:135;s:8:"ec5b25f9";i:136;s:8:"3a6ff94e";i:137;s:8:"4511a3de";i:138;s:8:"9034f1c6";i:139;s:8:"5c1c6d14";i:140;s:8:"a228ed46";i:141;s:8:"ffe19f2f";i:142;s:8:"f21f68cf";i:143;s:8:"6c2235a4";i:144;s:8:"e0aed51a";i:145;s:8:"2ade527b";i:146;s:8:"65f3c758";i:147;s:8:"f6e868b7";i:148;s:8:"49b770a5";i:149;s:8:"48ab9158";i:150;s:8:"ab07a671";i:151;s:8:"4ef74251";i:152;s:8:"f4cad644";i:153;s:8:"1576c59e";i:154;s:8:"3882bbd1";i:155;s:8:"e49f32c0";i:156;s:8:"c67b757c";i:157;s:8:"3528c5d8";i:158;s:8:"371c3e34";i:159;s:8:"7f1d614f";i:160;s:8:"b9e19e66";i:161;s:8:"80a1d97f";i:162;s:8:"7f93c9f3";i:163;s:8:"4e82ea48";i:164;s:8:"9675e170";i:165;s:8:"aa54caef";i:166;s:8:"3bb9838e";i:167;s:8:"9c0d0a2b";i:168;s:8:"2595d91f";i:169;s:8:"84cc7ff2";i:170;s:8:"9457c4ee";i:171;s:8:"405b6bc8";i:172;s:8:"5aa668a4";i:173;s:8:"e94dfca2";i:174;s:8:"89c0d739";i:175;s:8:"459f8eb3";i:176;s:8:"76b95b42";i:177;s:8:"0e5ceafb";i:178;s:8:"55d4eaee";i:179;s:8:"a55a4784";i:180;s:8:"8c23e133";i:181;s:8:"0994f794";i:182;s:8:"a8d4d1b7";i:183;s:8:"0a50b177";i:184;s:8:"65409f44";i:185;s:8:"acf34e81";i:186;s:8:"e32f278e";i:187;s:8:"7aa21660";i:188;s:8:"9da66881";i:189;s:8:"5c4df7c5";i:190;s:8:"b21f8a4e";i:191;s:8:"d2cc6756";i:192;s:8:"8716f97d";i:193;s:8:"aabd84c5";i:194;s:8:"2e0a965a";i:195;s:8:"b4acc29c";i:196;s:8:"ed3be992";i:197;s:8:"867d9400";i:198;s:8:"a696ba3e";i:199;s:8:"8e2af3d9";i:200;s:8:"8fd95ea9";i:201;s:8:"930903d8";i:202;s:8:"4508dbb1";i:203;s:8:"80598d21";i:204;s:8:"df87fb74";i:205;s:8:"9d019d24";i:206;s:8:"05d5ce2e";i:207;s:8:"ed69bcfe";i:208;s:8:"f83a8d70";i:209;s:8:"750b10bd";i:210;s:8:"c0df892c";i:211;s:8:"df41f215";i:212;s:8:"03df46e3";i:213;s:8:"4e6dce66";i:214;s:8:"ea45a428";i:215;s:8:"cbbf3ff6";i:216;s:8:"f931c7b2";i:217;s:8:"80d19eab";i:218;s:8:"0e2c13da";i:219;s:8:"4b99ee8b";i:220;s:8:"2311d69e";i:221;s:8:"ca9050a7";i:222;s:8:"a4d9eec1";i:223;s:8:"ee665c77";i:224;s:8:"0714f961";i:225;s:8:"81f5be46";i:226;s:8:"420ea4bf";i:227;s:8:"281c28f0";i:228;s:8:"9936ab3f";i:229;s:8:"e4ca8936";i:230;s:8:"224d247b";i:231;s:8:"a564dffe";i:232;s:8:"d15045d2";i:233;s:8:"97d01e8f";i:234;s:8:"71793232";i:235;s:8:"43fe461e";i:236;s:8:"3b50916b";i:237;s:8:"ff242439";i:238;s:8:"a748a0a9";i:239;s:8:"ff51a2a6";i:240;s:8:"dec0ad0d";i:241;s:8:"4bcf2a2e";i:242;s:8:"2be6a97f";i:243;s:8:"eb3e636a";i:244;s:8:"81e31d64";i:245;s:8:"6ca4db9d";i:246;s:8:"bc5bd290";i:247;s:8:"ed2d2ba4";i:248;s:8:"00c46d55";i:249;s:8:"27578407";i:250;s:8:"bedbbcd8";i:251;s:8:"18172abc";i:252;s:8:"eaa5b9cf";i:253;s:8:"9e87ab84";i:254;s:8:"a0e2741c";i:255;s:8:"3bb931ae";i:256;s:8:"3a7b75cd";i:257;s:8:"1052cbf5";i:258;s:8:"b7afd060";i:259;s:8:"1d143d51";i:260;s:8:"17fb7422";i:261;s:8:"523fd346";i:262;s:8:"50429afd";i:263;s:8:"308ece7b";i:264;s:8:"285aa5c1";i:265;s:8:"d8afd736";i:266;s:8:"2e30512e";i:267;s:8:"af78ce36";i:268;s:8:"5967e738";i:269;s:8:"e19795de";i:270;s:8:"6d416e39";i:271;s:8:"23570261";i:272;s:8:"23106924";i:273;s:8:"a4b9add9";i:274;s:8:"baa83e79";i:275;s:8:"97ca48d3";i:276;s:8:"f369a004";i:277;s:8:"fa521bf6";i:278;s:8:"312e9e5e";i:279;s:8:"3acdb850";i:280;s:8:"485cbad7";i:281;s:8:"ddc2d365";i:282;s:8:"d8b87c13";i:283;s:8:"51f6aa7a";i:284;s:8:"b1c231ce";i:285;s:8:"926b9e57";i:286;s:8:"32bd5241";i:287;s:8:"b72cf0a0";i:288;s:8:"0cd99f51";i:289;s:8:"80815c0e";i:290;s:8:"a3459115";i:291;s:8:"5bb05439";i:292;s:8:"ee67a282";i:293;s:8:"65e533c5";i:294;s:8:"62e57b7a";i:295;s:8:"0f4a42fe";i:296;s:8:"ff5b8045";i:297;s:8:"cb9d60cf";i:298;s:8:"ffc891cd";i:299;s:8:"514d6027";i:300;s:8:"5b92df3b";i:301;s:8:"1fb47b1a";i:302;s:8:"a2382db8";i:303;s:8:"6f8b23cd";i:304;s:8:"db72737a";i:305;s:8:"d2d5022b";i:306;s:8:"eef762a7";i:307;s:8:"771fc2ed";i:308;s:8:"6581afb1";i:309;s:8:"64d7ffbd";i:310;s:8:"93a15a65";i:311;s:8:"fdc8b81b";i:312;s:8:"6369357b";i:313;s:8:"a8a58d2e";i:314;s:8:"d9ab2ed6";i:315;s:8:"0465340d";i:316;s:8:"eed4e3f1";i:317;s:8:"7e15ef9d";i:318;s:8:"99444e57";i:319;s:8:"959a6881";i:320;s:8:"e7498e10";i:321;s:8:"d7d0699e";i:322;s:8:"12372566";i:323;s:8:"b9f97c89";i:324;s:8:"5e688172";i:325;s:8:"8105e3b8";i:326;s:8:"627e9227";i:327;s:8:"67edb47d";i:328;s:8:"74e69d5f";i:329;s:8:"b8c5df2c";i:330;s:8:"14f06e80";i:331;s:8:"1a0af27f";i:332;s:8:"fa6ad68b";i:333;s:8:"d5938b0d";i:334;s:8:"2df9b8cc";i:335;s:8:"d90bd16c";i:336;s:8:"18779d24";i:337;s:8:"e1b81866";i:338;s:8:"dc51e106";i:339;s:8:"5078c0ce";i:340;s:8:"8fde3be3";i:341;s:8:"85939b08";i:342;s:8:"50f5565d";i:343;s:8:"281ec5f0";i:344;s:8:"ee2c4dfb";i:345;s:8:"89df2863";i:346;s:8:"0444ef85";i:347;s:8:"d52671b6";i:348;s:8:"84695c5d";i:349;s:8:"ceb19fc9";i:350;s:8:"8cd19595";i:351;s:8:"9773504b";i:352;s:8:"72031351";i:353;s:8:"285de56c";i:354;s:8:"08d949a1";i:355;s:8:"d1d24d60";i:356;s:8:"41c57eff";i:357;s:8:"ded22dfc";i:358;s:8:"9f799eb2";i:359;s:8:"ac14c164";i:360;s:8:"23ab3dac";i:361;s:8:"76de10e0";i:362;s:8:"72c2ac0b";i:363;s:8:"cce93127";i:364;s:8:"32bbb7e5";i:365;s:8:"b8af671a";i:366;s:8:"24dfc65a";i:367;s:8:"d7c8431f";i:368;s:8:"5cf3dffd";i:369;s:8:"7a93645c";i:370;s:8:"36bb66f8";i:371;s:8:"dc055709";i:372;s:8:"93c58efc";i:373;s:8:"11b9a1e6";i:374;s:8:"e487f36b";i:375;s:8:"7c3bcb46";i:376;s:8:"e4d724a3";i:377;s:8:"b732d653";i:378;s:8:"afc9c219";i:379;s:8:"ea658830";i:380;s:8:"b9052af6";i:381;s:8:"aa46a473";i:382;s:8:"1b37a35e";i:383;s:8:"0ba14ee9";i:384;s:8:"c7e150ac";i:385;s:8:"055ffa96";i:386;s:8:"e2bf88fb";i:387;s:8:"88f1f936";i:388;s:8:"488c7bdb";i:389;s:8:"a9dacbd1";i:390;s:8:"aaeea26f";i:391;s:8:"237af1cb";i:392;s:8:"e3dbdb50";i:393;s:8:"c8e5949e";i:394;s:8:"e70a989a";i:395;s:8:"fa540d6d";i:396;s:8:"f055b2f2";i:397;s:8:"1fc8acd4";i:398;s:8:"accb1a9b";i:399;s:8:"bedfb89c";i:400;s:8:"3d243ec0";i:401;s:8:"d2f3f2d8";i:402;s:8:"d83e7c53";i:403;s:8:"4f12e12d";i:404;s:8:"f48f33d1";i:405;s:8:"9555d943";i:406;s:8:"db853a55";i:407;s:8:"506a95b4";i:408;s:8:"408155d1";i:409;s:8:"32a384a0";i:410;s:8:"21c34eb4";i:411;s:8:"93e2e1ae";i:412;s:8:"88582a10";i:413;s:8:"1f065648";i:414;s:8:"96c3c81b";i:415;s:8:"412bc358";i:416;s:8:"11a4e990";i:417;s:8:"805ead73";i:418;s:8:"ec8ca56e";i:419;s:8:"a2ed4bdc";i:420;s:8:"ac408a10";i:421;s:8:"4ca98f96";i:422;s:8:"0686b6df";i:423;s:8:"9e9f7ae4";i:424;s:8:"07d5f658";i:425;s:8:"1c121a0c";i:426;s:8:"c11c8e82";i:427;s:8:"13f2c6d7";i:428;s:8:"e9f6ad9c";i:429;s:8:"bc1dc285";i:430;s:8:"e271fe4b";i:431;s:8:"34114ee5";i:432;s:8:"92ad1c39";i:433;s:8:"5ab5504b";i:434;s:8:"4f7118a7";i:435;s:8:"d1ceec2f";i:436;s:8:"adfd7622";i:437;s:8:"f4f4a9c0";i:438;s:8:"2d4f21e3";i:439;s:8:"3b4bed9e";i:440;s:8:"42ac5810";i:441;s:8:"7eae8db5";i:442;s:8:"09dc329e";i:443;s:8:"3c723314";i:444;s:8:"7fb50c08";i:445;s:8:"71fd69dd";i:446;s:8:"013ce542";i:447;s:8:"0add0d73";i:448;s:8:"465d495a";i:449;s:8:"9f8ddb9d";i:450;s:8:"f293e79e";i:451;s:8:"d6f59d72";i:452;s:8:"ac22e38f";i:453;s:8:"e96d5751";i:454;s:8:"fba79717";i:455;s:8:"39fedf2f";i:456;s:8:"3fb25196";i:457;s:8:"fcdaa825";i:458;s:8:"9a960022";i:459;s:8:"5371af3d";i:460;s:8:"df7faf0a";i:461;s:8:"82c22c85";i:462;s:8:"dfbbae9f";i:463;s:8:"403a4b84";i:464;s:8:"bc938282";i:465;s:8:"d2355fbc";i:466;s:8:"8d72b179";i:467;s:8:"dced02b2";i:468;s:8:"227b82e3";i:469;s:8:"24c60db6";i:470;s:8:"45092b73";i:471;s:8:"767c0e1d";i:472;s:8:"7eb5c592";i:473;s:8:"d0b356d9";i:474;s:8:"dc95ee45";i:475;s:8:"39aa5820";i:476;s:8:"9e6e1868";i:477;s:8:"ffe72d78";i:478;s:8:"82ae0503";i:479;s:8:"2ea981ad";i:480;s:8:"6935faba";i:481;s:8:"69c2ba98";i:482;s:8:"69dd219f";i:483;s:8:"860e0d0d";i:484;s:8:"5f451aa3";i:485;s:8:"a9d5f07d";i:486;s:8:"ec623682";i:487;s:8:"04d8adba";i:488;s:8:"717e8c76";i:489;s:8:"f9c1fb75";i:490;s:8:"ab4c9e06";i:491;s:8:"3895ef4d";i:492;s:8:"37c09060";i:493;s:8:"f3b7c652";i:494;s:8:"74dc421e";i:495;s:8:"97d458be";i:496;s:8:"1a1ddea1";i:497;s:8:"001c68ad";i:498;s:8:"680f033f";i:499;s:8:"b2e9bd38";i:500;s:8:"54192958";i:501;s:8:"b6dd0693";i:502;s:8:"9d149906";i:503;s:8:"9ba5479a";i:504;s:8:"18ba25e8";i:505;s:8:"16fa3e51";i:506;s:8:"1e74b698";i:507;s:8:"c5932028";i:508;s:8:"5a6cf6cd";i:509;s:8:"6fa90e13";i:510;s:8:"bcabdecb";i:511;s:8:"ae23af9a";i:512;s:8:"76b297eb";i:513;s:8:"d1332632";i:514;s:8:"693a55c3";i:515;s:8:"7c4beb9b";i:516;s:8:"409a0a15";i:517;s:8:"60f68335";i:518;s:8:"febcb934";i:519;s:8:"f32c6f8c";i:520;s:8:"aacacf0d";i:521;s:8:"d1f56e99";i:522;s:8:"d65bcf00";i:523;s:8:"361c9633";i:524;s:8:"cd34d7f4";i:525;s:8:"37d38e62";i:526;s:8:"942dee9d";i:527;s:8:"f41c9445";i:528;s:8:"7e9a8b5d";i:529;s:8:"4b941ed7";i:530;s:8:"c6256dce";i:531;s:8:"6c285146";i:532;s:8:"5920147e";i:533;s:8:"934d59ed";i:534;s:8:"5f400a1d";i:535;s:8:"1a5de58c";i:536;s:8:"11e601de";i:537;s:8:"cf4da287";i:538;s:8:"756a54e4";i:539;s:8:"9f2b1015";i:540;s:8:"3a3df642";i:541;s:8:"5d024d64";i:542;s:8:"2d617393";i:543;s:8:"e1b4ec53";i:544;s:8:"24996b5e";i:545;s:8:"7a271bf1";i:546;s:8:"68d7da60";i:547;s:8:"06d3bc73";i:548;s:8:"f21095f7";i:549;s:8:"93e6bfd9";i:550;s:8:"e80b015b";i:551;s:8:"4ddd4ede";i:552;s:8:"cec3d813";i:553;s:8:"281f2a65";i:554;s:8:"ffa068fb";i:555;s:8:"60e712e7";i:556;s:8:"4abcecac";i:557;s:8:"eef01060";i:558;s:8:"8e79e897";i:559;s:8:"b0cd39fe";i:560;s:8:"28cc9604";i:561;s:8:"c7bd58e0";i:562;s:8:"c73b1765";i:563;s:8:"e87d5e07";i:564;s:8:"03b7710d";i:565;s:8:"5f64c5dc";i:566;s:8:"4ae7b6f1";i:567;s:8:"401b9876";i:568;s:8:"9a162522";i:569;s:8:"2a1d6390";i:570;s:8:"c115eeff";i:571;s:8:"e549f7df";i:572;s:8:"a159c579";i:573;s:8:"48a44ff6";i:574;s:8:"e65fd1fc";i:575;s:8:"bb74cd7b";i:576;s:8:"87cc0383";i:577;s:8:"052755ee";i:578;s:8:"eba29b21";i:579;s:8:"88e2efa9";i:580;s:8:"a1a521b9";i:581;s:8:"ffb6f27b";i:582;s:8:"4fea3248";i:583;s:8:"0f46ad03";i:584;s:8:"58902f76";i:585;s:8:"cfb3f87e";i:586;s:8:"efb3d85c";i:587;s:8:"1e0f4648";i:588;s:8:"f95eda47";i:589;s:8:"c5220b0b";i:590;s:8:"e6574ef8";i:591;s:8:"f34b162e";i:592;s:8:"09b08b14";i:593;s:8:"dae53353";i:594;s:8:"ccc600dd";i:595;s:8:"b3ae8f4f";i:596;s:8:"daed379c";i:597;s:8:"113f5973";i:598;s:8:"6a66bb0a";i:599;s:8:"697817f3";i:600;s:8:"00b78167";i:601;s:8:"1e7c2ed9";i:602;s:8:"65f8a3c5";i:603;s:8:"c50f5c14";i:604;s:8:"a1665ca7";i:605;s:8:"d31c5017";i:606;s:8:"2e421193";i:607;s:8:"cb8d29a9";i:608;s:8:"fa9723b5";i:609;s:8:"8a4d18e4";i:610;s:8:"88081a19";i:611;s:8:"242623e4";i:612;s:8:"86202155";i:613;s:8:"ab55982f";i:614;s:8:"f1a3c261";i:615;s:8:"c44eaa91";i:616;s:8:"06c4716f";i:617;s:8:"60a25216";i:618;s:8:"dcce86a3";i:619;s:8:"bfcec0cd";i:620;s:8:"fb4170ed";i:621;s:8:"9bf5e563";i:622;s:8:"04fa51af";i:623;s:8:"dd86eeb1";i:624;i:1000;i:625;i:0;}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // invalid mode try { var_dump(unserialize('O:21:"Random\Engine\Mt19937":2:{i:0;a:0:{}i:1;a:626:{i:0;s:8:"5aa6b986";i:1;s:8:"8660cc14";i:2;s:8:"c0b631ca";i:3;s:8:"e85464ad";i:4;s:8:"70fa6108";i:5;s:8:"c5ed9c3c";i:6;s:8:"b05b7ff1";i:7;s:8:"faf33a3a";i:8;s:8:"ab7c0e61";i:9;s:8:"2d4c9c37";i:10;s:8:"daffe918";i:11;s:8:"644f25b9";i:12;s:8:"fdb352e5";i:13;s:8:"434dafa9";i:14;s:8:"a3c9826e";i:15;s:8:"923dfd8c";i:16;s:8:"f641a225";i:17;s:8:"d87134b3";i:18;s:8:"c3b7926e";i:19;s:8:"c880b60d";i:20;s:8:"975f362d";i:21;s:8:"48192b77";i:22;s:8:"6f7dd08b";i:23;s:8:"7d4ad4f8";i:24;s:8:"d805b910";i:25;s:8:"8c98b365";i:26;s:8:"89e54af9";i:27;s:8:"e5257a3c";i:28;s:8:"8f596624";i:29;s:8:"3f42f88a";i:30;s:8:"6a7e95cc";i:31;s:8:"e1349e4d";i:32;s:8:"4539bc92";i:33;s:8:"045a3148";i:34;s:8:"c27cf7b9";i:35;s:8:"c64e8009";i:36;s:8:"dc5ed02e";i:37;s:8:"5753c741";i:38;s:8:"50be0a82";i:39;s:8:"822da0ee";i:40;s:8:"42fdb3c6";i:41;s:8:"c668fc80";i:42;s:8:"262376c6";i:43;s:8:"17b998c6";i:44;s:8:"1f3aac02";i:45;s:8:"6f939c7e";i:46;s:8:"21c099f4";i:47;s:8:"0f4b5c76";i:48;s:8:"64799ac0";i:49;s:8:"45d3bb99";i:50;s:8:"8ff3eb79";i:51;s:8:"61996264";i:52;s:8:"2b9ab1f4";i:53;s:8:"a0d0c50f";i:54;s:8:"f08713ce";i:55;s:8:"6b1cf9d8";i:56;s:8:"52d92cc5";i:57;s:8:"34bcec6f";i:58;s:8:"83ffa063";i:59;s:8:"a002321d";i:60;s:8:"386c46d9";i:61;s:8:"45e2c63e";i:62;s:8:"f481bdf4";i:63;s:8:"df58facb";i:64;s:8:"1781e49b";i:65;s:8:"1d968a6b";i:66;s:8:"8aa7fdd2";i:67;s:8:"631ac8cd";i:68;s:8:"8090ff8e";i:69;s:8:"4ddd4a5d";i:70;s:8:"ff6d8193";i:71;s:8:"39e18244";i:72;s:8:"4efe15db";i:73;s:8:"3fe64cd5";i:74;s:8:"e693a97f";i:75;s:8:"807a34e9";i:76;s:8:"6dc16ae7";i:77;s:8:"a1e1ed1d";i:78;s:8:"605bdc86";i:79;s:8:"abb1830e";i:80;s:8:"2baabeda";i:81;s:8:"fc0f66ad";i:82;s:8:"9cf4fb96";i:83;s:8:"b50ff764";i:84;s:8:"67c37a3d";i:85;s:8:"15253035";i:86;s:8:"387fce47";i:87;s:8:"5c3299a5";i:88;s:8:"125602b9";i:89;s:8:"daeb445c";i:90;s:8:"289e5a8d";i:91;s:8:"b47cd48c";i:92;s:8:"8664db23";i:93;s:8:"b9352af8";i:94;s:8:"51684d88";i:95;s:8:"b204cbc9";i:96;s:8:"e1b6becc";i:97;s:8:"dbbe0ee6";i:98;s:8:"89e54027";i:99;s:8:"a6512564";i:100;s:8:"3aab8d17";i:101;s:8:"7cab5272";i:102;s:8:"1804e981";i:103;s:8:"0bfebe2c";i:104;s:8:"7c082a4c";i:105;s:8:"06bc80c3";i:106;s:8:"c63db839";i:107;s:8:"59edb59d";i:108;s:8:"b52d9655";i:109;s:8:"efce041b";i:110;s:8:"57c1f890";i:111;s:8:"15499697";i:112;s:8:"e0ad3e3a";i:113;s:8:"408d4c16";i:114;s:8:"e53cf468";i:115;s:8:"6ea3d84f";i:116;s:8:"0a2bc4f2";i:117;s:8:"27b59259";i:118;s:8:"d223514b";i:119;s:8:"434c4185";i:120;s:8:"999c71df";i:121;s:8:"46134706";i:122;s:8:"f7f048d0";i:123;s:8:"7f5cfe34";i:124;s:8:"9bdc475c";i:125;s:8:"c1cf42ea";i:126;s:8:"65be324b";i:127;s:8:"68c7a1dc";i:128;s:8:"a7c8c5a2";i:129;s:8:"ecc4cd8a";i:130;s:8:"a761615c";i:131;s:8:"718ec534";i:132;s:8:"c8b086fc";i:133;s:8:"ead759f9";i:134;s:8:"eb9df4a0";i:135;s:8:"ec5b25f9";i:136;s:8:"3a6ff94e";i:137;s:8:"4511a3de";i:138;s:8:"9034f1c6";i:139;s:8:"5c1c6d14";i:140;s:8:"a228ed46";i:141;s:8:"ffe19f2f";i:142;s:8:"f21f68cf";i:143;s:8:"6c2235a4";i:144;s:8:"e0aed51a";i:145;s:8:"2ade527b";i:146;s:8:"65f3c758";i:147;s:8:"f6e868b7";i:148;s:8:"49b770a5";i:149;s:8:"48ab9158";i:150;s:8:"ab07a671";i:151;s:8:"4ef74251";i:152;s:8:"f4cad644";i:153;s:8:"1576c59e";i:154;s:8:"3882bbd1";i:155;s:8:"e49f32c0";i:156;s:8:"c67b757c";i:157;s:8:"3528c5d8";i:158;s:8:"371c3e34";i:159;s:8:"7f1d614f";i:160;s:8:"b9e19e66";i:161;s:8:"80a1d97f";i:162;s:8:"7f93c9f3";i:163;s:8:"4e82ea48";i:164;s:8:"9675e170";i:165;s:8:"aa54caef";i:166;s:8:"3bb9838e";i:167;s:8:"9c0d0a2b";i:168;s:8:"2595d91f";i:169;s:8:"84cc7ff2";i:170;s:8:"9457c4ee";i:171;s:8:"405b6bc8";i:172;s:8:"5aa668a4";i:173;s:8:"e94dfca2";i:174;s:8:"89c0d739";i:175;s:8:"459f8eb3";i:176;s:8:"76b95b42";i:177;s:8:"0e5ceafb";i:178;s:8:"55d4eaee";i:179;s:8:"a55a4784";i:180;s:8:"8c23e133";i:181;s:8:"0994f794";i:182;s:8:"a8d4d1b7";i:183;s:8:"0a50b177";i:184;s:8:"65409f44";i:185;s:8:"acf34e81";i:186;s:8:"e32f278e";i:187;s:8:"7aa21660";i:188;s:8:"9da66881";i:189;s:8:"5c4df7c5";i:190;s:8:"b21f8a4e";i:191;s:8:"d2cc6756";i:192;s:8:"8716f97d";i:193;s:8:"aabd84c5";i:194;s:8:"2e0a965a";i:195;s:8:"b4acc29c";i:196;s:8:"ed3be992";i:197;s:8:"867d9400";i:198;s:8:"a696ba3e";i:199;s:8:"8e2af3d9";i:200;s:8:"8fd95ea9";i:201;s:8:"930903d8";i:202;s:8:"4508dbb1";i:203;s:8:"80598d21";i:204;s:8:"df87fb74";i:205;s:8:"9d019d24";i:206;s:8:"05d5ce2e";i:207;s:8:"ed69bcfe";i:208;s:8:"f83a8d70";i:209;s:8:"750b10bd";i:210;s:8:"c0df892c";i:211;s:8:"df41f215";i:212;s:8:"03df46e3";i:213;s:8:"4e6dce66";i:214;s:8:"ea45a428";i:215;s:8:"cbbf3ff6";i:216;s:8:"f931c7b2";i:217;s:8:"80d19eab";i:218;s:8:"0e2c13da";i:219;s:8:"4b99ee8b";i:220;s:8:"2311d69e";i:221;s:8:"ca9050a7";i:222;s:8:"a4d9eec1";i:223;s:8:"ee665c77";i:224;s:8:"0714f961";i:225;s:8:"81f5be46";i:226;s:8:"420ea4bf";i:227;s:8:"281c28f0";i:228;s:8:"9936ab3f";i:229;s:8:"e4ca8936";i:230;s:8:"224d247b";i:231;s:8:"a564dffe";i:232;s:8:"d15045d2";i:233;s:8:"97d01e8f";i:234;s:8:"71793232";i:235;s:8:"43fe461e";i:236;s:8:"3b50916b";i:237;s:8:"ff242439";i:238;s:8:"a748a0a9";i:239;s:8:"ff51a2a6";i:240;s:8:"dec0ad0d";i:241;s:8:"4bcf2a2e";i:242;s:8:"2be6a97f";i:243;s:8:"eb3e636a";i:244;s:8:"81e31d64";i:245;s:8:"6ca4db9d";i:246;s:8:"bc5bd290";i:247;s:8:"ed2d2ba4";i:248;s:8:"00c46d55";i:249;s:8:"27578407";i:250;s:8:"bedbbcd8";i:251;s:8:"18172abc";i:252;s:8:"eaa5b9cf";i:253;s:8:"9e87ab84";i:254;s:8:"a0e2741c";i:255;s:8:"3bb931ae";i:256;s:8:"3a7b75cd";i:257;s:8:"1052cbf5";i:258;s:8:"b7afd060";i:259;s:8:"1d143d51";i:260;s:8:"17fb7422";i:261;s:8:"523fd346";i:262;s:8:"50429afd";i:263;s:8:"308ece7b";i:264;s:8:"285aa5c1";i:265;s:8:"d8afd736";i:266;s:8:"2e30512e";i:267;s:8:"af78ce36";i:268;s:8:"5967e738";i:269;s:8:"e19795de";i:270;s:8:"6d416e39";i:271;s:8:"23570261";i:272;s:8:"23106924";i:273;s:8:"a4b9add9";i:274;s:8:"baa83e79";i:275;s:8:"97ca48d3";i:276;s:8:"f369a004";i:277;s:8:"fa521bf6";i:278;s:8:"312e9e5e";i:279;s:8:"3acdb850";i:280;s:8:"485cbad7";i:281;s:8:"ddc2d365";i:282;s:8:"d8b87c13";i:283;s:8:"51f6aa7a";i:284;s:8:"b1c231ce";i:285;s:8:"926b9e57";i:286;s:8:"32bd5241";i:287;s:8:"b72cf0a0";i:288;s:8:"0cd99f51";i:289;s:8:"80815c0e";i:290;s:8:"a3459115";i:291;s:8:"5bb05439";i:292;s:8:"ee67a282";i:293;s:8:"65e533c5";i:294;s:8:"62e57b7a";i:295;s:8:"0f4a42fe";i:296;s:8:"ff5b8045";i:297;s:8:"cb9d60cf";i:298;s:8:"ffc891cd";i:299;s:8:"514d6027";i:300;s:8:"5b92df3b";i:301;s:8:"1fb47b1a";i:302;s:8:"a2382db8";i:303;s:8:"6f8b23cd";i:304;s:8:"db72737a";i:305;s:8:"d2d5022b";i:306;s:8:"eef762a7";i:307;s:8:"771fc2ed";i:308;s:8:"6581afb1";i:309;s:8:"64d7ffbd";i:310;s:8:"93a15a65";i:311;s:8:"fdc8b81b";i:312;s:8:"6369357b";i:313;s:8:"a8a58d2e";i:314;s:8:"d9ab2ed6";i:315;s:8:"0465340d";i:316;s:8:"eed4e3f1";i:317;s:8:"7e15ef9d";i:318;s:8:"99444e57";i:319;s:8:"959a6881";i:320;s:8:"e7498e10";i:321;s:8:"d7d0699e";i:322;s:8:"12372566";i:323;s:8:"b9f97c89";i:324;s:8:"5e688172";i:325;s:8:"8105e3b8";i:326;s:8:"627e9227";i:327;s:8:"67edb47d";i:328;s:8:"74e69d5f";i:329;s:8:"b8c5df2c";i:330;s:8:"14f06e80";i:331;s:8:"1a0af27f";i:332;s:8:"fa6ad68b";i:333;s:8:"d5938b0d";i:334;s:8:"2df9b8cc";i:335;s:8:"d90bd16c";i:336;s:8:"18779d24";i:337;s:8:"e1b81866";i:338;s:8:"dc51e106";i:339;s:8:"5078c0ce";i:340;s:8:"8fde3be3";i:341;s:8:"85939b08";i:342;s:8:"50f5565d";i:343;s:8:"281ec5f0";i:344;s:8:"ee2c4dfb";i:345;s:8:"89df2863";i:346;s:8:"0444ef85";i:347;s:8:"d52671b6";i:348;s:8:"84695c5d";i:349;s:8:"ceb19fc9";i:350;s:8:"8cd19595";i:351;s:8:"9773504b";i:352;s:8:"72031351";i:353;s:8:"285de56c";i:354;s:8:"08d949a1";i:355;s:8:"d1d24d60";i:356;s:8:"41c57eff";i:357;s:8:"ded22dfc";i:358;s:8:"9f799eb2";i:359;s:8:"ac14c164";i:360;s:8:"23ab3dac";i:361;s:8:"76de10e0";i:362;s:8:"72c2ac0b";i:363;s:8:"cce93127";i:364;s:8:"32bbb7e5";i:365;s:8:"b8af671a";i:366;s:8:"24dfc65a";i:367;s:8:"d7c8431f";i:368;s:8:"5cf3dffd";i:369;s:8:"7a93645c";i:370;s:8:"36bb66f8";i:371;s:8:"dc055709";i:372;s:8:"93c58efc";i:373;s:8:"11b9a1e6";i:374;s:8:"e487f36b";i:375;s:8:"7c3bcb46";i:376;s:8:"e4d724a3";i:377;s:8:"b732d653";i:378;s:8:"afc9c219";i:379;s:8:"ea658830";i:380;s:8:"b9052af6";i:381;s:8:"aa46a473";i:382;s:8:"1b37a35e";i:383;s:8:"0ba14ee9";i:384;s:8:"c7e150ac";i:385;s:8:"055ffa96";i:386;s:8:"e2bf88fb";i:387;s:8:"88f1f936";i:388;s:8:"488c7bdb";i:389;s:8:"a9dacbd1";i:390;s:8:"aaeea26f";i:391;s:8:"237af1cb";i:392;s:8:"e3dbdb50";i:393;s:8:"c8e5949e";i:394;s:8:"e70a989a";i:395;s:8:"fa540d6d";i:396;s:8:"f055b2f2";i:397;s:8:"1fc8acd4";i:398;s:8:"accb1a9b";i:399;s:8:"bedfb89c";i:400;s:8:"3d243ec0";i:401;s:8:"d2f3f2d8";i:402;s:8:"d83e7c53";i:403;s:8:"4f12e12d";i:404;s:8:"f48f33d1";i:405;s:8:"9555d943";i:406;s:8:"db853a55";i:407;s:8:"506a95b4";i:408;s:8:"408155d1";i:409;s:8:"32a384a0";i:410;s:8:"21c34eb4";i:411;s:8:"93e2e1ae";i:412;s:8:"88582a10";i:413;s:8:"1f065648";i:414;s:8:"96c3c81b";i:415;s:8:"412bc358";i:416;s:8:"11a4e990";i:417;s:8:"805ead73";i:418;s:8:"ec8ca56e";i:419;s:8:"a2ed4bdc";i:420;s:8:"ac408a10";i:421;s:8:"4ca98f96";i:422;s:8:"0686b6df";i:423;s:8:"9e9f7ae4";i:424;s:8:"07d5f658";i:425;s:8:"1c121a0c";i:426;s:8:"c11c8e82";i:427;s:8:"13f2c6d7";i:428;s:8:"e9f6ad9c";i:429;s:8:"bc1dc285";i:430;s:8:"e271fe4b";i:431;s:8:"34114ee5";i:432;s:8:"92ad1c39";i:433;s:8:"5ab5504b";i:434;s:8:"4f7118a7";i:435;s:8:"d1ceec2f";i:436;s:8:"adfd7622";i:437;s:8:"f4f4a9c0";i:438;s:8:"2d4f21e3";i:439;s:8:"3b4bed9e";i:440;s:8:"42ac5810";i:441;s:8:"7eae8db5";i:442;s:8:"09dc329e";i:443;s:8:"3c723314";i:444;s:8:"7fb50c08";i:445;s:8:"71fd69dd";i:446;s:8:"013ce542";i:447;s:8:"0add0d73";i:448;s:8:"465d495a";i:449;s:8:"9f8ddb9d";i:450;s:8:"f293e79e";i:451;s:8:"d6f59d72";i:452;s:8:"ac22e38f";i:453;s:8:"e96d5751";i:454;s:8:"fba79717";i:455;s:8:"39fedf2f";i:456;s:8:"3fb25196";i:457;s:8:"fcdaa825";i:458;s:8:"9a960022";i:459;s:8:"5371af3d";i:460;s:8:"df7faf0a";i:461;s:8:"82c22c85";i:462;s:8:"dfbbae9f";i:463;s:8:"403a4b84";i:464;s:8:"bc938282";i:465;s:8:"d2355fbc";i:466;s:8:"8d72b179";i:467;s:8:"dced02b2";i:468;s:8:"227b82e3";i:469;s:8:"24c60db6";i:470;s:8:"45092b73";i:471;s:8:"767c0e1d";i:472;s:8:"7eb5c592";i:473;s:8:"d0b356d9";i:474;s:8:"dc95ee45";i:475;s:8:"39aa5820";i:476;s:8:"9e6e1868";i:477;s:8:"ffe72d78";i:478;s:8:"82ae0503";i:479;s:8:"2ea981ad";i:480;s:8:"6935faba";i:481;s:8:"69c2ba98";i:482;s:8:"69dd219f";i:483;s:8:"860e0d0d";i:484;s:8:"5f451aa3";i:485;s:8:"a9d5f07d";i:486;s:8:"ec623682";i:487;s:8:"04d8adba";i:488;s:8:"717e8c76";i:489;s:8:"f9c1fb75";i:490;s:8:"ab4c9e06";i:491;s:8:"3895ef4d";i:492;s:8:"37c09060";i:493;s:8:"f3b7c652";i:494;s:8:"74dc421e";i:495;s:8:"97d458be";i:496;s:8:"1a1ddea1";i:497;s:8:"001c68ad";i:498;s:8:"680f033f";i:499;s:8:"b2e9bd38";i:500;s:8:"54192958";i:501;s:8:"b6dd0693";i:502;s:8:"9d149906";i:503;s:8:"9ba5479a";i:504;s:8:"18ba25e8";i:505;s:8:"16fa3e51";i:506;s:8:"1e74b698";i:507;s:8:"c5932028";i:508;s:8:"5a6cf6cd";i:509;s:8:"6fa90e13";i:510;s:8:"bcabdecb";i:511;s:8:"ae23af9a";i:512;s:8:"76b297eb";i:513;s:8:"d1332632";i:514;s:8:"693a55c3";i:515;s:8:"7c4beb9b";i:516;s:8:"409a0a15";i:517;s:8:"60f68335";i:518;s:8:"febcb934";i:519;s:8:"f32c6f8c";i:520;s:8:"aacacf0d";i:521;s:8:"d1f56e99";i:522;s:8:"d65bcf00";i:523;s:8:"361c9633";i:524;s:8:"cd34d7f4";i:525;s:8:"37d38e62";i:526;s:8:"942dee9d";i:527;s:8:"f41c9445";i:528;s:8:"7e9a8b5d";i:529;s:8:"4b941ed7";i:530;s:8:"c6256dce";i:531;s:8:"6c285146";i:532;s:8:"5920147e";i:533;s:8:"934d59ed";i:534;s:8:"5f400a1d";i:535;s:8:"1a5de58c";i:536;s:8:"11e601de";i:537;s:8:"cf4da287";i:538;s:8:"756a54e4";i:539;s:8:"9f2b1015";i:540;s:8:"3a3df642";i:541;s:8:"5d024d64";i:542;s:8:"2d617393";i:543;s:8:"e1b4ec53";i:544;s:8:"24996b5e";i:545;s:8:"7a271bf1";i:546;s:8:"68d7da60";i:547;s:8:"06d3bc73";i:548;s:8:"f21095f7";i:549;s:8:"93e6bfd9";i:550;s:8:"e80b015b";i:551;s:8:"4ddd4ede";i:552;s:8:"cec3d813";i:553;s:8:"281f2a65";i:554;s:8:"ffa068fb";i:555;s:8:"60e712e7";i:556;s:8:"4abcecac";i:557;s:8:"eef01060";i:558;s:8:"8e79e897";i:559;s:8:"b0cd39fe";i:560;s:8:"28cc9604";i:561;s:8:"c7bd58e0";i:562;s:8:"c73b1765";i:563;s:8:"e87d5e07";i:564;s:8:"03b7710d";i:565;s:8:"5f64c5dc";i:566;s:8:"4ae7b6f1";i:567;s:8:"401b9876";i:568;s:8:"9a162522";i:569;s:8:"2a1d6390";i:570;s:8:"c115eeff";i:571;s:8:"e549f7df";i:572;s:8:"a159c579";i:573;s:8:"48a44ff6";i:574;s:8:"e65fd1fc";i:575;s:8:"bb74cd7b";i:576;s:8:"87cc0383";i:577;s:8:"052755ee";i:578;s:8:"eba29b21";i:579;s:8:"88e2efa9";i:580;s:8:"a1a521b9";i:581;s:8:"ffb6f27b";i:582;s:8:"4fea3248";i:583;s:8:"0f46ad03";i:584;s:8:"58902f76";i:585;s:8:"cfb3f87e";i:586;s:8:"efb3d85c";i:587;s:8:"1e0f4648";i:588;s:8:"f95eda47";i:589;s:8:"c5220b0b";i:590;s:8:"e6574ef8";i:591;s:8:"f34b162e";i:592;s:8:"09b08b14";i:593;s:8:"dae53353";i:594;s:8:"ccc600dd";i:595;s:8:"b3ae8f4f";i:596;s:8:"daed379c";i:597;s:8:"113f5973";i:598;s:8:"6a66bb0a";i:599;s:8:"697817f3";i:600;s:8:"00b78167";i:601;s:8:"1e7c2ed9";i:602;s:8:"65f8a3c5";i:603;s:8:"c50f5c14";i:604;s:8:"a1665ca7";i:605;s:8:"d31c5017";i:606;s:8:"2e421193";i:607;s:8:"cb8d29a9";i:608;s:8:"fa9723b5";i:609;s:8:"8a4d18e4";i:610;s:8:"88081a19";i:611;s:8:"242623e4";i:612;s:8:"86202155";i:613;s:8:"ab55982f";i:614;s:8:"f1a3c261";i:615;s:8:"c44eaa91";i:616;s:8:"06c4716f";i:617;s:8:"60a25216";i:618;s:8:"dcce86a3";i:619;s:8:"bfcec0cd";i:620;s:8:"fb4170ed";i:621;s:8:"9bf5e563";i:622;s:8:"04fa51af";i:623;s:8:"dd86eeb1";i:624;i:0;i:625;i:2;}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -38,14 +38,14 @@ echo \Random\Engine\PcgOneseq128XslRr64::class, PHP_EOL; try { var_dump(unserialize('O:33:"Random\Engine\PcgOneseq128XslRr64":2:{i:0;a:0:{}i:1;a:2:{i:0;s:15:"c6d571c37c41a8d";i:1;s:16:"345e7e82265d6e27";}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // invalid hex try { var_dump(unserialize('O:33:"Random\Engine\PcgOneseq128XslRr64":2:{i:0;a:0:{}i:1;a:2:{i:0;s:16:"c6d571c37c41a8d1";i:1;s:16:"345e7e82265d6e2g";}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -54,46 +54,46 @@ echo \Random\Engine\Xoshiro256StarStar::class, PHP_EOL; try { var_dump(unserialize('O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:4:{i:0;s:15:"db1c182f1bf60cb";i:1;s:16:"2465f04d36a1c797";i:2;s:16:"da25c09be4fabe33";i:3;s:16:"33a0d052f241624e";}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // invalid hex try { var_dump(unserialize('O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:4:{i:0;s:16:"db1c182f1bf60cbb";i:1;s:16:"2465f04d36a1c797";i:2;s:16:"da25c09be4fabe33";i:3;s:16:"33a0d052f241624g";}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // additional array values (1) try { var_dump(unserialize('O:32:"Random\Engine\Xoshiro256StarStar":3:{i:0;a:0:{}i:1;a:4:{i:0;s:16:"db1c182f1bf60cbb";i:1;s:16:"2465f04d36a1c797";i:2;s:16:"da25c09be4fabe33";i:3;s:16:"33a0d052f241624e";}i:2;N;}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // additional array values (2) try { var_dump(unserialize('O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:5:{i:0;s:16:"db1c182f1bf60cbb";i:1;s:16:"2465f04d36a1c797";i:2;s:16:"da25c09be4fabe33";i:3;s:16:"33a0d052f241624e";i:4;N;}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Random\Engine\Mt19937 -Invalid serialization data for Random\Engine\Mt19937 object -Invalid serialization data for Random\Engine\Mt19937 object -Invalid serialization data for Random\Engine\Mt19937 object -Invalid serialization data for Random\Engine\Mt19937 object +Exception: Invalid serialization data for Random\Engine\Mt19937 object +Exception: Invalid serialization data for Random\Engine\Mt19937 object +Exception: Invalid serialization data for Random\Engine\Mt19937 object +Exception: Invalid serialization data for Random\Engine\Mt19937 object Random\Engine\PcgOneseq128XslRr64 -Invalid serialization data for Random\Engine\PcgOneseq128XslRr64 object -Invalid serialization data for Random\Engine\PcgOneseq128XslRr64 object +Exception: Invalid serialization data for Random\Engine\PcgOneseq128XslRr64 object +Exception: Invalid serialization data for Random\Engine\PcgOneseq128XslRr64 object Random\Engine\Xoshiro256StarStar -Invalid serialization data for Random\Engine\Xoshiro256StarStar object -Invalid serialization data for Random\Engine\Xoshiro256StarStar object -Invalid serialization data for Random\Engine\Xoshiro256StarStar object -Invalid serialization data for Random\Engine\Xoshiro256StarStar object +Exception: Invalid serialization data for Random\Engine\Xoshiro256StarStar object +Exception: Invalid serialization data for Random\Engine\Xoshiro256StarStar object +Exception: Invalid serialization data for Random\Engine\Xoshiro256StarStar object +Exception: Invalid serialization data for Random\Engine\Xoshiro256StarStar object diff --git a/ext/random/tests/02_engine/mt19937_error.phpt b/ext/random/tests/02_engine/mt19937_error.phpt index dcbc21aa6bed..adbbe63c27ad 100644 --- a/ext/random/tests/02_engine/mt19937_error.phpt +++ b/ext/random/tests/02_engine/mt19937_error.phpt @@ -8,9 +8,9 @@ use Random\Engine\Mt19937; try { new Mt19937(1234, 2); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Random\Engine\Mt19937::__construct(): Argument #2 ($mode) must be either MT_RAND_MT19937 or MT_RAND_PHP +ValueError: Random\Engine\Mt19937::__construct(): Argument #2 ($mode) must be either MT_RAND_MT19937 or MT_RAND_PHP diff --git a/ext/random/tests/02_engine/pcgoneseq128xslrr64_jump_error.phpt b/ext/random/tests/02_engine/pcgoneseq128xslrr64_jump_error.phpt index cbc6e370b173..e8815d272a89 100644 --- a/ext/random/tests/02_engine/pcgoneseq128xslrr64_jump_error.phpt +++ b/ext/random/tests/02_engine/pcgoneseq128xslrr64_jump_error.phpt @@ -11,7 +11,7 @@ $referenceEngine = new PcgOneseq128XslRr64(1234); try { $engine->jump(-1); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } for ($i = 0; $i < 10_000; $i++) { @@ -24,5 +24,5 @@ die('success'); ?> --EXPECT-- -Random\Engine\PcgOneseq128XslRr64::jump(): Argument #1 ($advance) must be greater than or equal to 0 +ValueError: Random\Engine\PcgOneseq128XslRr64::jump(): Argument #1 ($advance) must be greater than or equal to 0 success diff --git a/ext/random/tests/02_engine/pcgoneseq128xslrr64_seed.phpt b/ext/random/tests/02_engine/pcgoneseq128xslrr64_seed.phpt index b31177fba017..9e790a162fed 100644 --- a/ext/random/tests/02_engine/pcgoneseq128xslrr64_seed.phpt +++ b/ext/random/tests/02_engine/pcgoneseq128xslrr64_seed.phpt @@ -17,7 +17,7 @@ echo "Invalid data type", PHP_EOL; try { $engine = new PcgOneseq128XslRr64(1.0); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -25,7 +25,7 @@ echo "Invalid string seed length", PHP_EOL; try { $engine = new PcgOneseq128XslRr64('foobar'); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -49,11 +49,11 @@ Random string seed Invalid data type -Random\Engine\PcgOneseq128XslRr64::__construct(): Argument #1 ($seed) must be of type string|int|null, float given +TypeError: Random\Engine\PcgOneseq128XslRr64::__construct(): Argument #1 ($seed) must be of type string|int|null, float given Invalid string seed length -Random\Engine\PcgOneseq128XslRr64::__construct(): Argument #1 ($seed) must be a 16 byte (128 bit) string +ValueError: Random\Engine\PcgOneseq128XslRr64::__construct(): Argument #1 ($seed) must be a 16 byte (128 bit) string Valid string seed diff --git a/ext/random/tests/02_engine/xoshiro256starstar_seed.phpt b/ext/random/tests/02_engine/xoshiro256starstar_seed.phpt index ec31c358fd68..ded9a01734d5 100644 --- a/ext/random/tests/02_engine/xoshiro256starstar_seed.phpt +++ b/ext/random/tests/02_engine/xoshiro256starstar_seed.phpt @@ -17,7 +17,7 @@ echo "Invalid data type", PHP_EOL; try { $engine = new Xoshiro256StarStar(1.0); } catch (Throwable $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -25,7 +25,7 @@ echo "Invalid string seed length", PHP_EOL; try { $engine = new Xoshiro256StarStar('foobar'); } catch (Throwable $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -33,7 +33,7 @@ echo "Null seed", PHP_EOL; try { $engine = new Xoshiro256StarStar(str_repeat("\x00", 32)); } catch (Throwable $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL, PHP_EOL; @@ -57,15 +57,15 @@ Random string seed Invalid data type -Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must be of type string|int|null, float given +TypeError: Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must be of type string|int|null, float given Invalid string seed length -Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must be a 32 byte (256 bit) string +ValueError: Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must be a 32 byte (256 bit) string Null seed -Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must not consist entirely of NUL bytes +ValueError: Random\Engine\Xoshiro256StarStar::__construct(): Argument #1 ($seed) must not consist entirely of NUL bytes Valid string seed diff --git a/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt b/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt index 6ebcd03e8570..22e7ccc737f7 100644 --- a/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt +++ b/ext/random/tests/02_engine/xoshiro256starstar_unserialize_zero_state.phpt @@ -6,9 +6,9 @@ GH-21731: Xoshiro256StarStar::__unserialize() must reject the all-zero state try { var_dump(unserialize('O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:4:{i:0;s:16:"0000000000000000";i:1;s:16:"0000000000000000";i:2;s:16:"0000000000000000";i:3;s:16:"0000000000000000";}}')); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Invalid serialization data for Random\Engine\Xoshiro256StarStar object +Exception: Invalid serialization data for Random\Engine\Xoshiro256StarStar object diff --git a/ext/random/tests/03_randomizer/construct_twice.phpt b/ext/random/tests/03_randomizer/construct_twice.phpt index 7128338ade97..ae06a09a403e 100644 --- a/ext/random/tests/03_randomizer/construct_twice.phpt +++ b/ext/random/tests/03_randomizer/construct_twice.phpt @@ -14,28 +14,28 @@ require __DIR__ . "/../engines.inc"; try { (new Randomizer())->__construct(); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $randomizer = new Randomizer(new Xoshiro256StarStar()); $randomizer->__construct(new PcgOneseq128XslRr64()); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $randomizer = new Randomizer(new TestShaEngine("1234")); $randomizer->__construct(new TestShaEngine("1234")); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $randomizer = new Randomizer(new Xoshiro256StarStar()); $randomizer->__construct(new TestShaEngine("1234")); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($randomizer->engine::class); @@ -44,9 +44,9 @@ die('success'); ?> --EXPECT-- -Cannot modify readonly property Random\Randomizer::$engine -Cannot modify readonly property Random\Randomizer::$engine -Cannot modify readonly property Random\Randomizer::$engine -Cannot modify readonly property Random\Randomizer::$engine +Error: Cannot modify readonly property Random\Randomizer::$engine +Error: Cannot modify readonly property Random\Randomizer::$engine +Error: Cannot modify readonly property Random\Randomizer::$engine +Error: Cannot modify readonly property Random\Randomizer::$engine string(32) "Random\Engine\Xoshiro256StarStar" success diff --git a/ext/random/tests/03_randomizer/engine_unsafe_biased.phpt b/ext/random/tests/03_randomizer/engine_unsafe_biased.phpt index 2cfe68a46789..e8d6e69768b2 100644 --- a/ext/random/tests/03_randomizer/engine_unsafe_biased.phpt +++ b/ext/random/tests/03_randomizer/engine_unsafe_biased.phpt @@ -22,65 +22,65 @@ function randomizer(): Randomizer try { var_dump(randomizer()->getInt(0, 1234)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->nextInt()); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bin2hex(randomizer()->getBytes(1))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleArray(range(1, 1234))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 1234), 1)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 1234), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleBytes('foobar')); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString('123', 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString(str_repeat('a', 500), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts int(%d) string(2) "ff" -Failed to generate an acceptable random number in 50 attempts -Failed to generate an acceptable random number in 50 attempts -Failed to generate an acceptable random number in 50 attempts -Failed to generate an acceptable random number in 50 attempts -Failed to generate an acceptable random number in 50 attempts -Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts diff --git a/ext/random/tests/03_randomizer/engine_unsafe_empty_string.phpt b/ext/random/tests/03_randomizer/engine_unsafe_empty_string.phpt index fe402b82b57b..e0ff0a14f52c 100644 --- a/ext/random/tests/03_randomizer/engine_unsafe_empty_string.phpt +++ b/ext/random/tests/03_randomizer/engine_unsafe_empty_string.phpt @@ -23,65 +23,65 @@ function randomizer(): Randomizer try { var_dump(randomizer()->getInt(0, 1234)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->nextInt()); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bin2hex(randomizer()->getBytes(1))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleArray(range(1, 1234))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 1234), 1)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 1234), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleBytes('foobar')); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString('123', 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString(str_repeat('a', 500), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string -A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string +Random\BrokenRandomEngineError: A random engine must return a non-empty string diff --git a/ext/random/tests/03_randomizer/engine_unsafe_nul.phpt b/ext/random/tests/03_randomizer/engine_unsafe_nul.phpt index ff53b83b207a..9f6f1b76bfa6 100644 --- a/ext/random/tests/03_randomizer/engine_unsafe_nul.phpt +++ b/ext/random/tests/03_randomizer/engine_unsafe_nul.phpt @@ -22,55 +22,55 @@ function randomizer(): Randomizer try { var_dump(randomizer()->getInt(0, 1234)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->nextInt()); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(bin2hex(randomizer()->getBytes(1))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleArray(range(1, 123))); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 123), 1)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 123), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->shuffleBytes('foobar')); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString('123', 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString(str_repeat('a', 500), 10)); } catch (Random\BrokenRandomEngineError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -330,7 +330,7 @@ array(1) { [0]=> int(0) } -Failed to generate an acceptable random number in 50 attempts +Random\BrokenRandomEngineError: Failed to generate an acceptable random number in 50 attempts string(6) "oobarf" string(10) "1111111111" string(10) "aaaaaaaaaa" diff --git a/ext/random/tests/03_randomizer/gh_19765_unserialize.phpt b/ext/random/tests/03_randomizer/gh_19765_unserialize.phpt index 24abfca293fc..f875328d6512 100644 --- a/ext/random/tests/03_randomizer/gh_19765_unserialize.phpt +++ b/ext/random/tests/03_randomizer/gh_19765_unserialize.phpt @@ -11,11 +11,11 @@ try { $r = new Randomizer(new Mt19937()); $r->__unserialize([['engine' => new PcgOneseq128XslRr64()]]); } catch (Exception $error) { - echo $error->getMessage() . "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } var_dump($r->engine::class); ?> --EXPECT-- -Invalid serialization data for Random\Randomizer object +Exception: Invalid serialization data for Random\Randomizer object string(21) "Random\Engine\Mt19937" diff --git a/ext/random/tests/03_randomizer/gh_9186_unserialize.phpt b/ext/random/tests/03_randomizer/gh_9186_unserialize.phpt index edadb7380bd1..63036efb545b 100644 --- a/ext/random/tests/03_randomizer/gh_9186_unserialize.phpt +++ b/ext/random/tests/03_randomizer/gh_9186_unserialize.phpt @@ -6,9 +6,9 @@ GH-9186: @strict-properties can be bypassed using unserialization try { unserialize('O:17:"Random\Randomizer":1:{i:0;a:2:{s:3:"foo";N;s:6:"engine";O:32:"Random\Engine\Xoshiro256StarStar":2:{i:0;a:0:{}i:1;a:4:{i:0;s:16:"7520fbc2d6f8de46";i:1;s:16:"84d2d2b9d7ba0a34";i:2;s:16:"d975f36db6490b32";i:3;s:16:"c19991ee16785b94";}}}}'); } catch (Exception $error) { - echo $error->getMessage() . "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } ?> --EXPECT-- -Invalid serialization data for Random\Randomizer object +Exception: Invalid serialization data for Random\Randomizer object diff --git a/ext/random/tests/03_randomizer/methods/getBytesFromString_error.phpt b/ext/random/tests/03_randomizer/methods/getBytesFromString_error.phpt index 29c845353630..05439f3cb384 100644 --- a/ext/random/tests/03_randomizer/methods/getBytesFromString_error.phpt +++ b/ext/random/tests/03_randomizer/methods/getBytesFromString_error.phpt @@ -13,16 +13,16 @@ function randomizer(): Randomizer try { var_dump(randomizer()->getBytesFromString("", 2)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getBytesFromString("abc", 0)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -Random\Randomizer::getBytesFromString(): Argument #1 ($string) must not be empty -Random\Randomizer::getBytesFromString(): Argument #2 ($length) must be greater than 0 +ValueError: Random\Randomizer::getBytesFromString(): Argument #1 ($string) must not be empty +ValueError: Random\Randomizer::getBytesFromString(): Argument #2 ($length) must be greater than 0 diff --git a/ext/random/tests/03_randomizer/methods/getFloat_error.phpt b/ext/random/tests/03_randomizer/methods/getFloat_error.phpt index 42e933cbefb2..68bfd262e38b 100644 --- a/ext/random/tests/03_randomizer/methods/getFloat_error.phpt +++ b/ext/random/tests/03_randomizer/methods/getFloat_error.phpt @@ -22,109 +22,109 @@ foreach ([ try { var_dump(randomizer()->getFloat(NAN, 0.0, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(INF, 0.0, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(-INF, 0.0, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(0.0, NAN, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(0.0, INF, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(0.0, -INF, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(0.0, -0.1, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->getFloat(0.0, 0.0, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // Both values round to the same float. var_dump(randomizer()->getFloat(100_000_000_000_000_000.0, 100_000_000_000_000_000.1, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // There is no float between the two parameters, thus making the OpenOpen interval empty. var_dump(randomizer()->getFloat(1.0, 1 + PHP_FLOAT_EPSILON, $boundary)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECTF-- ClosedClosed -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than or equal to argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than or equal to argument #1 ($min) float(0) float(1.0E+17) float(%f) ClosedOpen -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) float(1) OpenClosed -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) float(1.0000000000000002) OpenOpen -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #1 ($min) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be finite -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) -The given interval is empty, there are no floats between argument #1 ($min) and argument #2 ($max) +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #1 ($min) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be finite +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: Random\Randomizer::getFloat(): Argument #2 ($max) must be greater than argument #1 ($min) +ValueError: The given interval is empty, there are no floats between argument #1 ($min) and argument #2 ($max) diff --git a/ext/random/tests/03_randomizer/methods/pickArrayKeys_error.phpt b/ext/random/tests/03_randomizer/methods/pickArrayKeys_error.phpt index cbd0495676c1..1d058813276e 100644 --- a/ext/random/tests/03_randomizer/methods/pickArrayKeys_error.phpt +++ b/ext/random/tests/03_randomizer/methods/pickArrayKeys_error.phpt @@ -13,37 +13,37 @@ function randomizer(): Randomizer try { var_dump(randomizer()->pickArrayKeys("foo", 2)); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys([], 0)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 3), 0)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 3), -1)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(randomizer()->pickArrayKeys(range(1, 3), 10)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -Random\Randomizer::pickArrayKeys(): Argument #1 ($array) must be of type array, string given -Random\Randomizer::pickArrayKeys(): Argument #1 ($array) must not be empty -Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +TypeError: Random\Randomizer::pickArrayKeys(): Argument #1 ($array) must be of type array, string given +ValueError: Random\Randomizer::pickArrayKeys(): Argument #1 ($array) must not be empty +ValueError: Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: Random\Randomizer::pickArrayKeys(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) diff --git a/ext/random/tests/03_randomizer/readonly.phpt b/ext/random/tests/03_randomizer/readonly.phpt index f5cf7cc0dd5b..a8eb299b48fd 100644 --- a/ext/random/tests/03_randomizer/readonly.phpt +++ b/ext/random/tests/03_randomizer/readonly.phpt @@ -13,7 +13,7 @@ $referenceRandomizer = new Randomizer(new PcgOneseq128XslRr64(1234)); try { $randomizer->engine = new Xoshiro256StarStar(1234); } catch (Throwable $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } for ($i = 0; $i < 10_000; $i++) { @@ -26,5 +26,5 @@ die('success'); ?> --EXPECT-- -Cannot modify readonly property Random\Randomizer::$engine +Error: Cannot modify readonly property Random\Randomizer::$engine success diff --git a/ext/random/tests/03_randomizer/serialize_disallowed.phpt b/ext/random/tests/03_randomizer/serialize_disallowed.phpt index 06f8ea2cb09a..58ecd8f41da7 100644 --- a/ext/random/tests/03_randomizer/serialize_disallowed.phpt +++ b/ext/random/tests/03_randomizer/serialize_disallowed.phpt @@ -9,9 +9,9 @@ use Random\Randomizer; try { serialize(new Randomizer(new Secure())); } catch (Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Serialization of 'Random\Engine\Secure' is not allowed +Exception: Serialization of 'Random\Engine\Secure' is not allowed diff --git a/ext/readline/tests/readline_callback_handler_install_001.phpt b/ext/readline/tests/readline_callback_handler_install_001.phpt index 543a57e657ef..d6602403ae05 100644 --- a/ext/readline/tests/readline_callback_handler_install_001.phpt +++ b/ext/readline/tests/readline_callback_handler_install_001.phpt @@ -17,10 +17,10 @@ var_dump(readline_callback_handler_install('testing: ', 'foo')); try { var_dump(readline_callback_handler_install('testing: ', 'foobar!')); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- testing: bool(true) -readline_callback_handler_install(): Argument #2 ($callback) must be a valid callback, function "foobar!" not found or invalid function name +TypeError: readline_callback_handler_install(): Argument #2 ($callback) must be a valid callback, function "foobar!" not found or invalid function name diff --git a/ext/readline/tests/readline_completion_function_001.phpt b/ext/readline/tests/readline_completion_function_001.phpt index a1d16a6774fc..31d502b7ec72 100644 --- a/ext/readline/tests/readline_completion_function_001.phpt +++ b/ext/readline/tests/readline_completion_function_001.phpt @@ -18,7 +18,7 @@ foreach ($data as $callback) { try { var_dump(readline_completion_function($callback)); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -26,5 +26,5 @@ foreach ($data as $callback) { --EXPECT-- bool(true) bool(true) -readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given -readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given +TypeError: readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given +TypeError: readline_completion_function(): Argument #1 ($callback) must be a valid callback, no array or string given diff --git a/ext/reflection/tests/002.phpt b/ext/reflection/tests/002.phpt index 5e35859c7cee..4fb517b6ba8f 100644 --- a/ext/reflection/tests/002.phpt +++ b/ext/reflection/tests/002.phpt @@ -28,7 +28,7 @@ try } catch(ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -36,7 +36,7 @@ $r->name = 'bullshit'; } catch(ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $r->foo = 'bar'; @@ -54,8 +54,8 @@ string(26) "ReflectionFunctionAbstract" string(7) "getName" string(3) "xyz" NULL -Cannot set read-only property ReflectionMethodEx::$class -Cannot set read-only property ReflectionMethodEx::$name +ReflectionException: Cannot set read-only property ReflectionMethodEx::$class +ReflectionException: Cannot set read-only property ReflectionMethodEx::$name string(26) "ReflectionFunctionAbstract" string(7) "getName" string(3) "bar" diff --git a/ext/reflection/tests/004.phpt b/ext/reflection/tests/004.phpt index 3739d2e55c94..9ae9649d1d92 100644 --- a/ext/reflection/tests/004.phpt +++ b/ext/reflection/tests/004.phpt @@ -18,24 +18,24 @@ $m=$a->getMethod("__construct"); try { $m->invoke(null); } catch (ReflectionException $E) { - echo $E->getMessage()."\n"; + echo $E::class, ': ', $E->getMessage(), "\n"; } try { $m->invoke($b); } catch (ReflectionException $E) { - echo $E->getMessage()."\n"; + echo $E::class, ': ', $E->getMessage(), "\n"; } $b = new a(); try { $m->invoke($b); } catch (ReflectionException $E) { - echo $E->getMessage()."\n"; + echo $E::class, ': ', $E->getMessage(), "\n"; } ?> --EXPECT-- -Trying to invoke non static method a::__construct() without an object -Given object is not an instance of the class this method was declared in +ReflectionException: Trying to invoke non static method a::__construct() without an object +ReflectionException: Given object is not an instance of the class this method was declared in diff --git a/ext/reflection/tests/007.phpt b/ext/reflection/tests/007.phpt index 8e90f7a010a9..d5c9cfbbe4f3 100644 --- a/ext/reflection/tests/007.phpt +++ b/ext/reflection/tests/007.phpt @@ -12,7 +12,7 @@ function test($class) } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; return; // only here } @@ -23,11 +23,11 @@ function test($class) } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "====>newInstance(25)\n"; @@ -37,7 +37,7 @@ function test($class) } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "====>newInstance(25, 42)\n"; @@ -47,7 +47,7 @@ function test($class) } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; @@ -91,15 +91,15 @@ test('WithCtorWithArgs'); --EXPECTF-- ====>Class_does_not_exist {closure:%s:%d}(Class_does_not_exist) -string(43) "Class "Class_does_not_exist" does not exist" +ReflectionException: Class "Class_does_not_exist" does not exist ====>NoCtor ====>newInstance() object(NoCtor)#%d (0) { } ====>newInstance(25) -string(86) "Class NoCtor does not have a constructor, so you cannot pass any constructor arguments" +ReflectionException: Class NoCtor does not have a constructor, so you cannot pass any constructor arguments ====>newInstance(25, 42) -string(86) "Class NoCtor does not have a constructor, so you cannot pass any constructor arguments" +ReflectionException: Class NoCtor does not have a constructor, so you cannot pass any constructor arguments ====>WithCtor ====>newInstance() @@ -129,7 +129,7 @@ object(WithCtor)#%d (0) { ====>WithCtorWithArgs ====>newInstance() -Exception: Too few arguments to function WithCtorWithArgs::__construct(), 0 passed and exactly 1 expected +ArgumentCountError: Too few arguments to function WithCtorWithArgs::__construct(), 0 passed and exactly 1 expected ====>newInstance(25) WithCtorWithArgs::__construct(25) array(1) { diff --git a/ext/reflection/tests/008.phpt b/ext/reflection/tests/008.phpt index 64866bbe6993..aa65a2b28bca 100644 --- a/ext/reflection/tests/008.phpt +++ b/ext/reflection/tests/008.phpt @@ -9,13 +9,13 @@ foreach ($a as $val) { try { new ReflectionMethod($val); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ReflectionMethod::createFromMethodName($val); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -26,7 +26,7 @@ foreach ($a as $key=>$val) { try { new ReflectionMethod($val, $b[$key]); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -34,29 +34,29 @@ echo "Done\n"; ?> --EXPECTF-- Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(90) "ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be a valid method name" -string(91) "ReflectionMethod::createFromMethodName(): Argument #1 ($method) must be a valid method name" +ReflectionException: ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be a valid method name +ReflectionException: ReflectionMethod::createFromMethodName(): Argument #1 ($method) must be a valid method name Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(90) "ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be a valid method name" -string(91) "ReflectionMethod::createFromMethodName(): Argument #1 ($method) must be a valid method name" +ReflectionException: ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be a valid method name +ReflectionException: ReflectionMethod::createFromMethodName(): Argument #1 ($method) must be a valid method name Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(23) "Class "" does not exist" -string(23) "Class "" does not exist" +ReflectionException: Class "" does not exist +ReflectionException: Class "" does not exist Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(24) "Class "a" does not exist" -string(24) "Class "a" does not exist" +ReflectionException: Class "a" does not exist +ReflectionException: Class "a" does not exist Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(23) "Class "" does not exist" -string(23) "Class "" does not exist" +ReflectionException: Class "" does not exist +ReflectionException: Class "" does not exist Deprecated: Calling ReflectionMethod::__construct() with 1 argument is deprecated, use ReflectionMethod::createFromMethodName() instead in %s on line %d -string(24) "Class "a" does not exist" -string(24) "Class "a" does not exist" -string(23) "Class "" does not exist" -string(24) "Class "1" does not exist" -string(23) "Class "" does not exist" +ReflectionException: Class "a" does not exist +ReflectionException: Class "a" does not exist +ReflectionException: Class "" does not exist +ReflectionException: Class "1" does not exist +ReflectionException: Class "" does not exist Done diff --git a/ext/reflection/tests/027.phpt b/ext/reflection/tests/027.phpt index 40153791ad34..c5e1b718b466 100644 --- a/ext/reflection/tests/027.phpt +++ b/ext/reflection/tests/027.phpt @@ -15,8 +15,8 @@ $g->next(); try { $r->getTrace(); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot fetch information from a closed Generator +ReflectionException: Cannot fetch information from a closed Generator diff --git a/ext/reflection/tests/ReflectionAttribute_constructor_001.phpt b/ext/reflection/tests/ReflectionAttribute_constructor_001.phpt index ad895dc42437..6beb529407b9 100644 --- a/ext/reflection/tests/ReflectionAttribute_constructor_001.phpt +++ b/ext/reflection/tests/ReflectionAttribute_constructor_001.phpt @@ -18,8 +18,8 @@ $rm = new ReflectionMethod($attribute, "__construct"); try { var_dump($rm->invoke($attribute, 0, 1, 2)); } catch (ReflectionException $exception) { - echo $exception->getMessage(); + echo $exception::class, ': ', $exception->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot directly instantiate ReflectionAttribute +ReflectionException: Cannot directly instantiate ReflectionAttribute diff --git a/ext/reflection/tests/ReflectionClassConstant_getValue_typed.phpt b/ext/reflection/tests/ReflectionClassConstant_getValue_typed.phpt index f964f4c146fb..935f21250b9d 100644 --- a/ext/reflection/tests/ReflectionClassConstant_getValue_typed.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_getValue_typed.phpt @@ -21,13 +21,13 @@ $rc = new ReflectionClassConstant(B::class, 'CONST1'); try { $rc->getValue(); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $rc; } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -35,5 +35,5 @@ try { object(stdClass)#1 (0) { } Constant [ public object CONST1 ] { Object } -Cannot assign stdClass to class constant B::CONST1 of type array -Cannot assign stdClass to class constant B::CONST1 of type array +TypeError: Cannot assign stdClass to class constant B::CONST1 of type array +TypeError: Cannot assign stdClass to class constant B::CONST1 of type array diff --git a/ext/reflection/tests/ReflectionClassConstant_toString_error.phpt b/ext/reflection/tests/ReflectionClassConstant_toString_error.phpt index 54290e97aa30..8bdcada93e59 100644 --- a/ext/reflection/tests/ReflectionClassConstant_toString_error.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_toString_error.phpt @@ -10,9 +10,9 @@ class B { try { echo new ReflectionClassConstant('B', 'X'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant self::UNKNOWN +Error: Undefined constant self::UNKNOWN diff --git a/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt b/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt index a571f4a47766..e1e81e1cbac2 100644 --- a/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt +++ b/ext/reflection/tests/ReflectionClassConstant_unset_name.phpt @@ -14,15 +14,15 @@ unset($rc->name); try { var_dump($rc->getName()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo $rc, "\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Typed property ReflectionClassConstant::$name must not be accessed before initialization -Typed property ReflectionClassConstant::$name must not be accessed before initialization +Error: Typed property ReflectionClassConstant::$name must not be accessed before initialization +Error: Typed property ReflectionClassConstant::$name must not be accessed before initialization diff --git a/ext/reflection/tests/ReflectionClass_CannotClone_basic.phpt b/ext/reflection/tests/ReflectionClass_CannotClone_basic.phpt index 64d884d6ae02..9c0b48f7d0d6 100644 --- a/ext/reflection/tests/ReflectionClass_CannotClone_basic.phpt +++ b/ext/reflection/tests/ReflectionClass_CannotClone_basic.phpt @@ -9,7 +9,7 @@ $rc = new ReflectionClass("stdClass"); try { $rc2 = clone($rc); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/reflection/tests/ReflectionClass_constructor_002.phpt b/ext/reflection/tests/ReflectionClass_constructor_002.phpt index adb378434737..ee8f3e4c2a16 100644 --- a/ext/reflection/tests/ReflectionClass_constructor_002.phpt +++ b/ext/reflection/tests/ReflectionClass_constructor_002.phpt @@ -5,53 +5,53 @@ ReflectionClass::__constructor() - bad arguments try { var_dump(new ReflectionClass()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass(null)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass(true)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass(1)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass(array(1,2,3))); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass("stdClass", 1)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionClass("X")); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -ReflectionClass::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::__construct() expects exactly 1 argument, 0 given Deprecated: ReflectionClass::__construct(): Passing null to parameter #1 ($objectOrClass) of type object|string is deprecated in %s on line %d -Class "" does not exist -Class "1" does not exist -Class "1" does not exist -ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given -ReflectionClass::__construct() expects exactly 1 argument, 2 given -Class "X" does not exist +ReflectionException: Class "" does not exist +ReflectionException: Class "1" does not exist +ReflectionException: Class "1" does not exist +TypeError: ReflectionClass::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given +ArgumentCountError: ReflectionClass::__construct() expects exactly 1 argument, 2 given +ReflectionException: Class "X" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getConstant_typed.phpt b/ext/reflection/tests/ReflectionClass_getConstant_typed.phpt index c63eaab5d902..cc03f44aa2fd 100644 --- a/ext/reflection/tests/ReflectionClass_getConstant_typed.phpt +++ b/ext/reflection/tests/ReflectionClass_getConstant_typed.phpt @@ -19,11 +19,11 @@ $rc = new ReflectionClass(D::class); try { $rc->getConstant("CONST1"); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- object(stdClass)#1 (0) { } -Cannot assign stdClass to class constant D::CONST1 of type array +TypeError: Cannot assign stdClass to class constant D::CONST1 of type array diff --git a/ext/reflection/tests/ReflectionClass_getMethod_001.phpt b/ext/reflection/tests/ReflectionClass_getMethod_001.phpt index 4e89466af021..4fea3c759a4f 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_001.phpt @@ -41,7 +41,7 @@ foreach($classes as $class) { try { var_dump($rc->getMethod("doesNotExist")); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> @@ -65,7 +65,7 @@ Reflecting on class pubf: ["class"]=> string(4) "pubf" } - --> Check for doesNotExist(): Method pubf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method pubf::doesNotExist() does not exist Reflecting on class subpubf: --> Check for f(): object(ReflectionMethod)#%d (2) { ["name"]=> @@ -85,7 +85,7 @@ Reflecting on class subpubf: ["class"]=> string(4) "pubf" } - --> Check for doesNotExist(): Method subpubf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method subpubf::doesNotExist() does not exist Reflecting on class protf: --> Check for f(): object(ReflectionMethod)#%d (2) { ["name"]=> @@ -105,7 +105,7 @@ Reflecting on class protf: ["class"]=> string(5) "protf" } - --> Check for doesNotExist(): Method protf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method protf::doesNotExist() does not exist Reflecting on class subprotf: --> Check for f(): object(ReflectionMethod)#%d (2) { ["name"]=> @@ -125,7 +125,7 @@ Reflecting on class subprotf: ["class"]=> string(5) "protf" } - --> Check for doesNotExist(): Method subprotf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method subprotf::doesNotExist() does not exist Reflecting on class privf: --> Check for f(): object(ReflectionMethod)#%d (2) { ["name"]=> @@ -145,7 +145,7 @@ Reflecting on class privf: ["class"]=> string(5) "privf" } - --> Check for doesNotExist(): Method privf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method privf::doesNotExist() does not exist Reflecting on class subprivf: --> Check for f(): object(ReflectionMethod)#%d (2) { ["name"]=> @@ -165,4 +165,4 @@ Reflecting on class subprivf: ["class"]=> string(5) "privf" } - --> Check for doesNotExist(): Method subprivf::doesNotExist() does not exist + --> Check for doesNotExist(): ReflectionException: Method subprivf::doesNotExist() does not exist diff --git a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt index 9278b4787544..9420acf36272 100644 --- a/ext/reflection/tests/ReflectionClass_getMethod_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getMethod_002.phpt @@ -14,55 +14,55 @@ echo "Check invalid params:\n"; try { var_dump($rc->getMethod()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod("f", "f")); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(null)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(1)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(1.5)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(true)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(array(1,2,3))); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getMethod(new C)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Check invalid params: -ReflectionClass::getMethod() expects exactly 1 argument, 0 given -ReflectionClass::getMethod() expects exactly 1 argument, 2 given +ArgumentCountError: ReflectionClass::getMethod() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::getMethod() expects exactly 1 argument, 2 given Deprecated: ReflectionClass::getMethod(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d -Method C::() does not exist -Method C::1() does not exist -Method C::1.5() does not exist -Method C::1() does not exist -ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, C given +ReflectionException: Method C::() does not exist +ReflectionException: Method C::1() does not exist +ReflectionException: Method C::1.5() does not exist +ReflectionException: Method C::1() does not exist +TypeError: ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, array given +TypeError: ReflectionClass::getMethod(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionClass_getProperty_001.phpt b/ext/reflection/tests/ReflectionClass_getProperty_001.phpt index e2e6e3ba3cbe..345b2ec6b27b 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_001.phpt @@ -35,25 +35,25 @@ foreach($classes as $class) { echo " --> Check for s: "; var_dump($rc->getProperty("s")); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo " --> Check for a: "; var_dump($rc->getProperty("a")); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo " --> Check for A: "; var_dump($rc->getProperty("A")); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo " --> Check for doesNotExist: "; var_dump($rc->getProperty("doesNotExist")); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -72,8 +72,8 @@ Reflecting on class pubf: ["class"]=> string(4) "pubf" } - --> Check for A: Property pubf::$A does not exist - --> Check for doesNotExist: Property pubf::$doesNotExist does not exist + --> Check for A: ReflectionException: Property pubf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property pubf::$doesNotExist does not exist Reflecting on class subpubf: --> Check for s: object(ReflectionProperty)#%d (2) { ["name"]=> @@ -87,8 +87,8 @@ Reflecting on class subpubf: ["class"]=> string(4) "pubf" } - --> Check for A: Property subpubf::$A does not exist - --> Check for doesNotExist: Property subpubf::$doesNotExist does not exist + --> Check for A: ReflectionException: Property subpubf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property subpubf::$doesNotExist does not exist Reflecting on class protf: --> Check for s: object(ReflectionProperty)#%d (2) { ["name"]=> @@ -102,8 +102,8 @@ Reflecting on class protf: ["class"]=> string(5) "protf" } - --> Check for A: Property protf::$A does not exist - --> Check for doesNotExist: Property protf::$doesNotExist does not exist + --> Check for A: ReflectionException: Property protf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property protf::$doesNotExist does not exist Reflecting on class subprotf: --> Check for s: object(ReflectionProperty)#%d (2) { ["name"]=> @@ -117,8 +117,8 @@ Reflecting on class subprotf: ["class"]=> string(5) "protf" } - --> Check for A: Property subprotf::$A does not exist - --> Check for doesNotExist: Property subprotf::$doesNotExist does not exist + --> Check for A: ReflectionException: Property subprotf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property subprotf::$doesNotExist does not exist Reflecting on class privf: --> Check for s: object(ReflectionProperty)#%d (2) { ["name"]=> @@ -132,8 +132,8 @@ Reflecting on class privf: ["class"]=> string(5) "privf" } - --> Check for A: Property privf::$A does not exist - --> Check for doesNotExist: Property privf::$doesNotExist does not exist + --> Check for A: ReflectionException: Property privf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property privf::$doesNotExist does not exist Reflecting on class subprivf: --> Check for s: object(ReflectionProperty)#%d (2) { ["name"]=> @@ -141,6 +141,6 @@ Reflecting on class subprivf: ["class"]=> string(5) "privf" } - --> Check for a: Property subprivf::$a does not exist - --> Check for A: Property subprivf::$A does not exist - --> Check for doesNotExist: Property subprivf::$doesNotExist does not exist + --> Check for a: ReflectionException: Property subprivf::$a does not exist + --> Check for A: ReflectionException: Property subprivf::$A does not exist + --> Check for doesNotExist: ReflectionException: Property subprivf::$doesNotExist does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt index c2f8419a1ea7..3fa357332992 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_002.phpt @@ -14,53 +14,53 @@ echo "Check invalid params:\n"; try { var_dump($rc->getProperty()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty("a", "a")); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(null)); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(1)); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(1.5)); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(true)); } catch (exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(array(1,2,3))); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getProperty(new C)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Check invalid params: -ReflectionClass::getProperty() expects exactly 1 argument, 0 given -ReflectionClass::getProperty() expects exactly 1 argument, 2 given +ArgumentCountError: ReflectionClass::getProperty() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::getProperty() expects exactly 1 argument, 2 given Deprecated: ReflectionClass::getProperty(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d -Property C::$ does not exist -Property C::$1 does not exist -Property C::$1.5 does not exist -Property C::$1 does not exist -ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, array given -ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, C given +ReflectionException: Property C::$ does not exist +ReflectionException: Property C::$1 does not exist +ReflectionException: Property C::$1.5 does not exist +ReflectionException: Property C::$1 does not exist +TypeError: ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, array given +TypeError: ReflectionClass::getProperty(): Argument #1 ($name) must be of type string, C given diff --git a/ext/reflection/tests/ReflectionClass_getProperty_003.phpt b/ext/reflection/tests/ReflectionClass_getProperty_003.phpt index 8be2f4bf85b6..a3f33f925466 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_003.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_003.phpt @@ -46,7 +46,7 @@ function showInfo($name) { try { $rp = $rc->getProperty($name); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; return; } @@ -108,7 +108,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "protA in A" --- (Reflecting on privA) --- -Property C::$privA does not exist +ReflectionException: Property C::$privA does not exist --- (Reflecting on pubB) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -126,7 +126,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "protB in B" --- (Reflecting on privB) --- -Property C::$privB does not exist +ReflectionException: Property C::$privB does not exist --- (Reflecting on pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -152,7 +152,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "privC in C" --- (Reflecting on doesNotExist) --- -Property C::$doesNotExist does not exist +ReflectionException: Property C::$doesNotExist does not exist --- (Reflecting on A::pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -210,7 +210,7 @@ object(ReflectionProperty)#%d (2) { } string(9) "pubC in C" --- (Reflecting on c::PUBC) --- -Property C::$PUBC does not exist +ReflectionException: Property C::$PUBC does not exist --- (Reflecting on C::pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -236,12 +236,12 @@ object(ReflectionProperty)#%d (2) { } string(10) "privC in C" --- (Reflecting on X::pubC) --- -Fully qualified property name X::$pubC does not specify a base class of C +ReflectionException: Fully qualified property name X::$pubC does not specify a base class of C --- (Reflecting on X::protC) --- -Fully qualified property name X::$protC does not specify a base class of C +ReflectionException: Fully qualified property name X::$protC does not specify a base class of C --- (Reflecting on X::privC) --- -Fully qualified property name X::$privC does not specify a base class of C +ReflectionException: Fully qualified property name X::$privC does not specify a base class of C --- (Reflecting on X::doesNotExist) --- -Fully qualified property name X::$doesNotExist does not specify a base class of C +ReflectionException: Fully qualified property name X::$doesNotExist does not specify a base class of C --- (Reflecting on doesNotexist::doesNotExist) --- -Class "doesNotexist" does not exist +ReflectionException: Class "doesNotexist" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getProperty_004.phpt b/ext/reflection/tests/ReflectionClass_getProperty_004.phpt index 6a4f44ee5977..48a68ba67015 100644 --- a/ext/reflection/tests/ReflectionClass_getProperty_004.phpt +++ b/ext/reflection/tests/ReflectionClass_getProperty_004.phpt @@ -46,14 +46,14 @@ function showInfo($name) { try { $rp = $rc->getProperty($name); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; return; } try { var_dump($rp); var_dump($rp->getValue($myC)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; return; } } @@ -112,7 +112,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "protA in A" --- (Reflecting on privA) --- -Property C::$privA does not exist +ReflectionException: Property C::$privA does not exist --- (Reflecting on pubB) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -130,7 +130,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "protB in B" --- (Reflecting on privB) --- -Property C::$privB does not exist +ReflectionException: Property C::$privB does not exist --- (Reflecting on pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -156,7 +156,7 @@ object(ReflectionProperty)#%d (2) { } string(10) "privC in C" --- (Reflecting on doesNotExist) --- -Property C::$doesNotExist does not exist +ReflectionException: Property C::$doesNotExist does not exist --- (Reflecting on A::pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -214,7 +214,7 @@ object(ReflectionProperty)#%d (2) { } string(9) "pubC in C" --- (Reflecting on c::PUBC) --- -Property C::$PUBC does not exist +ReflectionException: Property C::$PUBC does not exist --- (Reflecting on C::pubC) --- object(ReflectionProperty)#%d (2) { ["name"]=> @@ -240,12 +240,12 @@ object(ReflectionProperty)#%d (2) { } string(10) "privC in C" --- (Reflecting on X::pubC) --- -Fully qualified property name X::$pubC does not specify a base class of C +ReflectionException: Fully qualified property name X::$pubC does not specify a base class of C --- (Reflecting on X::protC) --- -Fully qualified property name X::$protC does not specify a base class of C +ReflectionException: Fully qualified property name X::$protC does not specify a base class of C --- (Reflecting on X::privC) --- -Fully qualified property name X::$privC does not specify a base class of C +ReflectionException: Fully qualified property name X::$privC does not specify a base class of C --- (Reflecting on X::doesNotExist) --- -Fully qualified property name X::$doesNotExist does not specify a base class of C +ReflectionException: Fully qualified property name X::$doesNotExist does not specify a base class of C --- (Reflecting on doesNotexist::doesNotExist) --- -Class "doesNotexist" does not exist +ReflectionException: Class "doesNotexist" does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt index e4546bdb78fb..7d8932d2e07b 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_001.phpt @@ -36,14 +36,14 @@ try { var_dump($rcA->getStaticPropertyValue("protectedDoesNotExist")); echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rcA->getStaticPropertyValue("privateDoesNotExist")); echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -61,5 +61,5 @@ string(17) "changed protected" string(14) "changed public" Retrieving non-existent values from A with no default value: -Property A::$protectedDoesNotExist does not exist -Property A::$privateDoesNotExist does not exist +ReflectionException: Property A::$protectedDoesNotExist does not exist +ReflectionException: Property A::$privateDoesNotExist does not exist diff --git a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt index 2b6fda059084..a07663458c87 100644 --- a/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_getStaticPropertyValue_002.phpt @@ -13,36 +13,36 @@ $rc = new ReflectionClass('C'); try { var_dump($rc->getStaticPropertyValue("x", "default value", 'blah')); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getStaticPropertyValue()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getStaticPropertyValue(null)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getStaticPropertyValue(1.5, 'def')); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->getStaticPropertyValue(array(1,2,3))); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given -ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given +ArgumentCountError: ReflectionClass::getStaticPropertyValue() expects at most 2 arguments, 3 given +ArgumentCountError: ReflectionClass::getStaticPropertyValue() expects at least 1 argument, 0 given Deprecated: ReflectionClass::getStaticPropertyValue(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d -Property C::$ does not exist +ReflectionException: Property C::$ does not exist string(3) "def" -ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given +TypeError: ReflectionClass::getStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt index 7af12f07b701..66805f6700d2 100644 --- a/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt +++ b/ext/reflection/tests/ReflectionClass_implementsInterface_001.phpt @@ -25,13 +25,13 @@ foreach ($rcs as $childName => $child) { try { var_dump($child->implementsInterface($parent)); } catch (Exception|TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo " - Using string argument: "; try { var_dump($child->implementsInterface($parentName)); } catch (Exception|TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -42,39 +42,39 @@ echo "\n\nTest bad arguments:\n"; try { $rcs['A']->implementsInterface(); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcs['A']->implementsInterface('C', 'C'); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcs['A']->implementsInterface(null); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcs['A']->implementsInterface('ThisClassDoesNotExist'); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcs['A']->implementsInterface(2); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Does A implement A? - - Using object argument: A is not an interface - - Using string argument: A is not an interface + - Using object argument: ReflectionException: A is not an interface + - Using string argument: ReflectionException: A is not an interface Does A implement B? - - Using object argument: B is not an interface - - Using string argument: B is not an interface + - Using object argument: ReflectionException: B is not an interface + - Using string argument: ReflectionException: B is not an interface Does A implement C? - - Using object argument: C is not an interface - - Using string argument: C is not an interface + - Using object argument: ReflectionException: C is not an interface + - Using string argument: ReflectionException: C is not an interface Does A implement I1? - Using object argument: bool(true) - Using string argument: bool(true) @@ -82,14 +82,14 @@ Does A implement I2? - Using object argument: bool(false) - Using string argument: bool(false) Does B implement A? - - Using object argument: A is not an interface - - Using string argument: A is not an interface + - Using object argument: ReflectionException: A is not an interface + - Using string argument: ReflectionException: A is not an interface Does B implement B? - - Using object argument: B is not an interface - - Using string argument: B is not an interface + - Using object argument: ReflectionException: B is not an interface + - Using string argument: ReflectionException: B is not an interface Does B implement C? - - Using object argument: C is not an interface - - Using string argument: C is not an interface + - Using object argument: ReflectionException: C is not an interface + - Using string argument: ReflectionException: C is not an interface Does B implement I1? - Using object argument: bool(true) - Using string argument: bool(true) @@ -97,14 +97,14 @@ Does B implement I2? - Using object argument: bool(false) - Using string argument: bool(false) Does C implement A? - - Using object argument: A is not an interface - - Using string argument: A is not an interface + - Using object argument: ReflectionException: A is not an interface + - Using string argument: ReflectionException: A is not an interface Does C implement B? - - Using object argument: B is not an interface - - Using string argument: B is not an interface + - Using object argument: ReflectionException: B is not an interface + - Using string argument: ReflectionException: B is not an interface Does C implement C? - - Using object argument: C is not an interface - - Using string argument: C is not an interface + - Using object argument: ReflectionException: C is not an interface + - Using string argument: ReflectionException: C is not an interface Does C implement I1? - Using object argument: bool(true) - Using string argument: bool(true) @@ -112,14 +112,14 @@ Does C implement I2? - Using object argument: bool(true) - Using string argument: bool(true) Does I1 implement A? - - Using object argument: A is not an interface - - Using string argument: A is not an interface + - Using object argument: ReflectionException: A is not an interface + - Using string argument: ReflectionException: A is not an interface Does I1 implement B? - - Using object argument: B is not an interface - - Using string argument: B is not an interface + - Using object argument: ReflectionException: B is not an interface + - Using string argument: ReflectionException: B is not an interface Does I1 implement C? - - Using object argument: C is not an interface - - Using string argument: C is not an interface + - Using object argument: ReflectionException: C is not an interface + - Using string argument: ReflectionException: C is not an interface Does I1 implement I1? - Using object argument: bool(true) - Using string argument: bool(true) @@ -127,14 +127,14 @@ Does I1 implement I2? - Using object argument: bool(false) - Using string argument: bool(false) Does I2 implement A? - - Using object argument: A is not an interface - - Using string argument: A is not an interface + - Using object argument: ReflectionException: A is not an interface + - Using string argument: ReflectionException: A is not an interface Does I2 implement B? - - Using object argument: B is not an interface - - Using string argument: B is not an interface + - Using object argument: ReflectionException: B is not an interface + - Using string argument: ReflectionException: B is not an interface Does I2 implement C? - - Using object argument: C is not an interface - - Using string argument: C is not an interface + - Using object argument: ReflectionException: C is not an interface + - Using string argument: ReflectionException: C is not an interface Does I2 implement I1? - Using object argument: bool(true) - Using string argument: bool(true) @@ -144,10 +144,10 @@ Does I2 implement I2? Test bad arguments: -ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given -ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given +ArgumentCountError: ReflectionClass::implementsInterface() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::implementsInterface() expects exactly 1 argument, 2 given Deprecated: ReflectionClass::implementsInterface(): Passing null to parameter #1 ($interface) of type ReflectionClass|string is deprecated in %s on line %d -Interface "" does not exist -Interface "ThisClassDoesNotExist" does not exist -Interface "2" does not exist +ReflectionException: Interface "" does not exist +ReflectionException: Interface "ThisClassDoesNotExist" does not exist +ReflectionException: Interface "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_isCloneable_001.phpt b/ext/reflection/tests/ReflectionClass_isCloneable_001.phpt index bde3a60a1e7f..0852df160416 100644 --- a/ext/reflection/tests/ReflectionClass_isCloneable_001.phpt +++ b/ext/reflection/tests/ReflectionClass_isCloneable_001.phpt @@ -52,7 +52,7 @@ var_dump($obj->isCloneable()); try { $h = clone new xmlwriter; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt index db3961b3e649..6bdab55dcb07 100644 --- a/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt +++ b/ext/reflection/tests/ReflectionClass_isSubclassOf_002.phpt @@ -12,35 +12,35 @@ echo "\n\nTest bad arguments:\n"; try { $rc->isSubclassOf(); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rc->isSubclassOf('C', 'C'); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rc->isSubclassOf(null); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rc->isSubclassOf('ThisClassDoesNotExist'); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rc->isSubclassOf(2); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given +ArgumentCountError: ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Deprecated: ReflectionClass::isSubclassOf(): Passing null to parameter #1 ($class) of type ReflectionClass|string is deprecated in %s on line %d -Class "" does not exist -Class "ThisClassDoesNotExist" does not exist -Class "2" does not exist +ReflectionException: Class "" does not exist +ReflectionException: Class "ThisClassDoesNotExist" does not exist +ReflectionException: Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt b/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt index 7dded54d3fae..a1e915590a4e 100644 --- a/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt +++ b/ext/reflection/tests/ReflectionClass_newInstanceArgs_001.phpt @@ -35,7 +35,7 @@ $rcE = new ReflectionClass('E'); try { $rcB->newInstanceArgs(); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($rcB->newInstanceArgs(array('x', 123))); @@ -44,14 +44,14 @@ try { $rcC->newInstanceArgs(); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcD->newInstanceArgs(); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $e1 = $rcE->newInstanceArgs(); @@ -61,16 +61,16 @@ try { $e2 = $rcE->newInstanceArgs(array('x')); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Exception: Too few arguments to function B::__construct(), 0 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function B::__construct(), 0 passed and exactly 2 expected In constructor of class B with args x, 123 object(B)#%d (0) { } -Access to non-public constructor of class C -Access to non-public constructor of class D +ReflectionException: Access to non-public constructor of class C +ReflectionException: Access to non-public constructor of class D object(E)#%d (0) { } -Class E does not have a constructor, so you cannot pass any constructor arguments +ReflectionException: Class E does not have a constructor, so you cannot pass any constructor arguments diff --git a/ext/reflection/tests/ReflectionClass_newInstanceWithoutConstructor.phpt b/ext/reflection/tests/ReflectionClass_newInstanceWithoutConstructor.phpt index 59337f09e8b4..6d177b376552 100644 --- a/ext/reflection/tests/ReflectionClass_newInstanceWithoutConstructor.phpt +++ b/ext/reflection/tests/ReflectionClass_newInstanceWithoutConstructor.phpt @@ -25,7 +25,7 @@ $class = new ReflectionClass('Generator'); try { var_dump($class->newInstanceWithoutConstructor()); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } final class Bar extends ArrayObject { @@ -42,7 +42,7 @@ object(stdClass)#%d (0) { } object(DateTime)#%d (0) { } -Class Generator is an internal class marked as final that cannot be instantiated without invoking its constructor +ReflectionException: Class Generator is an internal class marked as final that cannot be instantiated without invoking its constructor object(Bar)#%d (1) { ["storage":"ArrayObject":private]=> array(0) { diff --git a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt index 22d06e328270..51bcc656b732 100644 --- a/ext/reflection/tests/ReflectionClass_newInstance_001.phpt +++ b/ext/reflection/tests/ReflectionClass_newInstance_001.phpt @@ -35,26 +35,26 @@ $rcE = new ReflectionClass('E'); try { var_dump($rcB->newInstance()); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rcB->newInstance('x', 123)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcC->newInstance(); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $rcD->newInstance(); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $e1 = $rcE->newInstance(); @@ -64,16 +64,16 @@ try { $e2 = $rcE->newInstance('x'); echo "you should not see this\n"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Exception: Too few arguments to function B::__construct(), 0 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function B::__construct(), 0 passed and exactly 2 expected In constructor of class B with args x, 123 object(B)#%d (0) { } -Access to non-public constructor of class C -Access to non-public constructor of class D +ReflectionException: Access to non-public constructor of class C +ReflectionException: Access to non-public constructor of class D object(E)#%d (0) { } -Class E does not have a constructor, so you cannot pass any constructor arguments +ReflectionException: Class E does not have a constructor, so you cannot pass any constructor arguments diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt index 512fb5d6d916..3c8d832934f1 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_001.phpt @@ -38,14 +38,14 @@ try { var_dump($rcA->setStaticPropertyValue("protectedDoesNotExist", "new value 8")); echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rcA->setStaticPropertyValue("privateDoesNotExist", "new value 9")); echo "you should not see this"; } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -73,5 +73,5 @@ Array ) Set non-existent values from A with no default value: -Property A::$protectedDoesNotExist does not exist -Property A::$privateDoesNotExist does not exist +ReflectionException: Property A::$protectedDoesNotExist does not exist +ReflectionException: Property A::$privateDoesNotExist does not exist diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt index 2822471a3971..87d00cb06220 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_002.phpt @@ -13,42 +13,42 @@ $rc = new ReflectionClass('C'); try { var_dump($rc->setStaticPropertyValue("x", "default value", 'blah')); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->setStaticPropertyValue()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->setStaticPropertyValue(null)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->setStaticPropertyValue(null,null)); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->setStaticPropertyValue(1.5, 'def')); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rc->setStaticPropertyValue(array(1,2,3), 'blah')); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given -ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given +ArgumentCountError: ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 3 given +ArgumentCountError: ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 0 given +ArgumentCountError: ReflectionClass::setStaticPropertyValue() expects exactly 2 arguments, 1 given Deprecated: ReflectionClass::setStaticPropertyValue(): Passing null to parameter #1 ($name) of type string is deprecated in %s on line %d -Property C::$ does not exist -Property C::$1.5 does not exist -ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given +ReflectionException: Property C::$ does not exist +ReflectionException: Property C::$1.5 does not exist +TypeError: ReflectionClass::setStaticPropertyValue(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_003.phpt b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_003.phpt index 959cc1bea079..5e0bfae20dbf 100644 --- a/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_003.phpt +++ b/ext/reflection/tests/ReflectionClass_setStaticPropertyValue_003.phpt @@ -12,7 +12,7 @@ $rc = new ReflectionClass('Test'); try { $rc->setStaticPropertyValue("y", "foo"); -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Test::$y); $rc->setStaticPropertyValue("y", "21"); @@ -23,7 +23,7 @@ Test::$x =& Test::$y; try { $rc->setStaticPropertyValue("x", "foo"); -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Test::$y); $rc->setStaticPropertyValue("x", "42"); @@ -31,9 +31,9 @@ var_dump(Test::$y); ?> --EXPECT-- -Cannot assign string to property Test::$y of type int +TypeError: Cannot assign string to property Test::$y of type int int(2) int(21) -Cannot assign string to reference held by property Test::$y of type int +TypeError: Cannot assign string to reference held by property Test::$y of type int int(21) int(42) diff --git a/ext/reflection/tests/ReflectionClass_toString_004.phpt b/ext/reflection/tests/ReflectionClass_toString_004.phpt index 0eecb3c8a346..d3c66be8f3b1 100644 --- a/ext/reflection/tests/ReflectionClass_toString_004.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_004.phpt @@ -9,9 +9,9 @@ class A { try { echo new ReflectionClass(A::class); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant self::UNKNOWN +Error: Undefined constant self::UNKNOWN diff --git a/ext/reflection/tests/ReflectionClass_toString_007.phpt b/ext/reflection/tests/ReflectionClass_toString_007.phpt index fd3ed8f32e35..e280b74524f3 100644 --- a/ext/reflection/tests/ReflectionClass_toString_007.phpt +++ b/ext/reflection/tests/ReflectionClass_toString_007.phpt @@ -12,9 +12,9 @@ define("C", new stdClass()); try { (string) new ReflectionClass(Foo::class); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign stdClass to class constant Foo::CONST1 of type array +TypeError: Cannot assign stdClass to class constant Foo::CONST1 of type array diff --git a/ext/reflection/tests/ReflectionConstant_inexistent.phpt b/ext/reflection/tests/ReflectionConstant_inexistent.phpt index 19d038ae12d0..d3d489af6644 100644 --- a/ext/reflection/tests/ReflectionConstant_inexistent.phpt +++ b/ext/reflection/tests/ReflectionConstant_inexistent.phpt @@ -6,7 +6,7 @@ ReflectionConstant on inexistent constant try { new \ReflectionConstant('C'); } catch (Exception $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue.phpt b/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue.phpt index f81241d73a9e..f5974fb9a468 100644 --- a/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue.phpt +++ b/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue.phpt @@ -18,13 +18,13 @@ enum StringEnum: string { try { var_dump(new ReflectionEnumBackedCase(Enum_::class, 'Foo')); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(new ReflectionEnumBackedCase([], 'Foo')); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump((new ReflectionEnumBackedCase(IntEnum::class, 'Foo'))->getBackingValue()); @@ -32,7 +32,7 @@ var_dump((new ReflectionEnumBackedCase(StringEnum::class, 'Foo'))->getBackingVal ?> --EXPECT-- -Enum case Enum_::Foo is not a backed case -ReflectionEnumBackedCase::__construct(): Argument #1 ($class) must be of type object|string, array given +ReflectionException: Enum case Enum_::Foo is not a backed case +TypeError: ReflectionEnumBackedCase::__construct(): Argument #1 ($class) must be of type object|string, array given int(0) string(3) "Foo" diff --git a/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue_002.phpt b/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue_002.phpt index 7a942e31ad17..8e50822344fc 100644 --- a/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue_002.phpt +++ b/ext/reflection/tests/ReflectionEnumBackedCase_getBackingValue_002.phpt @@ -8,8 +8,8 @@ enum Inm:int { try { var_dump((new ReflectionEnumBackedCase(Inm::class,'Foo'))->getBackingValue()); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "y" +Error: Undefined constant "y" diff --git a/ext/reflection/tests/ReflectionEnumUnitCase_construct.phpt b/ext/reflection/tests/ReflectionEnumUnitCase_construct.phpt index 18ab0222eb5b..06c783d4af85 100644 --- a/ext/reflection/tests/ReflectionEnumUnitCase_construct.phpt +++ b/ext/reflection/tests/ReflectionEnumUnitCase_construct.phpt @@ -16,19 +16,19 @@ var_dump($case->getModifiers()); try { new ReflectionEnumUnitCase(Foo::class, 'Baz'); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new ReflectionEnumUnitCase(Foo::class, 'Qux'); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new ReflectionEnumUnitCase([], 'Foo'); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -36,6 +36,6 @@ try { string(3) "Bar" bool(true) int(1) -Constant Foo::Baz is not a case -Constant Foo::Qux does not exist -ReflectionEnumUnitCase::__construct(): Argument #1 ($class) must be of type object|string, array given +ReflectionException: Constant Foo::Baz is not a case +ReflectionException: Constant Foo::Qux does not exist +TypeError: ReflectionEnumUnitCase::__construct(): Argument #1 ($class) must be of type object|string, array given diff --git a/ext/reflection/tests/ReflectionEnum_construct.phpt b/ext/reflection/tests/ReflectionEnum_construct.phpt index 4b4a0391052a..da34a2f6405e 100644 --- a/ext/reflection/tests/ReflectionEnum_construct.phpt +++ b/ext/reflection/tests/ReflectionEnum_construct.phpt @@ -11,24 +11,24 @@ echo (new ReflectionEnum(Foo::class))->getName() . "\n"; try { new ReflectionEnum('Bar'); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new ReflectionEnum('Baz'); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new ReflectionEnum([]); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Foo -Class "Bar" is not an enum -Class "Baz" does not exist -ReflectionEnum::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given +ReflectionException: Class "Bar" is not an enum +ReflectionException: Class "Baz" does not exist +TypeError: ReflectionEnum::__construct(): Argument #1 ($objectOrClass) must be of type object|string, array given diff --git a/ext/reflection/tests/ReflectionEnum_getCase.phpt b/ext/reflection/tests/ReflectionEnum_getCase.phpt index f2b53cf65792..c8b7c14b6def 100644 --- a/ext/reflection/tests/ReflectionEnum_getCase.phpt +++ b/ext/reflection/tests/ReflectionEnum_getCase.phpt @@ -18,7 +18,7 @@ function test(string $enumName, string $caseName) { $reflectionEnum = new ReflectionEnum($enumName); var_dump($reflectionEnum->getCase($caseName)); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt index f4241bcd9221..a066775bbad3 100644 --- a/ext/reflection/tests/ReflectionExtension_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionExtension_constructor_error.phpt @@ -8,24 +8,24 @@ Leon Luijkx try { $obj = new ReflectionExtension(); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { $obj = new ReflectionExtension('foo', 'bar'); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { $obj = new ReflectionExtension([]); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - ReflectionExtension::__construct() expects exactly 1 argument, 0 given -Ok - ReflectionExtension::__construct() expects exactly 1 argument, 2 given -Ok - ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given +ArgumentCountError: ReflectionExtension::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionExtension::__construct() expects exactly 1 argument, 2 given +TypeError: ReflectionExtension::__construct(): Argument #1 ($name) must be of type string, array given diff --git a/ext/reflection/tests/ReflectionFiber_errors.phpt b/ext/reflection/tests/ReflectionFiber_errors.phpt index 640cdcb3bc89..9cd5ab5955af 100644 --- a/ext/reflection/tests/ReflectionFiber_errors.phpt +++ b/ext/reflection/tests/ReflectionFiber_errors.phpt @@ -12,19 +12,19 @@ $reflection = new ReflectionFiber($fiber); try { $reflection->getTrace(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $reflection->getExecutingFile(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $reflection->getExecutingLine(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } $fiber->start(); @@ -37,35 +37,35 @@ $fiber->resume(); try { $reflection->getTrace(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $reflection->getExecutingFile(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $reflection->getExecutingLine(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $reflection->getCallable(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot fetch information from a fiber that has not been started or is terminated -Cannot fetch information from a fiber that has not been started or is terminated -Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated string(%d) "%s%eReflectionFiber_errors.php" int(4) -Cannot fetch information from a fiber that has not been started or is terminated -Cannot fetch information from a fiber that has not been started or is terminated -Cannot fetch information from a fiber that has not been started or is terminated -Cannot fetch the callable from a fiber that has terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch information from a fiber that has not been started or is terminated +Error: Cannot fetch the callable from a fiber that has terminated diff --git a/ext/reflection/tests/ReflectionFunction_construct.001.phpt b/ext/reflection/tests/ReflectionFunction_construct.001.phpt index f7020699d564..f3550d19277b 100644 --- a/ext/reflection/tests/ReflectionFunction_construct.001.phpt +++ b/ext/reflection/tests/ReflectionFunction_construct.001.phpt @@ -10,33 +10,33 @@ try { $a = new ReflectionFunction(array(1, 2, 3)); echo "exception not thrown.".PHP_EOL; } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { $a = new ReflectionFunction('nonExistentFunction'); } catch (ReflectionException $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $a = new ReflectionFunction(); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { $a = new ReflectionFunction(1, 2); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { $a = new ReflectionFunction([]); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given -Function nonExistentFunction() does not exist -Ok - ReflectionFunction::__construct() expects exactly 1 argument, 0 given -Ok - ReflectionFunction::__construct() expects exactly 1 argument, 2 given -Ok - ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given +TypeError: ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given +ReflectionException: Function nonExistentFunction() does not exist +ArgumentCountError: ReflectionFunction::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionFunction::__construct() expects exactly 1 argument, 2 given +TypeError: ReflectionFunction::__construct(): Argument #1 ($function) must be of type Closure|string, array given diff --git a/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt b/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt index 64f8612fd853..876ab8d5981b 100644 --- a/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt +++ b/ext/reflection/tests/ReflectionFunction_isDisabled_basic.phpt @@ -11,14 +11,14 @@ try { $rf = new ReflectionFunction('is_file'); var_dump($rf->isDisabled()); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $rf = new ReflectionFunction('is_string'); var_dump($rf->isDisabled()); ?> --EXPECTF-- -Function is_file() does not exist +ReflectionException: Function is_file() does not exist Deprecated: Method ReflectionFunction::isDisabled() is deprecated since 8.0, as ReflectionFunction can no longer be constructed for disabled functions in %s on line %d bool(false) diff --git a/ext/reflection/tests/ReflectionGenerator_isClosed.phpt b/ext/reflection/tests/ReflectionGenerator_isClosed.phpt index 3fc893083ce9..1adfc4b91605 100644 --- a/ext/reflection/tests/ReflectionGenerator_isClosed.phpt +++ b/ext/reflection/tests/ReflectionGenerator_isClosed.phpt @@ -25,7 +25,7 @@ foreach ($gens as $gen) { try { var_dump($ref->getExecutingLine()); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL; @@ -37,10 +37,10 @@ int(9) bool(false) int(9) bool(true) -Cannot fetch information from a closed Generator +ReflectionException: Cannot fetch information from a closed Generator int(3) bool(false) int(3) bool(true) -Cannot fetch information from a closed Generator +ReflectionException: Cannot fetch information from a closed Generator diff --git a/ext/reflection/tests/ReflectionGenerator_isClosed_002.phpt b/ext/reflection/tests/ReflectionGenerator_isClosed_002.phpt index 1676369c5038..99621557d7d0 100644 --- a/ext/reflection/tests/ReflectionGenerator_isClosed_002.phpt +++ b/ext/reflection/tests/ReflectionGenerator_isClosed_002.phpt @@ -23,7 +23,7 @@ foreach ($gens as $gen) { try { var_dump($ref->getExecutingLine()); } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo PHP_EOL; @@ -39,4 +39,4 @@ int(10) bool(false) bool(false) bool(true) -Cannot fetch information from a closed Generator +ReflectionException: Cannot fetch information from a closed Generator diff --git a/ext/reflection/tests/ReflectionMethod_006.phpt b/ext/reflection/tests/ReflectionMethod_006.phpt index 4f76e8c338f3..6583b21d9a83 100644 --- a/ext/reflection/tests/ReflectionMethod_006.phpt +++ b/ext/reflection/tests/ReflectionMethod_006.phpt @@ -9,15 +9,15 @@ Steve Seear try { new ReflectionMethod(); } catch (ArgumentCountError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { new ReflectionMethod('a', 'b', 'c'); } catch (ArgumentCountError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - ReflectionMethod::__construct() expects at least 1 argument, 0 given -Ok - ReflectionMethod::__construct() expects at most 2 arguments, 3 given +ArgumentCountError: ReflectionMethod::__construct() expects at least 1 argument, 0 given +ArgumentCountError: ReflectionMethod::__construct() expects at most 2 arguments, 3 given diff --git a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt index a7115893a5c8..8c4990514105 100644 --- a/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt +++ b/ext/reflection/tests/ReflectionMethod_constructor_error2.phpt @@ -17,13 +17,13 @@ try { echo "Too few arguments:\n"; $methodInfo = new ReflectionMethod(); } catch (ArgumentCountError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { echo "\nToo many arguments:\n"; $methodInfo = new ReflectionMethod("TestClass", "foo", true); } catch (ArgumentCountError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } @@ -31,7 +31,7 @@ try { //invalid class $methodInfo = new ReflectionMethod("InvalidClassName", "foo"); } catch (ReflectionException $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } @@ -39,23 +39,23 @@ try { //invalid 1st param $methodInfo = new ReflectionMethod([], "foo"); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try{ //invalid 2nd param $methodInfo = new ReflectionMethod("TestClass", []); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } ?> --EXPECT-- Too few arguments: -Ok - ReflectionMethod::__construct() expects at least 1 argument, 0 given +ArgumentCountError: ReflectionMethod::__construct() expects at least 1 argument, 0 given Too many arguments: -Ok - ReflectionMethod::__construct() expects at most 2 arguments, 3 given -Ok - Class "InvalidClassName" does not exist -Ok - ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given -Ok - ReflectionMethod::__construct(): Argument #2 ($method) must be of type ?string, array given +ArgumentCountError: ReflectionMethod::__construct() expects at most 2 arguments, 3 given +ReflectionException: Class "InvalidClassName" does not exist +TypeError: ReflectionMethod::__construct(): Argument #1 ($objectOrMethod) must be of type object|string, array given +TypeError: ReflectionMethod::__construct(): Argument #2 ($method) must be of type ?string, array given diff --git a/ext/reflection/tests/ReflectionMethod_createFromMethodName.phpt b/ext/reflection/tests/ReflectionMethod_createFromMethodName.phpt index fb7de1400159..cfb422bcca43 100644 --- a/ext/reflection/tests/ReflectionMethod_createFromMethodName.phpt +++ b/ext/reflection/tests/ReflectionMethod_createFromMethodName.phpt @@ -16,7 +16,7 @@ var_dump($m); try { $m = MyReflectionMethod::createFromMethodName("Foo::baz"); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -27,4 +27,4 @@ object(MyReflectionMethod)#%d (%d) { ["class"]=> string(3) "Foo" } -Method Foo::baz() does not exist +ReflectionException: Method Foo::baz() does not exist diff --git a/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt b/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt index 0dc24897a345..bc92642511f9 100644 --- a/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt +++ b/ext/reflection/tests/ReflectionMethod_getClosure_error.phpt @@ -33,7 +33,7 @@ echo "\n-- Testing ReflectionMethod::getClosure() function with invalid object - try { var_dump( $method->getClosure( $fakeobj ) ); } catch( Exception $e ) { - var_dump( $e->getMessage() ); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -41,4 +41,4 @@ try { *** Testing ReflectionMethod::getClosure() : error conditions *** -- Testing ReflectionMethod::getClosure() function with invalid object -- -string(72) "Given object is not an instance of the class this method was declared in" +ReflectionException: Given object is not an instance of the class this method was declared in diff --git a/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt b/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt index bea2314b04f6..c1f3733ed0a8 100644 --- a/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invokeArgs_basic.phpt @@ -44,7 +44,7 @@ echo "\nMethod that throws an exception:\n"; try { $methodThatThrows->invokeArgs($testClassInstance, array()); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -70,4 +70,4 @@ Called methodWithArgs(1, arg2) NULL Method that throws an exception: -string(18) "Called willThrow()" +Exception: Called willThrow() diff --git a/ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt b/ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt index 791bfe3f4358..4ab60b67b10b 100644 --- a/ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt +++ b/ext/reflection/tests/ReflectionMethod_invokeArgs_error2.phpt @@ -19,9 +19,9 @@ $testClassInstance = new TestClass(); try { var_dump($foo->invokeArgs($testClassInstance, true)); } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(85) "ReflectionMethod::invokeArgs(): Argument #2 ($args) must be of type array, true given" +TypeError: ReflectionMethod::invokeArgs(): Argument #2 ($args) must be of type array, true given diff --git a/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt b/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt index 124f728052e2..7779f5ee580b 100644 --- a/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt +++ b/ext/reflection/tests/ReflectionMethod_invokeArgs_error3.phpt @@ -17,7 +17,7 @@ class TestClass { try { var_dump($this); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -41,7 +41,7 @@ echo "\nNon-instance:\n"; try { var_dump($foo->invokeArgs(new stdClass(), array())); } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nStatic method:\n"; @@ -56,22 +56,22 @@ $abstractMethod = new ReflectionMethod("AbstractClass", "foo"); try { $abstractMethod->invokeArgs($testClassInstance, array()); } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $abstractMethod->invokeArgs(true); } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Non-instance: -string(72) "Given object is not an instance of the class this method was declared in" +ReflectionException: Given object is not an instance of the class this method was declared in Static method: Called staticMethod() -Exception: Using $this when not in object context +Error: Using $this when not in object context NULL Private method: @@ -79,5 +79,5 @@ Called privateMethod() NULL Abstract method: -string(53) "Trying to invoke abstract method AbstractClass::foo()" -string(53) "Trying to invoke abstract method AbstractClass::foo()" +ReflectionException: Trying to invoke abstract method AbstractClass::foo() +ReflectionException: Trying to invoke abstract method AbstractClass::foo() diff --git a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt index 66f3c50da027..db82f780585c 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_basic.phpt @@ -25,7 +25,7 @@ class TestClass { try { var_dump($this); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -63,12 +63,12 @@ echo "\nStatic method:\n"; try { var_dump($staticMethod->invoke()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($staticMethod->invoke(true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($staticMethod->invoke(new stdClass())); @@ -76,7 +76,7 @@ echo "\nMethod that throws an exception:\n"; try { var_dump($methodThatThrows->invoke($testClassInstance)); } catch (Exception $exc) { - var_dump($exc->getMessage()); + echo $exc::class, ': ', $exc->getMessage(), "\n"; } ?> @@ -102,11 +102,11 @@ Called methodWithArgs(1, arg2) NULL Static method: -ReflectionMethod::invoke() expects at least 1 argument, 0 given -ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, true given +ArgumentCountError: ReflectionMethod::invoke() expects at least 1 argument, 0 given +TypeError: ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, true given Called staticMethod() -Exception: Using $this when not in object context +Error: Using $this when not in object context NULL Method that throws an exception: -string(18) "Called willThrow()" +Exception: Called willThrow() diff --git a/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt b/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt index 1ddf1c51c139..8a0e8008e806 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_error1.phpt @@ -31,14 +31,14 @@ echo "invoke() on a non-object:\n"; try { var_dump($foo->invoke(true)); } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\ninvoke() on a non-instance:\n"; try { var_dump($foo->invoke(new stdClass())); } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nPrivate method:\n"; @@ -49,20 +49,20 @@ $abstractMethod = ReflectionMethod::createFromMethodName("AbstractClass::foo"); try { $abstractMethod->invoke(true); } catch (ReflectionException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- invoke() on a non-object: -string(85) "ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, true given" +TypeError: ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, true given invoke() on a non-instance: -string(72) "Given object is not an instance of the class this method was declared in" +ReflectionException: Given object is not an instance of the class this method was declared in Private method: Called privateMethod() NULL Abstract method: -string(53) "Trying to invoke abstract method AbstractClass::foo()" +ReflectionException: Trying to invoke abstract method AbstractClass::foo() diff --git a/ext/reflection/tests/ReflectionMethod_invoke_on_abstract_method_after_setAccessible.phpt b/ext/reflection/tests/ReflectionMethod_invoke_on_abstract_method_after_setAccessible.phpt index 67f6fe5dca42..3239a3576445 100644 --- a/ext/reflection/tests/ReflectionMethod_invoke_on_abstract_method_after_setAccessible.phpt +++ b/ext/reflection/tests/ReflectionMethod_invoke_on_abstract_method_after_setAccessible.phpt @@ -11,9 +11,9 @@ $rm = new ReflectionMethod('Test', 'foo'); try { var_dump($rm->invoke(null)); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to invoke abstract method Test::foo() +ReflectionException: Trying to invoke abstract method Test::foo() diff --git a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt index 03a4cfcc2250..0ead6fc8b508 100644 --- a/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt +++ b/ext/reflection/tests/ReflectionObject_isSubclassOf.002.phpt @@ -12,35 +12,35 @@ echo "\n\nTest bad arguments:\n"; try { $ro->isSubclassOf(); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ro->isSubclassOf('C', 'C'); } catch (ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ro->isSubclassOf(null); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ro->isSubclassOf('ThisClassDoesNotExist'); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ro->isSubclassOf(2); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Test bad arguments: -ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given -ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given +ArgumentCountError: ReflectionClass::isSubclassOf() expects exactly 1 argument, 0 given +ArgumentCountError: ReflectionClass::isSubclassOf() expects exactly 1 argument, 2 given Deprecated: ReflectionClass::isSubclassOf(): Passing null to parameter #1 ($class) of type ReflectionClass|string is deprecated in %s on line %d -Class "" does not exist -Class "ThisClassDoesNotExist" does not exist -Class "2" does not exist +ReflectionException: Class "" does not exist +ReflectionException: Class "ThisClassDoesNotExist" does not exist +ReflectionException: Class "2" does not exist diff --git a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt index 95551524047e..dc20710e9bbf 100644 --- a/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt +++ b/ext/reflection/tests/ReflectionParameter_DefaultValueConstant_error.phpt @@ -13,10 +13,10 @@ foreach($reflect->getParameters() as $param) { try { echo $param->getDefaultValueConstantName() . "\n"; } catch(ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value CONST_TEST_1 diff --git a/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt b/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt index 10f45647e6cb..07d1ddab10ed 100644 --- a/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt +++ b/ext/reflection/tests/ReflectionParameter_ctor_cast.phpt @@ -10,9 +10,9 @@ try { new class { public function __toString() { return 'method'; } } ], 'param'); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Method A::method() does not exist +ReflectionException: Method A::method() does not exist diff --git a/ext/reflection/tests/ReflectionParameter_getClass_self_parent_closure.phpt b/ext/reflection/tests/ReflectionParameter_getClass_self_parent_closure.phpt index 59599e468b66..17d8625500e2 100644 --- a/ext/reflection/tests/ReflectionParameter_getClass_self_parent_closure.phpt +++ b/ext/reflection/tests/ReflectionParameter_getClass_self_parent_closure.phpt @@ -7,14 +7,14 @@ $fn1 = function(self $x) {}; try { (new ReflectionFunction($fn1))->getParameters()[0]->getClass(); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $fn2 = function(parent $x) {}; try { (new ReflectionFunction($fn2))->getParameters()[0]->getClass(); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Test {} @@ -22,16 +22,16 @@ $fn3 = (function(parent $x) {})->bindTo(new Test, Test::class); try { (new ReflectionFunction($fn3))->getParameters()[0]->getClass(); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d -Parameter uses "self" as type but function is not a class member +ReflectionException: Parameter uses "self" as type but function is not a class member Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d -Parameter uses "parent" as type but function is not a class member +ReflectionException: Parameter uses "parent" as type but function is not a class member Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d -Parameter uses "parent" as type although class does not have a parent +ReflectionException: Parameter uses "parent" as type although class does not have a parent diff --git a/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt b/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt index 46e47bf60324..73395c145c4a 100644 --- a/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt +++ b/ext/reflection/tests/ReflectionParameter_getDocComment_basic.phpt @@ -245,4 +245,3 @@ string(%d) "/** Doc comment for $h after parameter */" ---> Doc comment for property hook parameter $value: string(%d) "/** Doc Comment for property hook parameter $value */" - diff --git a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt index aa88c45449e7..8ea0af079551 100644 --- a/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt +++ b/ext/reflection/tests/ReflectionParameter_invalidMethodInConstructor.phpt @@ -6,17 +6,17 @@ ReflectionParameter::__construct(): Invalid method as constructor // Invalid class name try { new ReflectionParameter (array ('A', 'b'), 0); -} catch (ReflectionException $e) { echo $e->getMessage()."\n"; } +} catch (ReflectionException $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid class method try { new ReflectionParameter (array ('C', 'b'), 0); -} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; } +} catch (ReflectionException $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid object method try { new ReflectionParameter (array (new C, 'b'), 0); -} catch (ReflectionException $e) { echo $e->getMessage ()."\n"; } +} catch (ReflectionException $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } class C { @@ -40,9 +40,9 @@ echo "Done.\n"; ?> --EXPECT-- -Class "A" does not exist -Method C::b() does not exist -Method C::b() does not exist +ReflectionException: Class "A" does not exist +ReflectionException: Method C::b() does not exist +ReflectionException: Method C::b() does not exist Ok - ReflectionParameter::__construct() expects exactly 2 arguments, 1 given Ok - ReflectionParameter::__construct(): Argument #1 ($function) must be a string, an array(class, method), or a callable object, int given Done. diff --git a/ext/reflection/tests/ReflectionProperty_constructor_error.phpt b/ext/reflection/tests/ReflectionProperty_constructor_error.phpt index e7a850dd9777..14f1cca07376 100644 --- a/ext/reflection/tests/ReflectionProperty_constructor_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_constructor_error.phpt @@ -12,32 +12,32 @@ echo "Non-existent class:\n"; try { new ReflectionProperty("NonExistentClass", "prop"); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n\nWrong property parameter type:\n"; +echo "\nWrong property parameter type:\n"; try { new ReflectionProperty($a, 'TestClass'); } catch(ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n\nNon-existent property:\n"; +echo "\nNon-existent property:\n"; try { new ReflectionProperty('TestClass', "nonExistentProperty"); } catch(ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Non-existent class: -Class "NonExistentClass" does not exist +ReflectionException: Class "NonExistentClass" does not exist Wrong property parameter type: -Class "5" does not exist +ReflectionException: Class "5" does not exist Non-existent property: -Property TestClass::$nonExistentProperty does not exist +ReflectionException: Property TestClass::$nonExistentProperty does not exist diff --git a/ext/reflection/tests/ReflectionProperty_constructor_variation1.phpt b/ext/reflection/tests/ReflectionProperty_constructor_variation1.phpt index 4456960dc7eb..45f2f8bdbda9 100644 --- a/ext/reflection/tests/ReflectionProperty_constructor_variation1.phpt +++ b/ext/reflection/tests/ReflectionProperty_constructor_variation1.phpt @@ -11,7 +11,7 @@ class C { $rp = new ReflectionProperty("D", "p"); var_dump($rp); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -22,7 +22,7 @@ class D extends C{ $rp = new ReflectionProperty("D", "p"); var_dump($rp); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -32,10 +32,10 @@ try { $rp = new ReflectionProperty("D", "p"); var_dump($rp); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n\n--> Reflect inherited private from declaring scope:\n"; +echo "\n--> Reflect inherited private from declaring scope:\n"; C::testFromC(); echo "\n\n--> Reflect inherited private from declaring scope via subclass:\n"; @@ -46,13 +46,15 @@ D::testFromD(); ?> --EXPECT-- --> Reflect inherited private from global scope: -Property D::$p does not exist +ReflectionException: Property D::$p does not exist --> Reflect inherited private from declaring scope: -Property D::$p does not exist +ReflectionException: Property D::$p does not exist + --> Reflect inherited private from declaring scope via subclass: -Property D::$p does not exist +ReflectionException: Property D::$p does not exist + --> Reflect inherited private from subclass: -Property D::$p does not exist +ReflectionException: Property D::$p does not exist diff --git a/ext/reflection/tests/ReflectionProperty_error.phpt b/ext/reflection/tests/ReflectionProperty_error.phpt index bb53599ce67d..bc697dc255c6 100644 --- a/ext/reflection/tests/ReflectionProperty_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_error.phpt @@ -10,22 +10,22 @@ class C { try { new ReflectionProperty(); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { new ReflectionProperty('C::p'); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } try { new ReflectionProperty('C', 'p', 'x'); } catch (TypeError $re) { - echo "Ok - ".$re->getMessage().PHP_EOL; + echo $re::class, ': ', $re->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 0 given -Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 1 given -Ok - ReflectionProperty::__construct() expects exactly 2 arguments, 3 given +ArgumentCountError: ReflectionProperty::__construct() expects exactly 2 arguments, 0 given +ArgumentCountError: ReflectionProperty::__construct() expects exactly 2 arguments, 1 given +ArgumentCountError: ReflectionProperty::__construct() expects exactly 2 arguments, 3 given diff --git a/ext/reflection/tests/ReflectionProperty_getMangledName_dynamic.phpt b/ext/reflection/tests/ReflectionProperty_getMangledName_dynamic.phpt index 271552ab46ae..39fa4f7efa84 100644 --- a/ext/reflection/tests/ReflectionProperty_getMangledName_dynamic.phpt +++ b/ext/reflection/tests/ReflectionProperty_getMangledName_dynamic.phpt @@ -20,7 +20,7 @@ function testDynamicProperty($obj, $property, $description) { echo " Found in array cast: " . (array_key_exists($reflection->getMangledName(), $array) ? "yes" : "no") . "\n"; echo "\n"; } catch (ReflectionException $e) { - echo "$description: EXCEPTION - " . $e->getMessage() . "\n\n"; + echo "$description: ", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -61,14 +61,14 @@ try { $reflection = new ReflectionProperty('TestClass', 'dynamic'); echo "This should not be reached\n"; } catch (ReflectionException $e) { - echo "Expected exception for class-based reflection: " . $e->getMessage() . "\n"; + echo 'class-based reflection: ', $e::class, ': ', $e->getMessage(), "\n"; } try { $reflection = new ReflectionProperty($obj, 'dynamic'); echo "Instance-based reflection works: " . $reflection->getMangledName() . "\n"; } catch (ReflectionException $e) { - echo "Unexpected exception: " . $e->getMessage() . "\n"; + echo 'unexpected: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -121,5 +121,5 @@ Regular property: getMangledName(): existing === Testing ReflectionProperty from class vs instance === -Expected exception for class-based reflection: Property TestClass::$dynamic does not exist +class-based reflection: ReflectionException: Property TestClass::$dynamic does not exist Instance-based reflection works: dynamic diff --git a/ext/reflection/tests/ReflectionProperty_getMangledName_hooks.phpt b/ext/reflection/tests/ReflectionProperty_getMangledName_hooks.phpt index da00a0da2912..a5bcc1557ecd 100644 --- a/ext/reflection/tests/ReflectionProperty_getMangledName_hooks.phpt +++ b/ext/reflection/tests/ReflectionProperty_getMangledName_hooks.phpt @@ -32,7 +32,7 @@ function testHookedProperty($obj, $property, $description) { echo " Has hooks: " . ($reflection->hasHooks() ? "yes" : "no") . "\n"; echo "\n"; } catch (ReflectionException $e) { - echo "$description: EXCEPTION - " . $e->getMessage() . "\n\n"; + echo "$description: ", $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/reflection/tests/ReflectionProperty_getMangledName_inheritance.phpt b/ext/reflection/tests/ReflectionProperty_getMangledName_inheritance.phpt index 301756c8cbf2..9b095701e3e3 100644 --- a/ext/reflection/tests/ReflectionProperty_getMangledName_inheritance.phpt +++ b/ext/reflection/tests/ReflectionProperty_getMangledName_inheritance.phpt @@ -41,7 +41,7 @@ try { $reflection = new ReflectionProperty('ChildClass', 'parentOnly'); echo "ERROR: Should have failed\n"; } catch (ReflectionException $e) { - echo "Instance-based creation failed as expected: " . $e->getMessage() . "\n"; + echo 'Instance-based creation failed as expected: ', $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -49,7 +49,7 @@ try { $reflection = new ReflectionProperty($obj, 'parentOnly'); echo "ERROR: Should have failed\n"; } catch (ReflectionException $e) { - echo "Object-based creation failed as expected: " . $e->getMessage() . "\n"; + echo 'Object-based creation failed as expected: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -83,5 +83,5 @@ Mangled name: '%0ChildClass%0private' Key exists in array cast: yes Access to parent's private property not in child: -Instance-based creation failed as expected: Property ChildClass::$parentOnly does not exist -Object-based creation failed as expected: Property ChildClass::$parentOnly does not exist +Instance-based creation failed as expected: ReflectionException: Property ChildClass::$parentOnly does not exist +Object-based creation failed as expected: ReflectionException: Property ChildClass::$parentOnly does not exist diff --git a/ext/reflection/tests/ReflectionProperty_getMangledName_instance.phpt b/ext/reflection/tests/ReflectionProperty_getMangledName_instance.phpt index 7c24ce85f173..e9a57c309e9d 100644 --- a/ext/reflection/tests/ReflectionProperty_getMangledName_instance.phpt +++ b/ext/reflection/tests/ReflectionProperty_getMangledName_instance.phpt @@ -23,7 +23,7 @@ function testFromClass($property) { echo " getMangledName(): " . $reflection->getMangledName() . "\n"; echo "\n"; } catch (ReflectionException $e) { - echo "Property $property from class: EXCEPTION - " . $e->getMessage() . "\n\n"; + echo "Property $property from class: ", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -45,7 +45,7 @@ function testFromInstance($obj, $property) { echo " Found in array cast: " . (array_key_exists($reflection->getMangledName(), $array) ? "yes" : "no") . "\n"; echo "\n"; } catch (ReflectionException $e) { - echo "Property $property from instance: EXCEPTION - " . $e->getMessage() . "\n\n"; + echo "Property $property from instance: ", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -74,8 +74,7 @@ Property private from class: getName(): private getMangledName(): %0TestClass%0private -Property dynamic from class: EXCEPTION - Property TestClass::$dynamic does not exist - +Property dynamic from class: ReflectionException: Property TestClass::$dynamic does not exist === Testing ReflectionProperty from INSTANCE === Property public from instance: getName(): public diff --git a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt index a898eea6bea0..13e27861f7ca 100644 --- a/ext/reflection/tests/ReflectionProperty_getValue_error.phpt +++ b/ext/reflection/tests/ReflectionProperty_getValue_error.phpt @@ -25,7 +25,7 @@ echo "\nStatic property / too many args:\n"; try { var_dump($propInfo->getValue($instance, true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nProtected property:\n"; @@ -37,14 +37,14 @@ $propInfo = new ReflectionProperty('TestClass', 'pub2'); try { var_dump($propInfo->getValue($invalidInstance)); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n\nMissing instance:\n"; +echo "\nMissing instance:\n"; try { var_dump($propInfo->getValue()); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -52,14 +52,14 @@ try { Instance without property: Static property / too many args: -ReflectionProperty::getValue() expects at most 1 argument, 2 given +ArgumentCountError: ReflectionProperty::getValue() expects at most 1 argument, 2 given Protected property: int(4) Invalid instance: -Given object is not an instance of the class this property was declared in +ReflectionException: Given object is not an instance of the class this property was declared in Missing instance: -ReflectionProperty::getValue(): Argument #1 ($object) must be provided for instance properties +TypeError: ReflectionProperty::getValue(): Argument #1 ($object) must be provided for instance properties diff --git a/ext/reflection/tests/ReflectionProperty_isInitialized.phpt b/ext/reflection/tests/ReflectionProperty_isInitialized.phpt index 2ba6ff438bd1..215572c921f5 100644 --- a/ext/reflection/tests/ReflectionProperty_isInitialized.phpt +++ b/ext/reflection/tests/ReflectionProperty_isInitialized.phpt @@ -55,13 +55,13 @@ var_dump($rp->isInitialized($a)); try { var_dump($rp->isInitialized(new stdClass)); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($rp->isInitialized()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class WithMagic { @@ -109,8 +109,8 @@ bool(false) bool(false) Object type: bool(false) -Given object is not an instance of the class this property was declared in -ReflectionProperty::isInitialized(): Argument #1 ($object) must be provided for instance properties +ReflectionException: Given object is not an instance of the class this property was declared in +TypeError: ReflectionProperty::isInitialized(): Argument #1 ($object) must be provided for instance properties Class with __isset: bool(false) bool(false) diff --git a/ext/reflection/tests/ReflectionProperty_lazy_initialization_errors.phpt b/ext/reflection/tests/ReflectionProperty_lazy_initialization_errors.phpt index 8bd82ff64020..1ee8da8ed942 100644 --- a/ext/reflection/tests/ReflectionProperty_lazy_initialization_errors.phpt +++ b/ext/reflection/tests/ReflectionProperty_lazy_initialization_errors.phpt @@ -17,12 +17,12 @@ function test(object $obj, string $propertyName) { try { $r->setRawValueWithoutLazyInitialization($obj, true); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r->skipLazyInitialization($obj); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -38,14 +38,11 @@ test($obj, 'name'); ?> --EXPECT-- -Cannot use setRawValueWithoutLazyInitialization() on static property Demo::$myStatic -Cannot use skipLazyInitialization() on static property Demo::$myStatic - -Cannot use setRawValueWithoutLazyInitialization() on virtual property Demo::$myVirtual -Cannot use skipLazyInitialization() on virtual property Demo::$myVirtual - -Cannot use setRawValueWithoutLazyInitialization() on dynamic property Demo::$myDynamic -Cannot use skipLazyInitialization() on dynamic property Demo::$myDynamic - -Cannot use setRawValueWithoutLazyInitialization() on internal class ReflectionClass -Cannot use skipLazyInitialization() on internal class ReflectionClass +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on static property Demo::$myStatic +ReflectionException: Cannot use skipLazyInitialization() on static property Demo::$myStatic +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on virtual property Demo::$myVirtual +ReflectionException: Cannot use skipLazyInitialization() on virtual property Demo::$myVirtual +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on dynamic property Demo::$myDynamic +ReflectionException: Cannot use skipLazyInitialization() on dynamic property Demo::$myDynamic +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on internal class ReflectionClass +ReflectionException: Cannot use skipLazyInitialization() on internal class ReflectionClass diff --git a/ext/reflection/tests/ReflectionProperty_setValue_readonly.phpt b/ext/reflection/tests/ReflectionProperty_setValue_readonly.phpt index ddab2497a326..9cfe0acf9ed7 100644 --- a/ext/reflection/tests/ReflectionProperty_setValue_readonly.phpt +++ b/ext/reflection/tests/ReflectionProperty_setValue_readonly.phpt @@ -12,12 +12,12 @@ $reflection = new ReflectionProperty(Foo::class, 'value'); try { $reflection->setValue(Foo::Bar, 1); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Foo::Bar->value); ?> --EXPECT-- -Cannot modify readonly property Foo::$value +Error: Cannot modify readonly property Foo::$value int(0) diff --git a/ext/reflection/tests/ReflectionProperty_typed_static.phpt b/ext/reflection/tests/ReflectionProperty_typed_static.phpt index 032f9b18ef30..aefc73eb2201 100644 --- a/ext/reflection/tests/ReflectionProperty_typed_static.phpt +++ b/ext/reflection/tests/ReflectionProperty_typed_static.phpt @@ -16,7 +16,7 @@ $rp = new ReflectionProperty('Test', 'y'); try { var_dump($rp->getValue()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $rp->setValue(null, "24"); @@ -25,7 +25,7 @@ var_dump($rp->getValue()); try { $rp->setValue(null, "foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($rp->getValue()); @@ -35,7 +35,7 @@ $rp = new ReflectionProperty('Test', 'z'); try { $rp->setValue(null, "foo"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($rp->getValue()); @@ -43,9 +43,9 @@ var_dump($rp->getValue()); ?> --EXPECT-- int(42) -Typed static property Test::$y must not be accessed before initialization +Error: Typed static property Test::$y must not be accessed before initialization int(24) -Cannot assign string to property Test::$y of type int +TypeError: Cannot assign string to property Test::$y of type int int(24) -Cannot assign string to reference held by property Test::$y of type int +TypeError: Cannot assign string to reference held by property Test::$y of type int int(24) diff --git a/ext/reflection/tests/ReflectionReference_errors.phpt b/ext/reflection/tests/ReflectionReference_errors.phpt index 8ef69e718a9c..4960b47c388a 100644 --- a/ext/reflection/tests/ReflectionReference_errors.phpt +++ b/ext/reflection/tests/ReflectionReference_errors.phpt @@ -6,26 +6,26 @@ Various error conditions for ReflectionReference try { new ReflectionReference(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ReflectionReference::fromArrayElement(new stdClass, "test"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ReflectionReference::fromArrayElement([], []); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ary = [0, 1, 2]; ReflectionReference::fromArrayElement($ary, 3); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -33,19 +33,19 @@ try { $ref = ReflectionReference::fromArrayElement($ary, 0); var_dump(serialize($ref)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:19:"ReflectionReference":0:{}')); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Call to private ReflectionReference::__construct() from global scope -ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, stdClass given -ReflectionReference::fromArrayElement(): Argument #2 ($key) must be of type string|int, array given -Array key not found -Serialization of 'ReflectionReference' is not allowed -Unserialization of 'ReflectionReference' is not allowed +Error: Call to private ReflectionReference::__construct() from global scope +TypeError: ReflectionReference::fromArrayElement(): Argument #1 ($array) must be of type array, stdClass given +TypeError: ReflectionReference::fromArrayElement(): Argument #2 ($key) must be of type string|int, array given +ReflectionException: Array key not found +Exception: Serialization of 'ReflectionReference' is not allowed +Exception: Unserialization of 'ReflectionReference' is not allowed diff --git a/ext/reflection/tests/ReflectionZendExtension_error.phpt b/ext/reflection/tests/ReflectionZendExtension_error.phpt index af716c43072c..aad4e54437ff 100644 --- a/ext/reflection/tests/ReflectionZendExtension_error.phpt +++ b/ext/reflection/tests/ReflectionZendExtension_error.phpt @@ -9,9 +9,9 @@ opcache try { new ReflectionZendExtension('zend_opcache'); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Zend Extension "zend_opcache" does not exist +ReflectionException: Zend Extension "zend_opcache" does not exist diff --git a/ext/reflection/tests/bug38217.phpt b/ext/reflection/tests/bug38217.phpt index cc7525c813e0..d1df38496387 100644 --- a/ext/reflection/tests/bug38217.phpt +++ b/ext/reflection/tests/bug38217.phpt @@ -21,7 +21,7 @@ $class= new ReflectionClass('ObjectTwo'); try { var_dump($class->newInstanceArgs()); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($class->newInstanceArgs(array('test'))); @@ -31,7 +31,7 @@ echo "Done\n"; --EXPECTF-- object(ObjectOne)#%d (0) { } -Exception: Too few arguments to function ObjectTwo::__construct(), 0 passed and exactly 1 expected +ArgumentCountError: Too few arguments to function ObjectTwo::__construct(), 0 passed and exactly 1 expected string(4) "test" object(ObjectTwo)#%d (0) { } diff --git a/ext/reflection/tests/bug41061.phpt b/ext/reflection/tests/bug41061.phpt index df807566dbb0..0d2b68b0a9a3 100644 --- a/ext/reflection/tests/bug41061.phpt +++ b/ext/reflection/tests/bug41061.phpt @@ -22,4 +22,3 @@ Function [ function foo ] { Method [ private method foo ] { @@ %sbug41061.php 7 - 8 } - diff --git a/ext/reflection/tests/bug46064.phpt b/ext/reflection/tests/bug46064.phpt index 49d3760941e2..70c106313662 100644 --- a/ext/reflection/tests/bug46064.phpt +++ b/ext/reflection/tests/bug46064.phpt @@ -24,7 +24,7 @@ print "---------------------------\n"; try { var_dump(new reflectionproperty($o, 'zz')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(new reflectionproperty($o, 'zzz')); @@ -64,7 +64,7 @@ array(1) { } int(1000) --------------------------- -string(30) "Property x::$zz does not exist" +ReflectionException: Property x::$zz does not exist object(ReflectionProperty)#%d (2) { ["name"]=> string(3) "zzz" diff --git a/ext/reflection/tests/bug49719.phpt b/ext/reflection/tests/bug49719.phpt index 1a0ffca4bd2d..e05e1a93ff90 100644 --- a/ext/reflection/tests/bug49719.phpt +++ b/ext/reflection/tests/bug49719.phpt @@ -19,7 +19,7 @@ try { var_dump($ref->hasProperty('a')); var_dump($ref->getProperty('a')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } class A2 { @@ -39,5 +39,5 @@ var_dump($prop->getValue(new b2)); bool(false) bool(false) bool(false) -string(29) "Property B::$a does not exist" +ReflectionException: Property B::$a does not exist int(2) diff --git a/ext/reflection/tests/bug52854.phpt b/ext/reflection/tests/bug52854.phpt index 2d174bc11eba..5714551054b3 100644 --- a/ext/reflection/tests/bug52854.phpt +++ b/ext/reflection/tests/bug52854.phpt @@ -13,7 +13,7 @@ var_dump($c->newInstanceArgs(array())); try { var_dump($c->newInstanceArgs(array(1))); } catch(ReflectionException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -25,4 +25,4 @@ object(Test)#%d (0) { } object(Test)#%d (0) { } -Class Test does not have a constructor, so you cannot pass any constructor arguments +ReflectionException: Class Test does not have a constructor, so you cannot pass any constructor arguments diff --git a/ext/reflection/tests/bug64007.phpt b/ext/reflection/tests/bug64007.phpt index a25beb6360d7..66a99f4fcd03 100644 --- a/ext/reflection/tests/bug64007.phpt +++ b/ext/reflection/tests/bug64007.phpt @@ -7,14 +7,14 @@ try { $generator = $reflection->newInstanceWithoutConstructor(); var_dump($generator); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } $generator = $reflection->newInstance(); var_dump($generator); ?> --EXPECTF-- -string(%d) "Class Generator is an internal class marked as final that cannot be instantiated without invoking its constructor" +ReflectionException: Class Generator is an internal class marked as final that cannot be instantiated without invoking its constructor Fatal error: Uncaught Error: The "Generator" class is reserved for internal use and cannot be manually instantiated in %sbug64007.php:%d Stack trace: diff --git a/ext/reflection/tests/bug71018.phpt b/ext/reflection/tests/bug71018.phpt index cbbb7325e9f1..40dece658509 100644 --- a/ext/reflection/tests/bug71018.phpt +++ b/ext/reflection/tests/bug71018.phpt @@ -34,7 +34,7 @@ set_error_handler(function ($severity, $message, $file, $line) { try { $Prop2->setValue(\T2::class, 'hi'); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump("T2::self = " . T2::getDataByStatic()); @@ -53,7 +53,7 @@ Deprecated: Calling ReflectionProperty::setValue() with a 1st argument which is Deprecated: Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated in %s on line %d string(16) "T2::self = hello" string(18) "T2::static = hello" -Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated +Exception: Calling ReflectionProperty::setValue() with a 1st argument which is not null or an object is deprecated string(16) "T2::self = hello" string(16) "T2::self = hello" string(18) "T2::static = hello" diff --git a/ext/reflection/tests/bug74454.phpt b/ext/reflection/tests/bug74454.phpt index 272409339c47..3369cdebaeb5 100644 --- a/ext/reflection/tests/bug74454.phpt +++ b/ext/reflection/tests/bug74454.phpt @@ -6,7 +6,7 @@ spl_autoload_register('load_file'); try { $x = new ReflectionMethod('A', 'b'); } catch (\Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } function load_file() { diff --git a/ext/reflection/tests/bug74949.phpt b/ext/reflection/tests/bug74949.phpt index 858e766c0144..08a31808e076 100644 --- a/ext/reflection/tests/bug74949.phpt +++ b/ext/reflection/tests/bug74949.phpt @@ -14,11 +14,11 @@ echo $r, "\n"; try { echo $r->getPrototype(); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Method [ public method __invoke ] { } -Method Closure::__invoke() does not have a prototype +ReflectionException: Method Closure::__invoke() does not have a prototype diff --git a/ext/reflection/tests/bug76737.phpt b/ext/reflection/tests/bug76737.phpt index 3fe1c5443ba7..bd7904d614b1 100644 --- a/ext/reflection/tests/bug76737.phpt +++ b/ext/reflection/tests/bug76737.phpt @@ -7,22 +7,22 @@ try { $r = new ReflectionClass('stdClass'); var_dump(serialize($r)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $s = 'C:15:"ReflectionClass":0:{}'; var_dump(unserialize($s)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $s = 'O:15:"ReflectionClass":0:{}'; var_dump(unserialize($s)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Serialization of 'ReflectionClass' is not allowed -Unserialization of 'ReflectionClass' is not allowed -Unserialization of 'ReflectionClass' is not allowed +Exception: Serialization of 'ReflectionClass' is not allowed +Exception: Unserialization of 'ReflectionClass' is not allowed +Exception: Unserialization of 'ReflectionClass' is not allowed diff --git a/ext/reflection/tests/bug78697.phpt b/ext/reflection/tests/bug78697.phpt index b35d0f4d4ef6..bb0e69b77b2c 100644 --- a/ext/reflection/tests/bug78697.phpt +++ b/ext/reflection/tests/bug78697.phpt @@ -7,8 +7,8 @@ trait T {} try { (new ReflectionClass(new stdClass))->implementsInterface(T::class); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -T is not an interface +ReflectionException: T is not an interface diff --git a/ext/reflection/tests/bug78895.phpt b/ext/reflection/tests/bug78895.phpt index b5f84e2d02ba..c39c8bab2edd 100644 --- a/ext/reflection/tests/bug78895.phpt +++ b/ext/reflection/tests/bug78895.phpt @@ -35,4 +35,4 @@ array(0) { array(0) { } array(0) { -} \ No newline at end of file +} diff --git a/ext/reflection/tests/bug81208.phpt b/ext/reflection/tests/bug81208.phpt index 6b4753522d41..0e30697f1d05 100644 --- a/ext/reflection/tests/bug81208.phpt +++ b/ext/reflection/tests/bug81208.phpt @@ -19,10 +19,10 @@ foreach ($z->getProperty("property")->getAttributes() as $attribute) { try { $attribute->newInstance(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Undefined constant "asdasdasd" +Error: Undefined constant "asdasdasd" diff --git a/ext/reflection/tests/default_value_internal_userland_arginfo.phpt b/ext/reflection/tests/default_value_internal_userland_arginfo.phpt index b55a9463791b..3e4c2d32af6b 100644 --- a/ext/reflection/tests/default_value_internal_userland_arginfo.phpt +++ b/ext/reflection/tests/default_value_internal_userland_arginfo.phpt @@ -12,7 +12,7 @@ var_dump($rp->isDefaultValueAvailable()); try { var_dump($rp->getDefaultValue()); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -24,4 +24,4 @@ Method [ public method __invoke ] { } bool(false) -Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value diff --git a/ext/reflection/tests/gh12856.phpt b/ext/reflection/tests/gh12856.phpt index 519a222ab0ed..bd45c8ae3d3f 100644 --- a/ext/reflection/tests/gh12856.phpt +++ b/ext/reflection/tests/gh12856.phpt @@ -14,7 +14,7 @@ var_dump($rc->getStaticPropertyValue('untyped')); try { var_dump($rc->getStaticPropertyValue('typed1')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($rc->getStaticPropertyValue('typed1', 1)); var_dump($rc->getStaticPropertyValue('typed2')); @@ -22,6 +22,6 @@ var_dump($rc->getStaticPropertyValue('typed2')); ?> --EXPECT-- NULL -Typed property Bug::$typed1 must not be accessed before initialization +Error: Typed property Bug::$typed1 must not be accessed before initialization int(1) int(3) diff --git a/ext/reflection/tests/gh21362.phpt b/ext/reflection/tests/gh21362.phpt index 1f5619ce779d..100fcb2b5b04 100644 --- a/ext/reflection/tests/gh21362.phpt +++ b/ext/reflection/tests/gh21362.phpt @@ -21,7 +21,7 @@ try { $m->invokeArgs($c2, ['foo' => 'FOO', 'bar' => 'BAR']); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // invoke with a different Closure should also throw @@ -29,7 +29,7 @@ try { $m->invoke($c2, 'FOO', 'BAR'); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Closures from the same source (e.g. loop) share the same op_array @@ -60,7 +60,7 @@ try { $m3->invoke($of, 'test'); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Internal closures (first-class callable syntax) should also be validated @@ -79,7 +79,7 @@ try { $m4->invoke($pr, 'should not print'); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Cross-type: userland Closure to internal Closure's invoke should throw @@ -87,7 +87,7 @@ try { $m4->invoke($c1, 'should not print'); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Cross-type: internal Closure to userland Closure's invoke should throw @@ -95,21 +95,21 @@ try { $m->invoke($vd, 'should not print'); echo "No exception thrown\n"; } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- c1: foo=FOO, bar=BAR -Given Closure is not the same as the reflected Closure -Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure int(0) int(1) int(2) string(13) "my_func: test" string(13) "my_func: test" -Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure string(19) "internal closure OK" string(26) "cloned internal closure OK" -Given Closure is not the same as the reflected Closure -Given Closure is not the same as the reflected Closure -Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure +ReflectionException: Given Closure is not the same as the reflected Closure diff --git a/ext/reflection/tests/gh8982.phpt b/ext/reflection/tests/gh8982.phpt index 0bbda8bfb915..93253621502d 100644 --- a/ext/reflection/tests/gh8982.phpt +++ b/ext/reflection/tests/gh8982.phpt @@ -30,7 +30,7 @@ function test(string $attributeClass, $value) { try { var_dump((new ReflectionFunction($value))->getAttributes($attributeClass)[0]->newInstance()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -46,7 +46,7 @@ test(M::class, $m); --EXPECT-- object(F)#4 (0) { } -Attribute "M" cannot target function (allowed targets: method) -Attribute "F" cannot target method (allowed targets: function) +Error: Attribute "M" cannot target function (allowed targets: method) +Error: Attribute "F" cannot target method (allowed targets: function) object(M)#4 (0) { } diff --git a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValueConstantName_Internal.phpt b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValueConstantName_Internal.phpt index b6473b0a3abb..7b93ac4f7997 100644 --- a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValueConstantName_Internal.phpt +++ b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValueConstantName_Internal.phpt @@ -9,7 +9,7 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->getDefaultValueConstantName()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -22,7 +22,7 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->getDefaultValueConstantName()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -35,14 +35,14 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->getDefaultValueConstantName()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } ?> --EXPECT-- -Internal error: Failed to retrieve the default value -Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value NULL NULL ---------- diff --git a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValue_Internal.phpt b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValue_Internal.phpt index c1e1a14b279b..b5c051ecd6f7 100644 --- a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValue_Internal.phpt +++ b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_getDefaultValue_Internal.phpt @@ -9,7 +9,7 @@ foreach ($method->getParameters() as $k => $parameter) { try { var_dump($parameter->getDefaultValue()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -22,14 +22,14 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->getDefaultValue()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } ?> --EXPECT-- -Internal error: Failed to retrieve the default value -Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value int(0) int(0) ---------- diff --git a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_isDefaultValueConstant_Internal.phpt b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_isDefaultValueConstant_Internal.phpt index 35c554807492..42e118ccb9e6 100644 --- a/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_isDefaultValueConstant_Internal.phpt +++ b/ext/reflection/tests/internal_parameter_default_value/ReflectionParameter_isDefaultValueConstant_Internal.phpt @@ -9,7 +9,7 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->isDefaultValueConstant()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -22,13 +22,13 @@ foreach ($method->getParameters() as $parameter) { try { var_dump($parameter->isDefaultValueConstant()); } catch (ReflectionException $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } ?> --EXPECT-- -Internal error: Failed to retrieve the default value -Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value +ReflectionException: Internal error: Failed to retrieve the default value bool(false) bool(false) ---------- diff --git a/ext/reflection/tests/internal_parameter_default_value/check_all.phpt b/ext/reflection/tests/internal_parameter_default_value/check_all.phpt index 241dea449b61..f08a4ea18e1f 100644 --- a/ext/reflection/tests/internal_parameter_default_value/check_all.phpt +++ b/ext/reflection/tests/internal_parameter_default_value/check_all.phpt @@ -9,7 +9,7 @@ function checkDefaults(ReflectionFunctionAbstract $rf) { try { $param->getDefaultValue(); } catch (Error $e) { - echo "{$rf->getName()}: {$e->getMessage()}\n"; + echo $rf->getName(), ': ', $e::class, ': ', $e->getMessage(), "\n"; } } } diff --git a/ext/reflection/tests/parameters_001.phpt b/ext/reflection/tests/parameters_001.phpt index d50d1a1e720f..31455980eb65 100644 --- a/ext/reflection/tests/parameters_001.phpt +++ b/ext/reflection/tests/parameters_001.phpt @@ -23,13 +23,13 @@ try { $p = new ReflectionParameter(array('Test', 'func'), 'z'); var_dump($p->isOptional()); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $p = new ReflectionParameter(array('Test', 'func'), -1); var_dump($p->isOptional()); } catch (\ValueError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -38,5 +38,5 @@ int(2) int(1) bool(false) bool(true) -string(54) "The parameter specified by its name could not be found" -string(91) "ReflectionParameter::__construct(): Argument #2 ($param) must be greater than or equal to 0" +ReflectionException: The parameter specified by its name could not be found +ValueError: ReflectionParameter::__construct(): Argument #2 ($param) must be greater than or equal to 0 diff --git a/ext/reflection/tests/parameters_002.phpt b/ext/reflection/tests/parameters_002.phpt index 2ef0ca4c0cc8..261c38c91cf6 100644 --- a/ext/reflection/tests/parameters_002.phpt +++ b/ext/reflection/tests/parameters_002.phpt @@ -52,7 +52,7 @@ function check_params($r) } catch(ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } check_params_decl_class($p, 'getDeclaringClass'); // check_params_decl_func($p, 'getDeclaringFunction'); @@ -132,7 +132,7 @@ getName: string(2) "na" isPassedByReference: bool(false) Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d -Class "NonExistingClass" does not exist +ReflectionException: Class "NonExistingClass" does not exist getDeclaringClass: NULL isArray: Deprecated: Method ReflectionParameter::isArray() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d @@ -226,7 +226,7 @@ getName: string(2) "na" isPassedByReference: bool(false) Deprecated: Method ReflectionParameter::getClass() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d -Class "NonExistingClass" does not exist +ReflectionException: Class "NonExistingClass" does not exist getDeclaringClass: test isArray: Deprecated: Method ReflectionParameter::isArray() is deprecated since 8.0, use ReflectionParameter::getType() instead in %s on line %d diff --git a/ext/reflection/tests/property_exists.phpt b/ext/reflection/tests/property_exists.phpt index 879b9c4a585b..792cc485de20 100644 --- a/ext/reflection/tests/property_exists.phpt +++ b/ext/reflection/tests/property_exists.phpt @@ -82,12 +82,12 @@ echo "===PROBLEMS===\n"; try { var_dump(property_exists(NULL, 'empty')); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(property_exists(25,'empty')); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(property_exists('','')); var_dump(property_exists('A','')); @@ -211,8 +211,8 @@ bool(true) obj(C)::$e bool(false) ===PROBLEMS=== -property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given -property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given bool(false) bool(false) bool(false) diff --git a/ext/reflection/tests/property_hooks/ReflectionProperty_getSetRawValue.phpt b/ext/reflection/tests/property_hooks/ReflectionProperty_getSetRawValue.phpt index bae5608bb44b..636608f69013 100644 --- a/ext/reflection/tests/property_hooks/ReflectionProperty_getSetRawValue.phpt +++ b/ext/reflection/tests/property_hooks/ReflectionProperty_getSetRawValue.phpt @@ -51,12 +51,12 @@ function test($class, $prop) { try { $propertyReflection->setRawValue($object, 42); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($propertyReflection->getRawValue($object)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -70,7 +70,7 @@ test(Unguarded::class, 'plainProp'); --EXPECT-- int(42) int(42) -Must not write to virtual property Test::$virtualProp -Must not read from virtual property Test::$virtualProp +Error: Must not write to virtual property Test::$virtualProp +Error: Must not read from virtual property Test::$virtualProp int(42) int(42) diff --git a/ext/reflection/tests/property_hooks/basics.phpt b/ext/reflection/tests/property_hooks/basics.phpt index 6011018c64cf..b6a3c98985e4 100644 --- a/ext/reflection/tests/property_hooks/basics.phpt +++ b/ext/reflection/tests/property_hooks/basics.phpt @@ -45,7 +45,7 @@ var_dump($g->invoke($test)); try { $s->invoke($test, 42); } catch (ReflectionException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $s->invoke($test, 42); var_dump($test->prop2); diff --git a/ext/reflection/tests/property_hooks/gh17713.phpt b/ext/reflection/tests/property_hooks/gh17713.phpt index edd0e1204658..e184a92dffe7 100644 --- a/ext/reflection/tests/property_hooks/gh17713.phpt +++ b/ext/reflection/tests/property_hooks/gh17713.phpt @@ -95,23 +95,23 @@ function test($scope, $class, $prop) { try { $propertyReflection->setRawValue($object, 42); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($propertyReflection->getRawValue($object)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $propertyReflection->setRawValueWithoutLazyInitialization($object, 43); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($propertyReflection->getRawValue($object)); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if ($prop === 'privateProp') { printf( @@ -155,15 +155,15 @@ int(43) int(42) int(43) # Accessing Base->virtualProp from scope Base -Must not write to virtual property Base::$virtualProp -Must not read from virtual property Base::$virtualProp -Cannot use setRawValueWithoutLazyInitialization() on virtual property Base::$virtualProp -Must not read from virtual property Base::$virtualProp +Error: Must not write to virtual property Base::$virtualProp +Error: Must not read from virtual property Base::$virtualProp +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on virtual property Base::$virtualProp +Error: Must not read from virtual property Base::$virtualProp # Accessing Test->dynamicProp from scope Base int(42) int(43) # Accessing Test->changedProp from scope Base -May not use setRawValue on static properties -May not use getRawValue on static properties -Cannot use setRawValueWithoutLazyInitialization() on static property Test::$changedProp -May not use getRawValue on static properties +ReflectionException: May not use setRawValue on static properties +ReflectionException: May not use getRawValue on static properties +ReflectionException: Cannot use setRawValueWithoutLazyInitialization() on static property Test::$changedProp +ReflectionException: May not use getRawValue on static properties diff --git a/ext/reflection/tests/request38992.phpt b/ext/reflection/tests/request38992.phpt index 547b2d252313..7c4f5f8a2623 100644 --- a/ext/reflection/tests/request38992.phpt +++ b/ext/reflection/tests/request38992.phpt @@ -14,14 +14,14 @@ $r = new ReflectionMethod('MyClass', 'doSomething'); try { $r->invoke('WTF?'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r->invokeArgs('WTF?', array()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, string given -ReflectionMethod::invokeArgs(): Argument #1 ($object) must be of type ?object, string given +TypeError: ReflectionMethod::invoke(): Argument #1 ($object) must be of type ?object, string given +TypeError: ReflectionMethod::invokeArgs(): Argument #1 ($object) must be of type ?object, string given diff --git a/ext/reflection/tests/static_properties_with_typed_class_constants1.phpt b/ext/reflection/tests/static_properties_with_typed_class_constants1.phpt index cebfa1dddd3e..a4d8308174cf 100644 --- a/ext/reflection/tests/static_properties_with_typed_class_constants1.phpt +++ b/ext/reflection/tests/static_properties_with_typed_class_constants1.phpt @@ -16,9 +16,9 @@ $foo = new ReflectionClass(Foo::class); try { $foo->getStaticProperties(); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot assign string to class constant Foo::CONST1 of type int +TypeError: Cannot assign string to class constant Foo::CONST1 of type int diff --git a/ext/session/tests/bug73100.phpt b/ext/session/tests/bug73100.phpt index fc9984428726..125849c06559 100644 --- a/ext/session/tests/bug73100.phpt +++ b/ext/session/tests/bug73100.phpt @@ -15,7 +15,7 @@ var_dump(session_destroy()); try { session_module_name("user"); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> ===DONE=== @@ -24,5 +24,5 @@ bool(true) Warning: session_module_name(): Session save handler module cannot be changed when a session is active (started from %s on line %d) in %s on line %d bool(true) -session_module_name(): Argument #1 ($module) must not be "user" +ValueError: session_module_name(): Argument #1 ($module) must not be "user" ===DONE=== diff --git a/ext/session/tests/session_create_id_invalid_prefix.phpt b/ext/session/tests/session_create_id_invalid_prefix.phpt index 7de7e8061f68..4d84944f5cfe 100644 --- a/ext/session/tests/session_create_id_invalid_prefix.phpt +++ b/ext/session/tests/session_create_id_invalid_prefix.phpt @@ -16,13 +16,13 @@ var_dump(session_create_id('%')); try { var_dump(session_create_id('ABTgdPs68S3M4HMaqKwj33TzqLMv5PHpWQxJbfpeogEhrJRY7o9f33pKLCmhf0tXCtoBkIu0yxXYCSHfJhPd2miPUW4MIpd91dnEiOwWDfaBnfdJZOwgvgmYLSfDGaebqmnCAoyuzlcq2j59nNRhccgJIkr9ytY3RwFTTXszpcjpx6mlJuG9GksKAhPsnnaEwSEb0eFyqvn80gYI2roKSjaFSmJxg0xgXuCF4csMo8DxiSvovho5QTKx5u7h8VyQL')); } catch (Throwable $e) { - echo $e::class . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(session_create_id("AB\0CD")); } catch (Throwable $e) { - echo $e::class . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/session/tests/session_encode_error2.phpt b/ext/session/tests/session_encode_error2.phpt index 42f5c4dd6888..5bdc263f3679 100644 --- a/ext/session/tests/session_encode_error2.phpt +++ b/ext/session/tests/session_encode_error2.phpt @@ -34,7 +34,7 @@ foreach($inputs as $input) { try { $_SESSION[$input] = "Hello World!"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(session_encode()); var_dump(session_destroy()); diff --git a/ext/session/tests/session_gc_probability_ini.phpt b/ext/session/tests/session_gc_probability_ini.phpt index 6d6f7519ba41..5efd2ddc809e 100644 --- a/ext/session/tests/session_gc_probability_ini.phpt +++ b/ext/session/tests/session_gc_probability_ini.phpt @@ -36,7 +36,7 @@ try { session_start($gc_setting); session_write_close(); } catch (Throwable $e) { - echo $e::class, ': '. $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ob_end_flush(); diff --git a/ext/session/tests/session_name_variation_null_byte.phpt b/ext/session/tests/session_name_variation_null_byte.phpt index 84b6ccfb1e6b..86c67cb035ec 100644 --- a/ext/session/tests/session_name_variation_null_byte.phpt +++ b/ext/session/tests/session_name_variation_null_byte.phpt @@ -11,11 +11,11 @@ try { var_dump(session_name("AB\0CD")); var_dump(session_start()); } catch (ValueError $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- -session_name(): Argument #1 ($name) must not contain any null bytes +ValueError: session_name(): Argument #1 ($name) must not contain any null bytes Done diff --git a/ext/session/tests/session_set_cookie_params_variation7.phpt b/ext/session/tests/session_set_cookie_params_variation7.phpt index 3780fc0222f1..4874192ae147 100644 --- a/ext/session/tests/session_set_cookie_params_variation7.phpt +++ b/ext/session/tests/session_set_cookie_params_variation7.phpt @@ -22,13 +22,13 @@ echo "*** Testing session_set_cookie_params() : array parameter variation ***\n" try { session_set_cookie_params([]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_cookie_params(["unknown_key" => true, "secure_invalid" => true]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(ini_get("session.cookie_secure")); @@ -46,7 +46,7 @@ var_dump(ini_get("session.cookie_path")); try { session_set_cookie_params(["path" => "newpath/"], "arg after options array"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(ini_get("session.cookie_path")); @@ -56,12 +56,12 @@ ob_end_flush(); ?> --EXPECTF-- *** Testing session_set_cookie_params() : array parameter variation *** -session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key +ValueError: session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "unknown_key" in %s on line %d Warning: session_set_cookie_params(): Argument #1 ($lifetime_or_options) contains an unrecognized key "secure_invalid" in %s on line %d -session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key +ValueError: session_set_cookie_params(): Argument #1 ($lifetime_or_options) must contain at least 1 valid key string(1) "0" string(0) "" bool(true) @@ -71,6 +71,6 @@ string(1) "0" bool(true) string(2) "42" string(1) "/" -session_set_cookie_params(): Argument #2 ($path) must be null when argument #1 ($lifetime_or_options) is an array +ValueError: session_set_cookie_params(): Argument #2 ($path) must be null when argument #1 ($lifetime_or_options) is an array string(1) "/" Done diff --git a/ext/session/tests/session_start_error.phpt b/ext/session/tests/session_start_error.phpt index f616b8d4e95d..05e09a2faf6a 100644 --- a/ext/session/tests/session_start_error.phpt +++ b/ext/session/tests/session_start_error.phpt @@ -12,7 +12,7 @@ ob_start(); try { session_start(['option' => new stdClass()]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $read_and_close = "false"; @@ -20,7 +20,7 @@ $read_and_close = "false"; try { session_start([$read_and_close]); } catch (ValueError $exception) { - echo $exception::class, ': ', $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(session_start(['option' => false])); @@ -29,7 +29,7 @@ ob_end_flush(); ?> --EXPECTF-- -session_start(): Option "option" must be of type string|int|bool, stdClass given +TypeError: session_start(): Option "option" must be of type string|int|bool, stdClass given ValueError: session_start(): Argument #1 ($options) must be of type array with keys as string Warning: session_start(): Setting option "option" failed in %s on line %d diff --git a/ext/session/tests/user_session_module/bug31454.phpt b/ext/session/tests/user_session_module/bug31454.phpt index 09858be34bd2..2098c1a48fc5 100644 --- a/ext/session/tests/user_session_module/bug31454.phpt +++ b/ext/session/tests/user_session_module/bug31454.phpt @@ -15,12 +15,12 @@ try { array(&$arf, 'gc') ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECTF-- Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #1 ($open) must be a valid callback, first array member is not a valid class name or object +TypeError: session_set_save_handler(): Argument #1 ($open) must be a valid callback, first array member is not a valid class name or object Done diff --git a/ext/session/tests/user_session_module/bug55688.phpt b/ext/session/tests/user_session_module/bug55688.phpt index b1fcec38228c..55047dc6b9c7 100644 --- a/ext/session/tests/user_session_module/bug55688.phpt +++ b/ext/session/tests/user_session_module/bug55688.phpt @@ -13,8 +13,8 @@ $x = new SessionHandler; try { $x->gc(1); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Session is not active +Error: Session is not active diff --git a/ext/session/tests/user_session_module/bug67972.phpt b/ext/session/tests/user_session_module/bug67972.phpt index a35b3ac08a26..5beea5bf15e3 100644 --- a/ext/session/tests/user_session_module/bug67972.phpt +++ b/ext/session/tests/user_session_module/bug67972.phpt @@ -8,9 +8,9 @@ session try { (new SessionHandler)->create_sid(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Session is not active +Error: Session is not active diff --git a/ext/session/tests/user_session_module/bug69111.phpt b/ext/session/tests/user_session_module/bug69111.phpt index 395eb33900ed..c3d9a325da79 100644 --- a/ext/session/tests/user_session_module/bug69111.phpt +++ b/ext/session/tests/user_session_module/bug69111.phpt @@ -12,23 +12,23 @@ session_set_save_handler($sh); try { $sh->open('path', 'name'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $sh->write("foo", "bar"); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $sh->read(""); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Session is not active -Session is not active -Session is not active +Error: Session is not active +Error: Session is not active +Error: Session is not active diff --git a/ext/session/tests/user_session_module/session_set_save_handler_class_012.phpt b/ext/session/tests/user_session_module/session_set_save_handler_class_012.phpt index f96206efbb64..ee69e9f52a4e 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_class_012.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_class_012.phpt @@ -35,7 +35,7 @@ session_set_save_handler($handler); try { var_dump(session_start()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i, $_SESSION); @@ -43,7 +43,7 @@ var_dump(session_id(), $oldHandler, ini_get('session.save_handler'), $handler->i --EXPECTF-- *** Testing session_set_save_handler() : incorrect arguments for existing handler open *** Open: -SessionHandler::open() expects exactly 2 arguments, 0 given +ArgumentCountError: SessionHandler::open() expects exactly 2 arguments, 0 given Warning: Undefined global variable $_SESSION in %s on line %d string(0) "" diff --git a/ext/session/tests/user_session_module/session_set_save_handler_error4.phpt b/ext/session/tests/user_session_module/session_set_save_handler_error4.phpt index 6e05c209a799..1cac1bd95bd4 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_error4.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_error4.phpt @@ -14,37 +14,37 @@ function callback() { return true; } try { session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_save_handler("callback", "echo", "callback", "callback", "callback", "callback"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_save_handler("callback", "callback", "echo", "callback", "callback", "callback"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_save_handler("callback", "callback", "callback", "echo", "callback", "callback"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_save_handler("callback", "callback", "callback", "callback", "echo", "callback"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { session_set_save_handler("callback", "callback", "callback", "callback", "callback", "echo"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } session_set_save_handler("callback", "callback", "callback", "callback", "callback", "callback"); @@ -58,19 +58,19 @@ ob_end_flush(); Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #2 ($close) must be a valid callback, function "echo" not found or invalid function name +TypeError: session_set_save_handler(): Argument #2 ($close) must be a valid callback, function "echo" not found or invalid function name Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name +TypeError: session_set_save_handler(): Argument #3 ($read) must be a valid callback, function "echo" not found or invalid function name Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name +TypeError: session_set_save_handler(): Argument #4 ($write) must be a valid callback, function "echo" not found or invalid function name Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name +TypeError: session_set_save_handler(): Argument #5 ($destroy) must be a valid callback, function "echo" not found or invalid function name Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name +TypeError: session_set_save_handler(): Argument #6 ($gc) must be a valid callback, function "echo" not found or invalid function name Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d diff --git a/ext/session/tests/user_session_module/session_set_save_handler_error5.phpt b/ext/session/tests/user_session_module/session_set_save_handler_error5.phpt index 4fc02237ba77..a44647085c28 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_error5.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_error5.phpt @@ -10,7 +10,7 @@ try { session_set_save_handler(new \SessionHandler(), true); session_start(); } catch (Throwable $e) { - echo $e::class . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok"; ?> diff --git a/ext/session/tests/user_session_module/session_set_save_handler_iface_002.phpt b/ext/session/tests/user_session_module/session_set_save_handler_iface_002.phpt index b1f0d4b2c57d..f8417ec9766f 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_iface_002.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_iface_002.phpt @@ -73,7 +73,7 @@ var_dump($ret); try { $ret = session_set_save_handler($handler); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } session_start(); @@ -83,7 +83,7 @@ session_start(); Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d bool(true) -session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given +TypeError: session_set_save_handler(): Argument #1 ($open) must be of type SessionHandlerInterface, MySession2 given good handler writing Deprecated: PHP Request Shutdown: Session callback must have a return value of type bool, int returned in Unknown on line 0 diff --git a/ext/session/tests/user_session_module/session_set_save_handler_type_error.phpt b/ext/session/tests/user_session_module/session_set_save_handler_type_error.phpt index 6d5fb1748cde..db17dc3320c0 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_type_error.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_type_error.phpt @@ -15,28 +15,28 @@ try { $ret = session_set_save_handler($exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $ret = session_set_save_handler($deprecatedCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $ret = session_set_save_handler($validCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $ret = session_set_save_handler($validCallback, $deprecatedCallback, $exceptionCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ob_end_flush(); @@ -44,7 +44,7 @@ ob_end_flush(); ?> --EXPECTF-- Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -Session callback must have a return value of type bool, array returned +TypeError: Session callback must have a return value of type bool, array returned Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d @@ -53,7 +53,7 @@ Deprecated: session_start(): Session callback must have a return value of type b Warning: session_start(): Failed to read session data: user (%s) in %s on line %d Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -Session callback must have a return value of type bool, array returned +TypeError: Session callback must have a return value of type bool, array returned Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d diff --git a/ext/session/tests/user_session_module/session_set_save_handler_type_error2.phpt b/ext/session/tests/user_session_module/session_set_save_handler_type_error2.phpt index 8c6b553f8111..b19471d4632d 100644 --- a/ext/session/tests/user_session_module/session_set_save_handler_type_error2.phpt +++ b/ext/session/tests/user_session_module/session_set_save_handler_type_error2.phpt @@ -15,13 +15,13 @@ try { $ret = session_set_save_handler($nullCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $ret = session_set_save_handler($oneCallback, $validCallback, $validCallback, $validCallback, $validCallback, $validCallback); session_start(); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ob_end_flush(); @@ -29,7 +29,7 @@ ob_end_flush(); ?> --EXPECTF-- Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -Session callback must have a return value of type bool, null returned +TypeError: Session callback must have a return value of type bool, null returned Deprecated: session_set_save_handler(): Providing individual callbacks instead of an object implementing SessionHandlerInterface is deprecated in %s on line %d -Session callback must have a return value of type bool, int returned +TypeError: Session callback must have a return value of type bool, int returned diff --git a/ext/session/tests/user_session_module/sessionhandler_open_001.phpt b/ext/session/tests/user_session_module/sessionhandler_open_001.phpt index d3f0bf989622..5263fe88a0c2 100644 --- a/ext/session/tests/user_session_module/sessionhandler_open_001.phpt +++ b/ext/session/tests/user_session_module/sessionhandler_open_001.phpt @@ -11,33 +11,33 @@ $x = new SessionHandler; try { $x->open('',''); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $x->open('',''); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $x->open('',''); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $x->open('',''); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } print "Done!\n"; ?> --EXPECT-- -Session is not active -Session is not active -Session is not active -Session is not active +Error: Session is not active +Error: Session is not active +Error: Session is not active +Error: Session is not active Done! diff --git a/ext/shmop/tests/001.phpt b/ext/shmop/tests/001.phpt index 71e4065193dc..1805838d2781 100644 --- a/ext/shmop/tests/001.phpt +++ b/ext/shmop/tests/001.phpt @@ -42,7 +42,7 @@ shmop try { shmop_write($shm_id, $write_d1, $written); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "shm open for read only: "; @@ -77,7 +77,7 @@ shm write test #1: ok data in memory is: test #1 of the shmop() extension shm open for read only: ok data in memory is: test #1 of the shmop() extension -Read-only segment cannot be written +Error: Read-only segment cannot be written shm open for read only: ok shm write test #2: ok data in memory is: test #1 of the shmop() extensiontest #2 append data to shared memory segment diff --git a/ext/shmop/tests/002.phpt b/ext/shmop/tests/002.phpt index 56aea8fcdcb9..5372b0e95466 100644 --- a/ext/shmop/tests/002.phpt +++ b/ext/shmop/tests/002.phpt @@ -13,13 +13,13 @@ echo PHP_EOL, '## shmop_open function tests ##', PHP_EOL; try { shmop_open(1338, '', 0644, 1024); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shmop_open(1338, 'b', 0644, 1024); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Warning outputs: Unable to attach or create shared memory segment @@ -29,14 +29,14 @@ var_dump(shmop_open(0, 'a', 0644, 1024)); try { shmop_open(0, 'a', 0644, 1024); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } //Shared memory segment size must be greater than zero try { shmop_open(1338, "c", 0666, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo PHP_EOL, '## shmop_read function tests ##', PHP_EOL; @@ -45,7 +45,7 @@ $shm_id = shmop_open(1338, 'n', 0600, 1024); try { shmop_read($shm_id, -10, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } shmop_delete($shm_id); @@ -54,7 +54,7 @@ $shm_id = shmop_open(1339, 'n', 0600, 1024); try { shmop_read($shm_id, 0, -10); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } shmop_delete($shm_id); @@ -64,24 +64,24 @@ $shm_id = shmop_open(1340, 'n', 0600, 1024); try { shmop_write($shm_id, 'text to try write', -10); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } shmop_delete($shm_id); ?> --EXPECTF-- ## shmop_open function tests ## -shmop_open(): Argument #2 ($mode) must be a valid access mode -shmop_open(): Argument #2 ($mode) must be a valid access mode +ValueError: shmop_open(): Argument #2 ($mode) must be a valid access mode +ValueError: shmop_open(): Argument #2 ($mode) must be a valid access mode Warning: shmop_open(): Unable to attach or create shared memory segment "%s" in %s on line %d bool(false) Warning: shmop_open(): Unable to attach or create shared memory segment "%s" in %s on line %d -shmop_open(): Argument #4 ($size) must be greater than 0 for the "c" and "n" access modes +ValueError: shmop_open(): Argument #4 ($size) must be greater than 0 for the "c" and "n" access modes ## shmop_read function tests ## -shmop_read(): Argument #2 ($offset) must be between 0 and the segment size -shmop_read(): Argument #3 ($size) is out of range +ValueError: shmop_read(): Argument #2 ($offset) must be between 0 and the segment size +ValueError: shmop_read(): Argument #3 ($size) is out of range ## shmop_write function tests ## -shmop_write(): Argument #3 ($offset) is out of range +ValueError: shmop_write(): Argument #3 ($offset) is out of range diff --git a/ext/shmop/tests/gh9945.phpt b/ext/shmop/tests/gh9945.phpt index f22f79149bfb..1bf117fc08dd 100644 --- a/ext/shmop/tests/gh9945.phpt +++ b/ext/shmop/tests/gh9945.phpt @@ -12,8 +12,8 @@ if (PHP_OS_FAMILY !== 'Linux' && PHP_OS_FAMILY !== 'Windows') die('skip only for try { shmop_open(0x100000000, '', 0644, 1); } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -shmop_open(): Argument #1 ($key) is out of range +ValueError: shmop_open(): Argument #1 ($key) is out of range diff --git a/ext/simplexml/tests/012.phpt b/ext/simplexml/tests/012.phpt index a68345d29d9a..137e0f931720 100644 --- a/ext/simplexml/tests/012.phpt +++ b/ext/simplexml/tests/012.phpt @@ -15,7 +15,7 @@ $sxe = simplexml_load_string($xml); try { $sxe[""] = "value"; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $sxe["attr"] = "value"; @@ -29,16 +29,16 @@ echo $sxe->asXML(); try { $sxe[] = "error"; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } __HALT_COMPILER(); ?> ===DONE=== --EXPECT-- -Cannot create attribute with an empty name +ValueError: Cannot create attribute with an empty name -Cannot append to an attribute list +ValueError: Cannot append to an attribute list diff --git a/ext/simplexml/tests/SimpleXMLElement_addAttribute_required_attribute_name.phpt b/ext/simplexml/tests/SimpleXMLElement_addAttribute_required_attribute_name.phpt index 65f8f7baa8b7..c6f33e5661c0 100644 --- a/ext/simplexml/tests/SimpleXMLElement_addAttribute_required_attribute_name.phpt +++ b/ext/simplexml/tests/SimpleXMLElement_addAttribute_required_attribute_name.phpt @@ -12,12 +12,12 @@ $a = new SimpleXMLElement("testfest"); try { $a->addAttribute( "", "" ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo $a->asXML(); ?> --EXPECT-- -SimpleXMLElement::addAttribute(): Argument #1 ($qualifiedName) must not be empty +ValueError: SimpleXMLElement::addAttribute(): Argument #1 ($qualifiedName) must not be empty testfest diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath.phpt b/ext/simplexml/tests/SimpleXMLElement_xpath.phpt index 8af58ec2a0aa..f6541429385e 100644 --- a/ext/simplexml/tests/SimpleXMLElement_xpath.phpt +++ b/ext/simplexml/tests/SimpleXMLElement_xpath.phpt @@ -14,8 +14,8 @@ $xml = @simplexml_load_string("XXXXXXX^", 'SimpleXMLElement', XML_PARSE_RECOVER) try { var_dump($xml->xpath("BBBB")); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized diff --git a/ext/simplexml/tests/SimpleXMLElement_xpath_4.phpt b/ext/simplexml/tests/SimpleXMLElement_xpath_4.phpt index b111b0bfb34a..e4d31407c3ae 100644 --- a/ext/simplexml/tests/SimpleXMLElement_xpath_4.phpt +++ b/ext/simplexml/tests/SimpleXMLElement_xpath_4.phpt @@ -12,10 +12,10 @@ if (PHP_INT_SIZE != 8) die("skip this test is for 64bit platforms only"); try { simplexml_load_string("XXXXXXX^", $x, 0x6000000000000001); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- Warning: Undefined variable $x in %s on line %d -simplexml_load_string(): Argument #3 ($options) is too large +ValueError: simplexml_load_string(): Argument #3 ($options) is too large diff --git a/ext/simplexml/tests/bug37076_1.phpt b/ext/simplexml/tests/bug37076_1.phpt index ed7fecd104c2..e6ac05ca4245 100644 --- a/ext/simplexml/tests/bug37076_1.phpt +++ b/ext/simplexml/tests/bug37076_1.phpt @@ -10,12 +10,12 @@ $xml = simplexml_load_string(""); try { $xml->{""} .= "bar"; } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } print $xml->asXML(); ?> --EXPECT-- -Cannot create element with an empty name +ValueError: Cannot create element with an empty name diff --git a/ext/simplexml/tests/bug38406.phpt b/ext/simplexml/tests/bug38406.phpt index 41f2df7aaf60..8aed05291a5d 100644 --- a/ext/simplexml/tests/bug38406.phpt +++ b/ext/simplexml/tests/bug38406.phpt @@ -17,7 +17,7 @@ $a = array(); try { $item->$a = new stdclass; } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -33,5 +33,5 @@ object(SimpleXMLElement)#%d (1) { } Warning: Array to string conversion in %s on line %d -It's not possible to assign a complex type to properties, stdClass given +TypeError: It's not possible to assign a complex type to properties, stdClass given Done diff --git a/ext/simplexml/tests/current_error.phpt b/ext/simplexml/tests/current_error.phpt index dc22f735477d..822db6ed0073 100644 --- a/ext/simplexml/tests/current_error.phpt +++ b/ext/simplexml/tests/current_error.phpt @@ -17,7 +17,7 @@ $sxe = simplexml_load_string($xml); try { $sxe->current(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } for ($sxe->rewind(); $sxe->valid(); $sxe->next()) { @@ -27,13 +27,13 @@ for ($sxe->rewind(); $sxe->valid(); $sxe->next()) { try { $sxe->current(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Iterator not initialized or already consumed +Error: Iterator not initialized or already consumed string(4) "elem" object(SimpleXMLElement)#3 (0) { } -Iterator not initialized or already consumed +Error: Iterator not initialized or already consumed diff --git a/ext/simplexml/tests/gh12929.phpt b/ext/simplexml/tests/gh12929.phpt index 2ae89346dba8..0b3586fb88ca 100644 --- a/ext/simplexml/tests/gh12929.phpt +++ b/ext/simplexml/tests/gh12929.phpt @@ -9,7 +9,7 @@ stream_wrapper_register($scheme, "SimpleXMLIterator"); try { file_get_contents($scheme . "://x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo $e->getPrevious()->getMessage(), "\n"; } @@ -18,12 +18,12 @@ stream_wrapper_register($scheme, "SimpleXMLElement"); try { file_get_contents($scheme . "://x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo $e->getPrevious()->getMessage(), "\n"; } ?> --EXPECT-- -It's not possible to assign a complex type to properties, resource given +TypeError: It's not possible to assign a complex type to properties, resource given SimpleXMLElement is not properly initialized -It's not possible to assign a complex type to properties, resource given +TypeError: It's not possible to assign a complex type to properties, resource given SimpleXMLElement is not properly initialized diff --git a/ext/simplexml/tests/key_error.phpt b/ext/simplexml/tests/key_error.phpt index 5801aec1040b..519d1d100248 100644 --- a/ext/simplexml/tests/key_error.phpt +++ b/ext/simplexml/tests/key_error.phpt @@ -17,7 +17,7 @@ $sxe = simplexml_load_string($xml); try { $sxe->key(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } for ($sxe->rewind(); $sxe->valid(); $sxe->next()) { @@ -27,13 +27,13 @@ for ($sxe->rewind(); $sxe->valid(); $sxe->next()) { try { $sxe->key(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Iterator not initialized or already consumed +Error: Iterator not initialized or already consumed string(4) "elem" object(SimpleXMLElement)#3 (0) { } -Iterator not initialized or already consumed +Error: Iterator not initialized or already consumed diff --git a/ext/simplexml/tests/simplexml_uninitialized.phpt b/ext/simplexml/tests/simplexml_uninitialized.phpt index ade8b809b7aa..ac14ad451118 100644 --- a/ext/simplexml/tests/simplexml_uninitialized.phpt +++ b/ext/simplexml/tests/simplexml_uninitialized.phpt @@ -15,45 +15,45 @@ $sxe = new MySXE; try { var_dump($sxe->count()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->xpath('')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->getDocNamespaces()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->children()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->attributes()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->registerXPathNamespace('', '')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($sxe->foo); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized -SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized +Error: SimpleXMLElement is not properly initialized diff --git a/ext/snmp/tests/gh17330.phpt b/ext/snmp/tests/gh17330.phpt index a6f077a9c860..898b0357fcd9 100644 --- a/ext/snmp/tests/gh17330.phpt +++ b/ext/snmp/tests/gh17330.phpt @@ -11,8 +11,8 @@ $session->close(); try { $session->setSecurity('authPriv', 'MD5', '', 'AES', ''); } catch(Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Invalid or uninitialized SNMP object +Error: Invalid or uninitialized SNMP object diff --git a/ext/snmp/tests/gh21336.phpt b/ext/snmp/tests/gh21336.phpt index a4070136e550..745bcb27652c 100644 --- a/ext/snmp/tests/gh21336.phpt +++ b/ext/snmp/tests/gh21336.phpt @@ -10,32 +10,32 @@ $session = new SNMP(SNMP::VERSION_3, 'localhost', 'user'); try { $session->setSecurity('authPriv'); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // auth passphrase NULL try { $session->setSecurity('authNoPriv', 'MD5'); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // priv protocol NULL try { $session->setSecurity('authPriv', 'MD5', 'test12345'); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // priv passphrase NULL try { $session->setSecurity('authPriv', 'MD5', 'test12345', 'AES'); } catch (ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SNMP::setSecurity(): Argument #2 ($authProtocol) cannot be null when security level is "authNoPriv" or "authPriv" -SNMP::setSecurity(): Argument #3 ($authPassphrase) cannot be null when security level is "authNoPriv" or "authPriv" -SNMP::setSecurity(): Argument #4 ($privacyProtocol) cannot be null when security level is "authPriv" -SNMP::setSecurity(): Argument #5 ($privacyPassphrase) cannot be null when security level is "authPriv" +ValueError: SNMP::setSecurity(): Argument #2 ($authProtocol) cannot be null when security level is "authNoPriv" or "authPriv" +ValueError: SNMP::setSecurity(): Argument #3 ($authPassphrase) cannot be null when security level is "authNoPriv" or "authPriv" +ValueError: SNMP::setSecurity(): Argument #4 ($privacyProtocol) cannot be null when security level is "authPriv" +ValueError: SNMP::setSecurity(): Argument #5 ($privacyPassphrase) cannot be null when security level is "authPriv" diff --git a/ext/soap/tests/bugs/bug31755.phpt b/ext/soap/tests/bugs/bug31755.phpt index c4b2c622b6af..2cd623888b55 100644 --- a/ext/soap/tests/bugs/bug31755.phpt +++ b/ext/soap/tests/bugs/bug31755.phpt @@ -17,7 +17,7 @@ $client = new MySoapClient(null, array( try { new SOAPHeader('', 'foo', 'bar'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $header = new SOAPHeader('namespace', 'foo', 'bar'); @@ -26,6 +26,6 @@ $response= $client->__soapCall('function', array(), null, $header); print $client->__getLastRequest(); ?> --EXPECT-- -SoapHeader::__construct(): Argument #1 ($namespace) must not be empty +ValueError: SoapHeader::__construct(): Argument #1 ($namespace) must not be empty bar diff --git a/ext/soap/tests/bugs/bug42151.phpt b/ext/soap/tests/bugs/bug42151.phpt index 2f9c1830ad39..ef8f744b1374 100644 --- a/ext/soap/tests/bugs/bug42151.phpt +++ b/ext/soap/tests/bugs/bug42151.phpt @@ -21,12 +21,12 @@ try { $bar = new bar(); $foo = new foo(); } catch (Exception $e){ - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ok\n"; ?> --EXPECTF-- -SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s +SoapFault: SOAP-ERROR: Parsing WSDL: Couldn't load from 'httpx://' : failed to load %s ok I don't get executed either. diff --git a/ext/soap/tests/bugs/bug42692.phpt b/ext/soap/tests/bugs/bug42692.phpt index fe4840d9268d..78126325ad5c 100644 --- a/ext/soap/tests/bugs/bug42692.phpt +++ b/ext/soap/tests/bugs/bug42692.phpt @@ -33,7 +33,7 @@ try { $result = $client->checkAuth(1,"two"); echo "Auth for 1 is $result\n"; } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/soap/tests/bugs/bug55639.phpt b/ext/soap/tests/bugs/bug55639.phpt index 16d7f7a37719..834389361982 100644 --- a/ext/soap/tests/bugs/bug55639.phpt +++ b/ext/soap/tests/bugs/bug55639.phpt @@ -44,7 +44,7 @@ $client = new soapclient(NULL, [ try { $client->__soapCall("foo", []); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $headers = $client->__getLastRequestHeaders(); @@ -52,7 +52,7 @@ var_dump($headers); ?> --EXPECTF-- -Unauthorized +SoapFault: Unauthorized string(%d) "POST / HTTP/1.1 Host: %s Connection: Keep-Alive diff --git a/ext/soap/tests/bugs/bug71610.phpt b/ext/soap/tests/bugs/bug71610.phpt index f7f674fa0593..34709c5b0693 100644 --- a/ext/soap/tests/bugs/bug71610.phpt +++ b/ext/soap/tests/bugs/bug71610.phpt @@ -21,8 +21,8 @@ $exploit = unserialize($ser); try { $exploit->blahblah(); } catch(SoapFault $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -looks like we got no XML document +SoapFault: looks like we got no XML document diff --git a/ext/soap/tests/bugs/bug73037.phpt b/ext/soap/tests/bugs/bug73037.phpt index 7a5b99776772..6d94fca04e0f 100644 --- a/ext/soap/tests/bugs/bug73037.phpt +++ b/ext/soap/tests/bugs/bug73037.phpt @@ -175,4 +175,3 @@ Iteration 6 Function 'CATALOG' doesn't exist Function 'CATALOG' doesn't exist - diff --git a/ext/soap/tests/bugs/bug80672.phpt b/ext/soap/tests/bugs/bug80672.phpt index 2abc40e39134..d5f54ef6b804 100644 --- a/ext/soap/tests/bugs/bug80672.phpt +++ b/ext/soap/tests/bugs/bug80672.phpt @@ -8,8 +8,8 @@ try { $client = new SoapClient(__DIR__ . "/bug80672.xml"); $query = $soap->query(array('sXML' => 'something')); } catch(SoapFault $e) { - print $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <> +SoapFault: SOAP-ERROR: Parsing WSDL: Unexpected WSDL element <> diff --git a/ext/soap/tests/bugs/gh16237.phpt b/ext/soap/tests/bugs/gh16237.phpt index 468f2794399e..c86e9c14039d 100644 --- a/ext/soap/tests/bugs/gh16237.phpt +++ b/ext/soap/tests/bugs/gh16237.phpt @@ -9,9 +9,9 @@ $server = new SoapServer(null, ['uri'=>"http://testuri.org"]); try { clone $server; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class SoapServer +Error: Trying to clone an uncloneable object of class SoapServer diff --git a/ext/soap/tests/bugs/gh16256.phpt b/ext/soap/tests/bugs/gh16256.phpt index ce2ba1314069..74bc49688628 100644 --- a/ext/soap/tests/bugs/gh16256.phpt +++ b/ext/soap/tests/bugs/gh16256.phpt @@ -11,14 +11,14 @@ $wsdl = __DIR__."/ext/soap/tests/bug41004.wsdl"; try { new SoapClient($wsdl, ["classmap" => $classmap]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new SoapServer($wsdl, ["classmap" => $classmap]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SoapClient::__construct(): 'classmap' option must be an associative array -SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array +SoapFault: SoapClient::__construct(): 'classmap' option must be an associative array +ValueError: SoapServer::__construct(): Argument #2 ($options) "classmap" option must be an associative array diff --git a/ext/soap/tests/bugs/gh16429.phpt b/ext/soap/tests/bugs/gh16429.phpt index 24d517f96b96..b7073a05b23d 100644 --- a/ext/soap/tests/bugs/gh16429.phpt +++ b/ext/soap/tests/bugs/gh16429.phpt @@ -14,9 +14,9 @@ $client = new SoapClient(__DIR__."/../interop/Round2/GroupB/round2_groupB.wsdl", try { $client->echo2DStringArray($fusion); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(10) "xxxxxxxxxx" -Cannot traverse an already closed generator +Exception: Cannot traverse an already closed generator diff --git a/ext/soap/tests/bugs/gh22167.phpt b/ext/soap/tests/bugs/gh22167.phpt index f24bfb0eac32..9a6518d2ad73 100644 --- a/ext/soap/tests/bugs/gh22167.phpt +++ b/ext/soap/tests/bugs/gh22167.phpt @@ -98,31 +98,31 @@ foreach ($cases as $name => $schema) { new SoapClient($file, ["cache_wsdl" => WSDL_CACHE_NONE]); echo "$name: parsed\n"; } catch (SoapFault $e) { - echo "$name: {$e->getMessage()}\n"; + echo "$name: ", $e::class, ': ', $e->getMessage(), "\n"; } finally { unlink($file); } } ?> --EXPECT-- -minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range -maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative minOccurs: SOAP-ERROR: Parsing Schema: minOccurs value is out of range -negative maxOccurs: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -minExclusive: SOAP-ERROR: Parsing Schema: minExclusive value is out of range -minInclusive: SOAP-ERROR: Parsing Schema: minInclusive value is out of range -maxExclusive: SOAP-ERROR: Parsing Schema: maxExclusive value is out of range -maxInclusive: SOAP-ERROR: Parsing Schema: maxInclusive value is out of range -totalDigits: SOAP-ERROR: Parsing Schema: totalDigits value is out of range -fractionDigits: SOAP-ERROR: Parsing Schema: fractionDigits value is out of range -length: SOAP-ERROR: Parsing Schema: length value is out of range -minLength: SOAP-ERROR: Parsing Schema: minLength value is out of range -maxLength: SOAP-ERROR: Parsing Schema: maxLength value is out of range -leading whitespace numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading plus numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading zero numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -leading numeric-string with trailing data: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -negative out-of-range numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -decimal numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range -exponent numeric-string: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +minOccurs: SoapFault: SOAP-ERROR: Parsing Schema: minOccurs value is out of range +maxOccurs: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +negative minOccurs: SoapFault: SOAP-ERROR: Parsing Schema: minOccurs value is out of range +negative maxOccurs: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +minExclusive: SoapFault: SOAP-ERROR: Parsing Schema: minExclusive value is out of range +minInclusive: SoapFault: SOAP-ERROR: Parsing Schema: minInclusive value is out of range +maxExclusive: SoapFault: SOAP-ERROR: Parsing Schema: maxExclusive value is out of range +maxInclusive: SoapFault: SOAP-ERROR: Parsing Schema: maxInclusive value is out of range +totalDigits: SoapFault: SOAP-ERROR: Parsing Schema: totalDigits value is out of range +fractionDigits: SoapFault: SOAP-ERROR: Parsing Schema: fractionDigits value is out of range +length: SoapFault: SOAP-ERROR: Parsing Schema: length value is out of range +minLength: SoapFault: SOAP-ERROR: Parsing Schema: minLength value is out of range +maxLength: SoapFault: SOAP-ERROR: Parsing Schema: maxLength value is out of range +leading whitespace numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading plus numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading zero numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +leading numeric-string with trailing data: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +negative out-of-range numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +decimal numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range +exponent numeric-string: SoapFault: SOAP-ERROR: Parsing Schema: maxOccurs value is out of range fractional numeric-string within int range: parsed diff --git a/ext/soap/tests/bugs/protocol_relative_redirect.phpt b/ext/soap/tests/bugs/protocol_relative_redirect.phpt index e8f30ca66872..e9c30f0ab290 100644 --- a/ext/soap/tests/bugs/protocol_relative_redirect.phpt +++ b/ext/soap/tests/bugs/protocol_relative_redirect.phpt @@ -42,7 +42,7 @@ try { $client->__soapCall("foo", []); echo "redirect followed\n"; } catch (SoapFault $e) { - echo "SoapFault: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/soap/tests/bugs/relative_redirect.phpt b/ext/soap/tests/bugs/relative_redirect.phpt index 774e7cbd98d7..ebdcd97e5d49 100644 --- a/ext/soap/tests/bugs/relative_redirect.phpt +++ b/ext/soap/tests/bugs/relative_redirect.phpt @@ -42,7 +42,7 @@ try { $client->__soapCall("foo", []); echo "redirect followed\n"; } catch (SoapFault $e) { - echo "SoapFault: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/soap/tests/bugs/relative_redirect_path.phpt b/ext/soap/tests/bugs/relative_redirect_path.phpt index 09d4c857cc92..2e18c12b926f 100644 --- a/ext/soap/tests/bugs/relative_redirect_path.phpt +++ b/ext/soap/tests/bugs/relative_redirect_path.phpt @@ -42,7 +42,7 @@ try { $client->__soapCall("foo", []); echo "redirect followed\n"; } catch (SoapFault $e) { - echo "SoapFault: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/soap/tests/fault_warning.phpt b/ext/soap/tests/fault_warning.phpt index 2a9d99fb5dbd..d8c2921a8ef8 100644 --- a/ext/soap/tests/fault_warning.phpt +++ b/ext/soap/tests/fault_warning.phpt @@ -8,13 +8,13 @@ soap try { new SoapFault("", "message"); // Can't be an empty string } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { new SoapFault(new stdClass(), "message"); // Can't be a non-string (except for null) } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $fault = new SoapFault("Sender", "message"); @@ -25,13 +25,13 @@ echo get_class($fault) . "\n"; try { new SoapFault(["more"], "message"); // two elements in array required } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { new SoapFault(["m", "more", "superfluous"], "message"); // two required } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $fault = new SoapFault(["more-ns", "Sender"], "message"); // two given @@ -39,10 +39,10 @@ echo get_class($fault); ?> --EXPECT-- -SoapFault::__construct(): Argument #1 ($code) is not a valid fault code -SoapFault::__construct(): Argument #1 ($code) must be of type array|string|null, stdClass given +ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code +TypeError: SoapFault::__construct(): Argument #1 ($code) must be of type array|string|null, stdClass given SoapFault SoapFault -SoapFault::__construct(): Argument #1 ($code) is not a valid fault code -SoapFault::__construct(): Argument #1 ($code) is not a valid fault code +ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code +ValueError: SoapFault::__construct(): Argument #1 ($code) is not a valid fault code SoapFault diff --git a/ext/soap/tests/gh15711.phpt b/ext/soap/tests/gh15711.phpt index 17ff051698fd..d3c04d319ab1 100644 --- a/ext/soap/tests/gh15711.phpt +++ b/ext/soap/tests/gh15711.phpt @@ -64,7 +64,7 @@ $book->short = NonBackedEnum::First; try { $client->dotest($book); } catch (ValueError $e) { - echo "ValueError: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Test with mismatched enum backing type ---\n"; @@ -74,7 +74,7 @@ $book->short = StringBackedEnum::First; try { $client->dotest($book); } catch (ValueError $e) { - echo "ValueError: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/soap/tests/gh16318.phpt b/ext/soap/tests/gh16318.phpt index 0c38b6fc8de3..ce0490d95927 100644 --- a/ext/soap/tests/gh16318.phpt +++ b/ext/soap/tests/gh16318.phpt @@ -26,11 +26,11 @@ foreach ([$test1, $test2] as $test) { try { $client->__soapCall("echoStructArray", array($test), array("soapaction"=>"http://soapinterop.org/","uri"=>"http://soapinterop.org/")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Recursive array cannot be encoded -Recursive array cannot be encoded +ValueError: Recursive array cannot be encoded +ValueError: Recursive array cannot be encoded diff --git a/ext/sockets/tests/gh16267.phpt b/ext/sockets/tests/gh16267.phpt index de3e1b657fbc..3bd65d8121fe 100644 --- a/ext/sockets/tests/gh16267.phpt +++ b/ext/sockets/tests/gh16267.phpt @@ -10,9 +10,9 @@ var_dump(socket_strerror(-2147483648)); try { socket_strerror(2147483648); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- string(%d) "%S" -socket_strerror(): Argument #1 ($error_code) must be between %i and %d +ValueError: socket_strerror(): Argument #1 ($error_code) must be between %i and %d diff --git a/ext/sockets/tests/gh20532.phpt b/ext/sockets/tests/gh20532.phpt index 360f9e7e11a8..2bec6953dac4 100644 --- a/ext/sockets/tests/gh20532.phpt +++ b/ext/sockets/tests/gh20532.phpt @@ -13,4 +13,3 @@ var_dump(socket_addrinfo_lookup("example.com", "http", ['ai_socktype' => SOCK_RA bool(true) bool(true) bool(true) - diff --git a/ext/sockets/tests/mcast_ipv4_send_error.phpt b/ext/sockets/tests/mcast_ipv4_send_error.phpt index 94148df1c4cb..445b3f658346 100644 --- a/ext/sockets/tests/mcast_ipv4_send_error.phpt +++ b/ext/sockets/tests/mcast_ipv4_send_error.phpt @@ -43,7 +43,7 @@ try { $r = socket_set_option($s, $level, IP_MULTICAST_TTL, 256); var_dump($r); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $r = socket_get_option($s, $level, IP_MULTICAST_TTL); var_dump($r); @@ -62,7 +62,7 @@ try { $r = socket_set_option($s, $level, IP_MULTICAST_TTL, -1); var_dump($r); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $r = socket_get_option($s, $level, IP_MULTICAST_TTL); var_dump($r); @@ -78,7 +78,7 @@ bool(true) int(0) Setting IP_MULTICAST_TTL with 256 -socket_set_option(): Argument #4 ($value) must be between 0 and 255 +ValueError: socket_set_option(): Argument #4 ($value) must be between 0 and 255 int(1) Setting IP_MULTICAST_TTL with "254" @@ -86,5 +86,5 @@ bool(true) int(254) Setting IP_MULTICAST_TTL with -1 -socket_set_option(): Argument #4 ($value) must be between 0 and 255 +ValueError: socket_set_option(): Argument #4 ($value) must be between 0 and 255 int(254) diff --git a/ext/sockets/tests/mcast_sockettype_error.phpt b/ext/sockets/tests/mcast_sockettype_error.phpt index 56308534ebc4..66995779567b 100644 --- a/ext/sockets/tests/mcast_sockettype_error.phpt +++ b/ext/sockets/tests/mcast_sockettype_error.phpt @@ -23,8 +23,8 @@ try { "interface" => "lo", )); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -IP address used in the context of an unexpected type of socket +ValueError: IP address used in the context of an unexpected type of socket diff --git a/ext/sockets/tests/socket_addrinfo_lookup.phpt b/ext/sockets/tests/socket_addrinfo_lookup.phpt index 42745f36978d..0c296850d5c5 100644 --- a/ext/sockets/tests/socket_addrinfo_lookup.phpt +++ b/ext/sockets/tests/socket_addrinfo_lookup.phpt @@ -12,8 +12,8 @@ try { )); var_dump($addrinfo[0]); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" diff --git a/ext/sockets/tests/socket_bind_invalid_port.phpt b/ext/sockets/tests/socket_bind_invalid_port.phpt index b70900f68620..8fe2a076ba2f 100644 --- a/ext/sockets/tests/socket_bind_invalid_port.phpt +++ b/ext/sockets/tests/socket_bind_invalid_port.phpt @@ -9,15 +9,15 @@ sockets try { socket_bind($s_c, '0.0.0.0', -1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_bind($s_c, '0.0.0.0', 65536); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -socket_bind(): Argument #3 ($port) must be between 0 and 65535 -socket_bind(): Argument #3 ($port) must be between 0 and 65535 +ValueError: socket_bind(): Argument #3 ($port) must be between 0 and 65535 +ValueError: socket_bind(): Argument #3 ($port) must be between 0 and 65535 diff --git a/ext/sockets/tests/socket_cmsg_udp_segment.phpt b/ext/sockets/tests/socket_cmsg_udp_segment.phpt index 38a914066510..b74ced8807b2 100644 --- a/ext/sockets/tests/socket_cmsg_udp_segment.phpt +++ b/ext/sockets/tests/socket_cmsg_udp_segment.phpt @@ -13,14 +13,14 @@ $src = socket_create(AF_UNIX, SOCK_DGRAM, 0); try { socket_setopt($src, SOL_UDP, UDP_SEGMENT, -1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_setopt($src, SOL_UDP, UDP_SEGMENT, 65536); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -socket_setopt(): Argument #4 ($value) must be between 0 and 65535 -socket_setopt(): Argument #4 ($value) must be between 0 and 65535 +ValueError: socket_setopt(): Argument #4 ($value) must be between 0 and 65535 +ValueError: socket_setopt(): Argument #4 ($value) must be between 0 and 65535 diff --git a/ext/sockets/tests/socket_connect_params.phpt b/ext/sockets/tests/socket_connect_params.phpt index 683b8e9d919f..64f25d792329 100644 --- a/ext/sockets/tests/socket_connect_params.phpt +++ b/ext/sockets/tests/socket_connect_params.phpt @@ -15,19 +15,19 @@ socket_getsockname($s_c, $addr, $port); try { socket_connect($s_c); } catch (\ArgumentCountError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_connect($s_c, '0.0.0.0'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $s_w = socket_connect($s_c, '0.0.0.0', $port); socket_close($s_c); ?> --EXPECTF-- -socket_connect() expects at least 2 arguments, 1 given -socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET +ArgumentCountError: socket_connect() expects at least 2 arguments, 1 given +ValueError: socket_connect(): Argument #3 ($port) cannot be null when the socket type is AF_INET Warning: socket_connect(): unable to connect [%i]: %a in %s on line %d diff --git a/ext/sockets/tests/socket_create_listen_invalid_port.phpt b/ext/sockets/tests/socket_create_listen_invalid_port.phpt index 35182139ee6f..2f360501abda 100644 --- a/ext/sockets/tests/socket_create_listen_invalid_port.phpt +++ b/ext/sockets/tests/socket_create_listen_invalid_port.phpt @@ -9,16 +9,16 @@ var_dump(socket_create_listen(0)); try { socket_create_listen(-1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_create_listen(65536); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- object(Socket)#1 (0) { } -socket_create_listen(): Argument #1 ($port) must be between 0 and 65535 -socket_create_listen(): Argument #1 ($port) must be between 0 and 65535 +ValueError: socket_create_listen(): Argument #1 ($port) must be between 0 and 65535 +ValueError: socket_create_listen(): Argument #1 ($port) must be between 0 and 65535 diff --git a/ext/sockets/tests/socket_create_pair-wrongparams.phpt b/ext/sockets/tests/socket_create_pair-wrongparams.phpt index 1d0a6540841d..c9c8ae38a222 100644 --- a/ext/sockets/tests/socket_create_pair-wrongparams.phpt +++ b/ext/sockets/tests/socket_create_pair-wrongparams.phpt @@ -16,21 +16,21 @@ var_dump(socket_create_pair(AF_INET, 0, 0, $sockets)); try { var_dump(socket_create_pair(31337, 0, 0, $sockets)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(socket_create_pair(AF_INET, 31337, 0, $sockets)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Warning: socket_create_pair(): Unable to create socket pair [%d]: %s %r(not supported|wrong type for socket)%r in %s on line %d bool(false) -socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET -socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A +ValueError: socket_create_pair(): Argument #1 ($domain) must be one of AF_UNIX, AF_INET6, or AF_INET +ValueError: socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/sockets/tests/socket_create_pair_sockexec.phpt b/ext/sockets/tests/socket_create_pair_sockexec.phpt index 5e31b1550340..2dd70aef29c6 100644 --- a/ext/sockets/tests/socket_create_pair_sockexec.phpt +++ b/ext/sockets/tests/socket_create_pair_sockexec.phpt @@ -13,22 +13,22 @@ $sockets = array(); try { socket_create_pair(AF_UNIX, 11 | SOCK_CLOEXEC, 0, $sockets); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_create_pair(AF_UNIX, 11 | SOCK_NONBLOCK, 0, $sockets); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_create_pair(AF_UNIX, 11 | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, $sockets); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(socket_create_pair(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC | SOCK_NONBLOCK, 0, $sockets)); ?> --EXPECTF-- -socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A -socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A -socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A +ValueError: socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A +ValueError: socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A +ValueError: socket_create_pair(): Argument #2 ($type) must be one of SOCK_STREAM, SOCK_DGRAM, SOCK_SEQPACKET, SOCK_RAW, or SOCK_RDM%A bool(true) diff --git a/ext/sockets/tests/socket_export_stream-2.phpt b/ext/sockets/tests/socket_export_stream-2.phpt index 0a83ef485ba8..1c40ac17a0ba 100644 --- a/ext/sockets/tests/socket_export_stream-2.phpt +++ b/ext/sockets/tests/socket_export_stream-2.phpt @@ -8,12 +8,12 @@ sockets try { socket_export_stream(fopen(__FILE__, "rb")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { socket_export_stream(stream_socket_server("udp://127.0.0.1:0", $errno, $errstr, STREAM_SERVER_BIND)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $s = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP); var_dump($s); @@ -22,15 +22,15 @@ socket_close($s); try { var_dump(socket_export_stream($s)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done."; ?> --EXPECTF-- -socket_export_stream(): Argument #1 ($socket) must be of type Socket, resource given -socket_export_stream(): Argument #1 ($socket) must be of type Socket, resource given +TypeError: socket_export_stream(): Argument #1 ($socket) must be of type Socket, resource given +TypeError: socket_export_stream(): Argument #1 ($socket) must be of type Socket, resource given object(Socket)#%d (0) { } -socket_export_stream(): Argument #1 ($socket) has already been closed +Error: socket_export_stream(): Argument #1 ($socket) has already been closed Done. diff --git a/ext/sockets/tests/socket_export_stream-4.phpt b/ext/sockets/tests/socket_export_stream-4.phpt index 168671138680..da6608428fa8 100644 --- a/ext/sockets/tests/socket_export_stream-4.phpt +++ b/ext/sockets/tests/socket_export_stream-4.phpt @@ -18,7 +18,7 @@ function test($stream, $sock) { try { print_r(stream_set_blocking($stream, false)); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } @@ -27,7 +27,7 @@ function test($stream, $sock) { try { print_r(socket_set_block($sock)); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; echo "socket_get_option "; @@ -36,7 +36,7 @@ function test($stream, $sock) { $opt = socket_get_option($sock, SOL_SOCKET, SO_TYPE); print_r($opt === SOCK_DGRAM ? "DGRAM" : $opt); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } diff --git a/ext/sockets/tests/socket_getaddrinfo_error.phpt b/ext/sockets/tests/socket_getaddrinfo_error.phpt index a2455821e70e..1fa7a2889790 100644 --- a/ext/sockets/tests/socket_getaddrinfo_error.phpt +++ b/ext/sockets/tests/socket_getaddrinfo_error.phpt @@ -12,7 +12,7 @@ try { 'ai_protocol' => 0, )); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -22,7 +22,7 @@ try { 'ai_protocol' => 0, )); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -32,7 +32,7 @@ try { 'ai_protocol' => 0, )); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -42,7 +42,7 @@ try { 'ai_protocol' => new stdClass(), )); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -52,7 +52,7 @@ try { 'ai_protocol' => 0, )); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -62,7 +62,7 @@ try { 'ai_protocol' => 0, )); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -72,7 +72,7 @@ try { 'ai_protocol' => 0, )); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -82,7 +82,7 @@ try { 'ai_protocol' => PHP_INT_MIN, )); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, [ @@ -92,7 +92,7 @@ try { 0, ]); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_addrinfo_lookup('127.0.0.1', 2000, array( @@ -102,17 +102,17 @@ try { 0, )); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_family" key must be of type int, stdClass given -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_socktype" key must be of type int, stdClass given -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_flags" key must be of type int, stdClass given -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_protocol" key must be of type int, stdClass given -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_family" key must be AF_INET%A -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_socktype" key must be between 0 and %d -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_flags" key must be between 0 and %d -socket_addrinfo_lookup(): Argument #3 ($hints) "ai_protocol" key must be between 0 and %d -socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" -socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" +TypeError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_family" key must be of type int, stdClass given +TypeError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_socktype" key must be of type int, stdClass given +TypeError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_flags" key must be of type int, stdClass given +TypeError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_protocol" key must be of type int, stdClass given +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_family" key must be AF_INET%A +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_socktype" key must be between 0 and %d +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_flags" key must be between 0 and %d +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) "ai_protocol" key must be between 0 and %d +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" +ValueError: socket_addrinfo_lookup(): Argument #3 ($hints) must only contain array keys "ai_flags", "ai_socktype", "ai_protocol", or "ai_family" diff --git a/ext/sockets/tests/socket_import_stream-2.phpt b/ext/sockets/tests/socket_import_stream-2.phpt index 7d3b492a85e1..cb73fbb9b387 100644 --- a/ext/sockets/tests/socket_import_stream-2.phpt +++ b/ext/sockets/tests/socket_import_stream-2.phpt @@ -9,7 +9,7 @@ var_dump(socket_import_stream(fopen(__FILE__, "rb"))); try { socket_import_stream(socket_create(AF_INET, SOCK_DGRAM, SOL_UDP)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $s = stream_socket_server("udp://127.0.0.1:0", $errno, $errstr, STREAM_SERVER_BIND); var_dump($s); @@ -17,7 +17,7 @@ var_dump(fclose($s)); try { socket_import_stream($s); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done."; @@ -25,8 +25,8 @@ echo "Done."; --EXPECTF-- Warning: socket_import_stream(): Cannot represent a stream of type STDIO as a Socket Descriptor in %s on line %d bool(false) -socket_import_stream(): Argument #1 ($stream) must be of type resource, Socket given +TypeError: socket_import_stream(): Argument #1 ($stream) must be of type resource, Socket given resource(%d) of type (stream) bool(true) -socket_import_stream(): supplied resource is not a valid stream resource +TypeError: socket_import_stream(): supplied resource is not a valid stream resource Done. diff --git a/ext/sockets/tests/socket_import_stream-4.phpt b/ext/sockets/tests/socket_import_stream-4.phpt index 87ca608b862b..0d94f70bb5fe 100644 --- a/ext/sockets/tests/socket_import_stream-4.phpt +++ b/ext/sockets/tests/socket_import_stream-4.phpt @@ -17,7 +17,7 @@ function test($stream, $sock) { try { print_r(stream_set_blocking($stream, false)); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } @@ -26,7 +26,7 @@ function test($stream, $sock) { try { print_r(socket_set_block($sock)); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; echo "socket_get_option "; @@ -35,7 +35,7 @@ function test($stream, $sock) { $opt = socket_get_option($sock, SOL_SOCKET, SO_TYPE); print_r($opt === SOCK_DGRAM ? "DGRAM" : $opt); } catch (Error $e) { - echo get_class($e), ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } diff --git a/ext/sockets/tests/socket_reuseport_cbpf.phpt b/ext/sockets/tests/socket_reuseport_cbpf.phpt index 2210c4438f00..84b2d31b28bc 100644 --- a/ext/sockets/tests/socket_reuseport_cbpf.phpt +++ b/ext/sockets/tests/socket_reuseport_cbpf.phpt @@ -21,7 +21,7 @@ var_dump(socket_set_option( $socket, SOL_SOCKET, SO_REUSEPORT, true)); try { socket_set_option( $socket, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, array()); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(socket_set_option( $socket, SOL_SOCKET, SO_ATTACH_REUSEPORT_CBPF, SKF_AD_CPU)); var_dump(socket_bind($socket, '0.0.0.0')); diff --git a/ext/sockets/tests/socket_select-wrongparams-2.phpt b/ext/sockets/tests/socket_select-wrongparams-2.phpt index f2d3799e7570..7e87ebb9908a 100644 --- a/ext/sockets/tests/socket_select-wrongparams-2.phpt +++ b/ext/sockets/tests/socket_select-wrongparams-2.phpt @@ -12,11 +12,11 @@ $time = 0; try { socket_select($sockets, $write, $except, $time); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -socket_select(): At least one array argument must be passed +ValueError: socket_select(): At least one array argument must be passed --CREDITS-- Till Klampaeckel, till@php.net Berlin TestFest 2009 diff --git a/ext/sockets/tests/socket_select_error.phpt b/ext/sockets/tests/socket_select_error.phpt index 143351dd427d..a9fc383502cb 100644 --- a/ext/sockets/tests/socket_select_error.phpt +++ b/ext/sockets/tests/socket_select_error.phpt @@ -8,8 +8,8 @@ $r = $w = $e = ['no resource']; try { socket_select($r, $w, $e, 1); } catch (TypeError $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -socket_select(): Argument #1 ($read) must only have elements of type Socket, string given +TypeError: socket_select(): Argument #1 ($read) must only have elements of type Socket, string given diff --git a/ext/sockets/tests/socket_send_params.phpt b/ext/sockets/tests/socket_send_params.phpt index d6294c490105..0e3b8fed11a3 100644 --- a/ext/sockets/tests/socket_send_params.phpt +++ b/ext/sockets/tests/socket_send_params.phpt @@ -8,9 +8,9 @@ sockets try { $s_w = socket_send($s_c, "foo", -1, MSG_OOB); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } socket_close($s_c); ?> --EXPECT-- -socket_send(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: socket_send(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/sockets/tests/socket_sendto_invalid_port.phpt b/ext/sockets/tests/socket_sendto_invalid_port.phpt index 9ff81ff5e15b..eb9ee7e2657e 100644 --- a/ext/sockets/tests/socket_sendto_invalid_port.phpt +++ b/ext/sockets/tests/socket_sendto_invalid_port.phpt @@ -8,15 +8,15 @@ sockets try { $s_w = socket_sendto($s_c, "foo", 0, MSG_OOB, '127.0.0.1', 65536); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $s_w = socket_sendto($s_c, "foo", 0, MSG_OOB, '127.0.0.1', -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } socket_close($s_c); ?> --EXPECT-- -socket_sendto(): Argument #6 ($port) must be between 0 and 65535 -socket_sendto(): Argument #6 ($port) must be between 0 and 65535 +ValueError: socket_sendto(): Argument #6 ($port) must be between 0 and 65535 +ValueError: socket_sendto(): Argument #6 ($port) must be between 0 and 65535 diff --git a/ext/sockets/tests/socket_sendto_params.phpt b/ext/sockets/tests/socket_sendto_params.phpt index ed805ee9be7d..947da5683902 100644 --- a/ext/sockets/tests/socket_sendto_params.phpt +++ b/ext/sockets/tests/socket_sendto_params.phpt @@ -8,9 +8,9 @@ sockets try { $s_w = socket_sendto($s_c, "foo", -1, MSG_OOB, '127.0.0.1'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } socket_close($s_c); ?> --EXPECT-- -socket_sendto(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: socket_sendto(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/sockets/tests/socket_sendto_unix_addr_too_long.phpt b/ext/sockets/tests/socket_sendto_unix_addr_too_long.phpt index f2b62527e337..c29644cdace7 100644 --- a/ext/sockets/tests/socket_sendto_unix_addr_too_long.phpt +++ b/ext/sockets/tests/socket_sendto_unix_addr_too_long.phpt @@ -20,10 +20,10 @@ $long_addr = str_repeat('a', 512); try { socket_sendto($socket, "data", 4, 0, $long_addr); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } socket_close($socket); ?> --EXPECTF-- -socket_sendto(): Argument #5 ($address) must be less than %d +ValueError: socket_sendto(): Argument #5 ($address) must be less than %d diff --git a/ext/sockets/tests/socket_set_block-retval.phpt b/ext/sockets/tests/socket_set_block-retval.phpt index 04f980416835..3ec3c384eb0c 100644 --- a/ext/sockets/tests/socket_set_block-retval.phpt +++ b/ext/sockets/tests/socket_set_block-retval.phpt @@ -14,10 +14,10 @@ socket_close($socket2); try { var_dump(socket_set_block($socket2)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -socket_set_block(): Argument #1 ($socket) has already been closed +Error: socket_set_block(): Argument #1 ($socket) has already been closed diff --git a/ext/sockets/tests/socket_set_nonblock-retval.phpt b/ext/sockets/tests/socket_set_nonblock-retval.phpt index b92a75e17c2c..91b9f6fc5ef7 100644 --- a/ext/sockets/tests/socket_set_nonblock-retval.phpt +++ b/ext/sockets/tests/socket_set_nonblock-retval.phpt @@ -14,10 +14,10 @@ socket_close($socket2); try { var_dump(socket_set_nonblock($socket2)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -socket_set_nonblock(): Argument #1 ($socket) has already been closed +Error: socket_set_nonblock(): Argument #1 ($socket) has already been closed diff --git a/ext/sockets/tests/socket_set_option_mcast_error.phpt b/ext/sockets/tests/socket_set_option_mcast_error.phpt index 0d7630fb279c..271635ccc9dc 100644 --- a/ext/sockets/tests/socket_set_option_mcast_error.phpt +++ b/ext/sockets/tests/socket_set_option_mcast_error.phpt @@ -22,15 +22,15 @@ $iwanttoleavenow = true; try { socket_set_option($s, $level, MCAST_LEAVE_GROUP, $iwanttoleavenow); } catch (\TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option($s, $level, MCAST_LEAVE_SOURCE_GROUP, $iwanttoleavenow); } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is MCAST_LEAVE_GROUP, true given -socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is MCAST_LEAVE_SOURCE_GROUP, true given +TypeError: socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is MCAST_LEAVE_GROUP, true given +TypeError: socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is MCAST_LEAVE_SOURCE_GROUP, true given diff --git a/ext/sockets/tests/socket_set_option_rcvtimeo.phpt b/ext/sockets/tests/socket_set_option_rcvtimeo.phpt index ef75ee025378..b2dc812433cf 100644 --- a/ext/sockets/tests/socket_set_option_rcvtimeo.phpt +++ b/ext/sockets/tests/socket_set_option_rcvtimeo.phpt @@ -17,7 +17,7 @@ socket_set_block($socket); try { $retval_1 = socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, []); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } //set/get comparison @@ -30,6 +30,6 @@ var_dump($retval_3 === $options); socket_close($socket); ?> --EXPECT-- -socket_set_option(): Argument #4 ($value) must have key "sec" +ValueError: socket_set_option(): Argument #4 ($value) must have key "sec" bool(true) bool(true) diff --git a/ext/sockets/tests/socket_set_option_seolinger.phpt b/ext/sockets/tests/socket_set_option_seolinger.phpt index 0450c7525099..6e0b94403e97 100644 --- a/ext/sockets/tests/socket_set_option_seolinger.phpt +++ b/ext/sockets/tests/socket_set_option_seolinger.phpt @@ -17,7 +17,7 @@ if (!$socket) { try { $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_LINGER, []); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // set/get comparison @@ -30,7 +30,7 @@ $options_2 = array("l_onoff" => 1); try { var_dump(socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_2)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($retval_2); @@ -41,8 +41,8 @@ var_dump((bool)$retval_3["l_onoff"] === (bool)$options["l_onoff"]); socket_close($socket); ?> --EXPECT-- -socket_set_option(): Argument #4 ($value) must have key "l_onoff" -socket_set_option(): Argument #4 ($value) must have key "l_linger" +ValueError: socket_set_option(): Argument #4 ($value) must have key "l_onoff" +ValueError: socket_set_option(): Argument #4 ($value) must have key "l_linger" bool(true) bool(true) bool(true) diff --git a/ext/sockets/tests/socket_set_option_sndtimeo.phpt b/ext/sockets/tests/socket_set_option_sndtimeo.phpt index e7487f75b05c..ef44439cd89e 100644 --- a/ext/sockets/tests/socket_set_option_sndtimeo.phpt +++ b/ext/sockets/tests/socket_set_option_sndtimeo.phpt @@ -17,7 +17,7 @@ socket_set_block($socket); try { $retval_1 = socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, []); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } //set/get comparison @@ -30,6 +30,6 @@ var_dump($retval_3 === $options); socket_close($socket); ?> --EXPECT-- -socket_set_option(): Argument #4 ($value) must have key "sec" +ValueError: socket_set_option(): Argument #4 ($value) must have key "sec" bool(true) bool(true) diff --git a/ext/sockets/tests/socket_set_option_timeo_error.phpt b/ext/sockets/tests/socket_set_option_timeo_error.phpt index befdfb095855..3f52136e0e6b 100644 --- a/ext/sockets/tests/socket_set_option_timeo_error.phpt +++ b/ext/sockets/tests/socket_set_option_timeo_error.phpt @@ -18,56 +18,56 @@ $options_6 = array("l_onoff" => "1", "l_linger" => PHP_INT_MAX); try { socket_set_option( $socket, SOL_SOCKET, SO_RCVTIMEO, new stdClass); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_RCVTIMEO, $options_1); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_SNDTIMEO, $options_2); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_RCVTIMEO, "not good"); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_LINGER, "not good neither"); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_3); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_4); } catch (\TypeError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_5); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_set_option( $socket, SOL_SOCKET, SO_LINGER, $options_6); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -socket_set_option(): Argument #4 ($value) must have key "sec" +ValueError: socket_set_option(): Argument #4 ($value) must have key "sec" Warning: Object of class stdClass could not be converted to int in %s on line %d -socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is SO_RCVTIMEO, string given -socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is SO_LINGER, string given -socket_set_option(): Argument #4 ($value) "l_onoff" must be between 0 and %d -socket_set_option(): Argument #4 ($value) "l_linger" must be between 0 and %d +TypeError: socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is SO_RCVTIMEO, string given +TypeError: socket_set_option(): Argument #4 ($value) must be of type array when argument #3 ($option) is SO_LINGER, string given +ValueError: socket_set_option(): Argument #4 ($value) "l_onoff" must be between 0 and %d +ValueError: socket_set_option(): Argument #4 ($value) "l_linger" must be between 0 and %d diff --git a/ext/sockets/tests/socket_setoption_tcpusertimeout_64bit.phpt b/ext/sockets/tests/socket_setoption_tcpusertimeout_64bit.phpt index 894a24d2a49b..8c6ab6ac93e7 100644 --- a/ext/sockets/tests/socket_setoption_tcpusertimeout_64bit.phpt +++ b/ext/sockets/tests/socket_setoption_tcpusertimeout_64bit.phpt @@ -18,13 +18,13 @@ socket_set_block($socket); try { socket_setopt($socket, SOL_TCP, TCP_USER_TIMEOUT, -1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { socket_setopt($socket, SOL_TCP, TCP_USER_TIMEOUT, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $timeout = 200; @@ -35,7 +35,7 @@ var_dump($retval_3 === $timeout); socket_close($socket); ?> --EXPECTF-- -socket_setopt(): Argument #4 ($value) must be between 0 and %d -socket_setopt(): Argument #4 ($value) must be between 0 and %d +ValueError: socket_setopt(): Argument #4 ($value) must be between 0 and %d +ValueError: socket_setopt(): Argument #4 ($value) must be between 0 and %d bool(true) bool(true) diff --git a/ext/sodium/tests/bug78114.phpt b/ext/sodium/tests/bug78114.phpt index b988c09ec23f..cea157e99655 100644 --- a/ext/sodium/tests/bug78114.phpt +++ b/ext/sodium/tests/bug78114.phpt @@ -7,8 +7,8 @@ sodium try { eval('sodium_bin2hex();'); } catch (Throwable $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- -sodium_bin2hex() expects exactly 1 argument, 0 given +ArgumentCountError: sodium_bin2hex() expects exactly 1 argument, 0 given diff --git a/ext/sodium/tests/crypto_auth.phpt b/ext/sodium/tests/crypto_auth.phpt index 8f262414beb8..20b7ba7ebade 100644 --- a/ext/sodium/tests/crypto_auth.phpt +++ b/ext/sodium/tests/crypto_auth.phpt @@ -16,7 +16,7 @@ try { $mac = sodium_crypto_auth($msg, $bad_key); echo 'Fail!', PHP_EOL; } catch (SodiumException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } // Flip the first bit @@ -41,7 +41,7 @@ var_dump(sodium_crypto_auth_verify($badmac, $msg, $key)); ?> --EXPECT-- bool(true) -sodium_crypto_auth(): Argument #2 ($key) must be SODIUM_CRYPTO_AUTH_KEYBYTES bytes long +SodiumException: sodium_crypto_auth(): Argument #2 ($key) must be SODIUM_CRYPTO_AUTH_KEYBYTES bytes long bool(false) bool(false) bool(false) diff --git a/ext/sodium/tests/crypto_box.phpt b/ext/sodium/tests/crypto_box.phpt index f77ec1601cf3..82a392d3260c 100644 --- a/ext/sodium/tests/crypto_box.phpt +++ b/ext/sodium/tests/crypto_box.phpt @@ -49,7 +49,7 @@ try { substr($alice_to_bob_kp, 1) ); } catch (SodiumException $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } sodium_memzero($alice_box_kp); @@ -142,7 +142,7 @@ bool(true) bool(true) bool(true) bool(true) -sodium_crypto_box(): Argument #3 ($key_pair) must be SODIUM_CRYPTO_BOX_KEYPAIRBYTES bytes long +SodiumException: sodium_crypto_box(): Argument #3 ($key_pair) must be SODIUM_CRYPTO_BOX_KEYPAIRBYTES bytes long bool(true) string(17) "Hi, this is Alice" string(21) "Hi Alice! This is Bob" diff --git a/ext/sodium/tests/crypto_core_ristretto255.phpt b/ext/sodium/tests/crypto_core_ristretto255.phpt index f1d20fd22aec..65aa52f3eead 100644 --- a/ext/sodium/tests/crypto_core_ristretto255.phpt +++ b/ext/sodium/tests/crypto_core_ristretto255.phpt @@ -78,7 +78,7 @@ $s = sodium_crypto_core_ristretto255_random(); try { $multL = sodium_crypto_scalarmult_ristretto255($s, $L); } catch (SodiumException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $s2 = sodium_crypto_scalarmult_ristretto255($r, $s); @@ -128,6 +128,6 @@ bool(false) bool(false) string(64) "3066f82a1a747d45120d1740f14358531a8f04bbffe6a819f86dfe50f44a0a46" bool(true) -Result is identity element +SodiumException: Result is identity element bool(true) bool(true) diff --git a/ext/sodium/tests/crypto_scalarmult_ristretto255.phpt b/ext/sodium/tests/crypto_scalarmult_ristretto255.phpt index 0a21d64075dc..3568019cce7c 100644 --- a/ext/sodium/tests/crypto_scalarmult_ristretto255.phpt +++ b/ext/sodium/tests/crypto_scalarmult_ristretto255.phpt @@ -14,12 +14,12 @@ $n = str_repeat("\0", SODIUM_CRYPTO_SCALARMULT_RISTRETTO255_SCALARBYTES); try { $p = sodium_crypto_scalarmult_ristretto255_base($n); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { $p2 = sodium_crypto_scalarmult_ristretto255($n, $b); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } for ($i = 1; $i < 16; $i++) { @@ -33,13 +33,13 @@ for ($i = 1; $i < 16; $i++) { try { sodium_crypto_scalarmult(substr($n, 1), $p); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -sodium_crypto_scalarmult_ristretto255_base(): Argument #1 ($n) must not be zero -Result is identity element +SodiumException: sodium_crypto_scalarmult_ristretto255_base(): Argument #1 ($n) must not be zero +SodiumException: Result is identity element string(64) "e2f2ae0a6abc4e71a884a961c500515f58e30b6aa582dd8db6a65945e08d2d76" string(64) "6a493210f7499cd17fecb510ae0cea23a110e8d5b901f8acadd3095c73a3b919" string(64) "94741f5d5d52755ece4f23f044ee27d5d1ea1e2bd196b462166b16152a9d0259" @@ -55,4 +55,4 @@ string(64) "e4549ee16b9aa03099ca208c67adafcafa4c3f3e4e5303de6026e3ca8ff84460" string(64) "aa52e000df2e16f55fb1032fc33bc42742dad6bd5a8fc0be0167436c5948501f" string(64) "46376b80f409b29dc2b5f6f0c52591990896e5716f41477cd30085ab7f10301e" string(64) "e0c418f7c8d9c4cdd7395b93ea124f3ad99021bb681dfc3302a9d99a2e53e64e" -sodium_crypto_scalarmult(): Argument #1 ($n) must be SODIUM_CRYPTO_SCALARMULT_SCALARBYTES bytes long +SodiumException: sodium_crypto_scalarmult(): Argument #1 ($n) must be SODIUM_CRYPTO_SCALARMULT_SCALARBYTES bytes long diff --git a/ext/sodium/tests/crypto_stream_xchacha20.phpt b/ext/sodium/tests/crypto_stream_xchacha20.phpt index 466734853d70..0db0a4a487c4 100644 --- a/ext/sodium/tests/crypto_stream_xchacha20.phpt +++ b/ext/sodium/tests/crypto_stream_xchacha20.phpt @@ -53,27 +53,27 @@ var_dump($stream7_unified === $stream7_concat); try { sodium_crypto_stream_xchacha20(-1, $nonce, $key); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20($len, substr($nonce, 1), $key); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20($len, $nonce, substr($key, 1)); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20_xor($stream, substr($nonce, 1), $key); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { sodium_crypto_stream_xchacha20_xor($stream, $nonce, substr($key, 1)); } catch (SodiumException $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> @@ -89,8 +89,8 @@ bool(true) bool(true) int(128) bool(true) -sodium_crypto_stream_xchacha20(): Argument #1 ($length) must be greater than 0 -sodium_crypto_stream_xchacha20(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long -sodium_crypto_stream_xchacha20(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long -sodium_crypto_stream_xchacha20_xor(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long -sodium_crypto_stream_xchacha20_xor(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long +SodiumException: sodium_crypto_stream_xchacha20(): Argument #1 ($length) must be greater than 0 +SodiumException: sodium_crypto_stream_xchacha20(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long +SodiumException: sodium_crypto_stream_xchacha20(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long +SodiumException: sodium_crypto_stream_xchacha20_xor(): Argument #2 ($nonce) must be SODIUM_CRYPTO_STREAM_XCHACHA20_NONCEBYTES bytes long +SodiumException: sodium_crypto_stream_xchacha20_xor(): Argument #3 ($key) must be SODIUM_CRYPTO_STREAM_XCHACHA20_KEYBYTES bytes long diff --git a/ext/sodium/tests/inc_add.phpt b/ext/sodium/tests/inc_add.phpt index 7652cf851eb2..60dae7db9f75 100644 --- a/ext/sodium/tests/inc_add.phpt +++ b/ext/sodium/tests/inc_add.phpt @@ -9,7 +9,7 @@ $notStr = 123; try { sodium_increment($notStr); } catch (SodiumException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $str = "abc"; @@ -28,7 +28,7 @@ $notStr = 123; try { sodium_add($notStr, $addStr); } catch (SodiumException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $str = "abc"; @@ -43,12 +43,12 @@ var_dump($str, $str2); ?> --EXPECT-- -a PHP string is required +SodiumException: a PHP string is required string(3) "bbc" string(3) "abc" string(3) "bbc" string(3) "abc" -PHP strings are required +SodiumException: PHP strings are required string(3) "cbc" string(3) "abc" string(3) "cbc" diff --git a/ext/sodium/tests/pwhash_memlimit_below_min.phpt b/ext/sodium/tests/pwhash_memlimit_below_min.phpt index 8913afb382f0..68fe135775c9 100644 --- a/ext/sodium/tests/pwhash_memlimit_below_min.phpt +++ b/ext/sodium/tests/pwhash_memlimit_below_min.phpt @@ -13,15 +13,15 @@ $salt = str_repeat("a", SODIUM_CRYPTO_PWHASH_SALTBYTES); try { sodium_crypto_pwhash(32, "password", $salt, SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, 1); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sodium_crypto_pwhash_str("password", SODIUM_CRYPTO_PWHASH_OPSLIMIT_INTERACTIVE, 1); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -sodium_crypto_pwhash(): Argument #5 ($memlimit) must be greater than or equal to %d -sodium_crypto_pwhash_str(): Argument #3 ($memlimit) must be greater than or equal to %d +ValueError: sodium_crypto_pwhash(): Argument #5 ($memlimit) must be greater than or equal to %d +ValueError: sodium_crypto_pwhash_str(): Argument #3 ($memlimit) must be greater than or equal to %d diff --git a/ext/sodium/tests/sodium_crypto_sign_ed25519_pk_to_curve25519_failure_leak.phpt b/ext/sodium/tests/sodium_crypto_sign_ed25519_pk_to_curve25519_failure_leak.phpt index 1e4e74eecbe0..c2485cc5e780 100644 --- a/ext/sodium/tests/sodium_crypto_sign_ed25519_pk_to_curve25519_failure_leak.phpt +++ b/ext/sodium/tests/sodium_crypto_sign_ed25519_pk_to_curve25519_failure_leak.phpt @@ -8,9 +8,9 @@ sodium try { sodium_crypto_sign_ed25519_pk_to_curve25519(str_repeat("\x00", SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES)); } catch (SodiumException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -conversion failed +SodiumException: conversion failed diff --git a/ext/sodium/tests/utils.phpt b/ext/sodium/tests/utils.phpt index 66969a60bdf4..f60aa4dbd082 100644 --- a/ext/sodium/tests/utils.phpt +++ b/ext/sodium/tests/utils.phpt @@ -102,7 +102,7 @@ function sodium_foo() try { sodium_foo(); } catch (SodiumException $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> @@ -126,4 +126,4 @@ string(25) "base64("O1R") case passed" string(24) "base64("O1") case passed" string(23) "base64("O") case passed" string(4) "abcd" -string(4) "test" +SodiumException: test diff --git a/ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt b/ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt index b563c2c84d08..e385ef4922cf 100644 --- a/ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt +++ b/ext/spl/tests/ArrayObject/ArrayObject_exchange_array_during_sorting.phpt @@ -10,7 +10,7 @@ $ao->uasort(function($a, $b) use ($ao, &$i) { try { $ao->exchangeArray([4, 5, 6]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao); } @@ -19,7 +19,7 @@ $ao->uasort(function($a, $b) use ($ao, &$i) { ?> --EXPECT-- -Modification of ArrayObject during sorting is prohibited +Error: Modification of ArrayObject during sorting is prohibited object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { diff --git a/ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt b/ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt index a2803e472966..c97e10ed2582 100644 --- a/ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt +++ b/ext/spl/tests/ArrayObject/ArrayObject_illegal_offset.phpt @@ -7,33 +7,33 @@ $ao = new ArrayObject([1, 2, 3]); try { var_dump($ao[[]]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ao[[]] = new stdClass; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $ref =& $ao[[]]; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($ao[[]])); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($ao[[]]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access offset of type array on ArrayObject -Cannot access offset of type array on ArrayObject -Cannot access offset of type array on ArrayObject -Cannot access offset of type array in isset or empty -Cannot unset offset of type array on ArrayObject +TypeError: Cannot access offset of type array on ArrayObject +TypeError: Cannot access offset of type array on ArrayObject +TypeError: Cannot access offset of type array on ArrayObject +TypeError: Cannot access offset of type array in isset or empty +TypeError: Cannot unset offset of type array on ArrayObject diff --git a/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt index 13065b4ac38a..8ff0b93e79dd 100644 --- a/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt +++ b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_SplFixedArray.phpt @@ -9,9 +9,9 @@ try { // See GH-15918: this *should* fail to not break invariants $ao->exchangeArray($fixedArray); } catch (InvalidArgumentException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d -Overloaded object of type SplFixedArray is not compatible with ArrayObject +InvalidArgumentException: Overloaded object of type SplFixedArray is not compatible with ArrayObject diff --git a/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt index 8cc66facc005..2d8d566f7e5e 100644 --- a/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt +++ b/ext/spl/tests/ArrayObject/ArrayObject_overloaded_object_incompatible.phpt @@ -7,14 +7,14 @@ $ao = new ArrayObject([1, 2, 3]); try { $ao->exchangeArray(new DateInterval('P1D')); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao); ?> --EXPECTF-- Deprecated: ArrayObject::exchangeArray(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d -Overloaded object of type DateInterval is not compatible with ArrayObject +InvalidArgumentException: Overloaded object of type DateInterval is not compatible with ArrayObject object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { diff --git a/ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt b/ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt index a9fbc9d3b030..384fb206b62e 100644 --- a/ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject___construct_error1.phpt @@ -8,18 +8,18 @@ $a->p = 1; try { var_dump(new ArrayObject($a, 0, "Exception")); } catch (TypeError $e) { - echo $e->getMessage() . "(" . $e->getLine() . ")\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } echo "Non-existent class:\n"; try { var_dump(new ArrayObject(new stdClass, 0, "nonExistentClassName")); } catch (TypeError $e) { - echo $e->getMessage() . "(" . $e->getLine() . ")\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } ?> --EXPECT-- Bad iterator type: -ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, Exception given(6) +TypeError: ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, Exception given on line 6 Non-existent class: -ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClassName given(13) +TypeError: ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClassName given on line 13 diff --git a/ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt b/ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt index c3804f0d0afd..f605377f9051 100644 --- a/ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject___construct_error2.phpt @@ -14,9 +14,9 @@ Class C implements Iterator { try { var_dump(new ArrayObject(new stdClass, 0, "C", "extra")); } catch (TypeError $e) { - echo $e->getMessage() . "(" . $e->getLine() . ")\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } ?> --EXPECT-- Too many arguments: -ArrayObject::__construct() expects at most 3 arguments, 4 given(12) +ArgumentCountError: ArrayObject::__construct() expects at most 3 arguments, 4 given on line 12 diff --git a/ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt b/ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt index efce55d4d587..22f69324fae0 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_asort_basic1.phpt @@ -16,7 +16,7 @@ var_dump($ao1); try { var_dump($ao2->asort('blah')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao2); var_dump($ao2->asort(SORT_NUMERIC)); @@ -36,7 +36,7 @@ object(ArrayObject)#%d (1) { int(4) } } -ArrayObject::asort(): Argument #1 ($flags) must be of type int, string given +TypeError: ArrayObject::asort(): Argument #1 ($flags) must be of type int, string given object(ArrayObject)#%d (1) { ["storage":"ArrayObject":private]=> array(3) { diff --git a/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt index 4ba09cd388f2..8a7cbe5d9abb 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic2.phpt @@ -104,4 +104,4 @@ object(ArrayObject)#%d (1) { } } } -} \ No newline at end of file +} diff --git a/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt index 8db9b016fda8..08569a7194fc 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_exchangeArray_basic3.phpt @@ -16,7 +16,7 @@ try { $copy = $ao->exchangeArray($swapIn); $copy['addedToCopy'] = 'added To Copy'; } catch (Exception $e) { - echo "Exception:" . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $swapIn->addedToSwapIn = 'added To Swap-In'; $original->addedToOriginal = 'added To Original'; @@ -31,7 +31,7 @@ try { $copy = $ao->exchangeArray(); $copy['addedToCopy'] = 'added To Copy'; } catch (TypeError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $original->addedToOriginal = 'added To Original'; var_dump($ao, $original, $copy); @@ -44,7 +44,7 @@ try { $copy = $ao->exchangeArray(null); $copy['addedToCopy'] = 'added To Copy'; } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $original->addedToOriginal = 'added To Original'; var_dump($ao, $original, $copy); @@ -92,7 +92,7 @@ array(2) { --> exchangeArray() with no arg: Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d -Exception: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given +ArgumentCountError: ArrayObject::exchangeArray() expects exactly 1 argument, 0 given Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d @@ -118,7 +118,7 @@ NULL --> exchangeArray() with bad arg type: Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d -ArrayObject::exchangeArray(): Argument #1 ($array) must be of type array, null given +TypeError: ArrayObject::exchangeArray(): Argument #1 ($array) must be of type array, null given Deprecated: Creation of dynamic property C::$addedToOriginal is deprecated in %s on line %d diff --git a/ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt b/ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt index 27605461cbeb..8f8bd605ba3b 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_ksort_basic1.phpt @@ -15,7 +15,7 @@ var_dump($ao1); try { var_dump($ao2->ksort('blah')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao2); var_dump($ao2->ksort(SORT_STRING)); @@ -35,7 +35,7 @@ object(ArrayObject)#%d (1) { int(3) } } -ArrayObject::ksort(): Argument #1 ($flags) must be of type int, string given +TypeError: ArrayObject::ksort(): Argument #1 ($flags) must be of type int, string given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(4) { diff --git a/ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt b/ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt index 9949fbda06aa..31ebae0e8112 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_natcasesort_basic1.phpt @@ -16,7 +16,7 @@ var_dump($ao1); try { var_dump($ao2->natcasesort('blah')); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao2); ?> @@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) { string(5) "boo22" } } -ArrayObject::natcasesort() expects exactly 0 arguments, 1 given +ArgumentCountError: ArrayObject::natcasesort() expects exactly 0 arguments, 1 given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(5) { diff --git a/ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt b/ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt index 474c142de0a4..6b45a4edd86b 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_natsort_basic1.phpt @@ -16,7 +16,7 @@ var_dump($ao1); try { var_dump($ao2->natsort('blah')); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ao2); ?> @@ -38,7 +38,7 @@ object(ArrayObject)#1 (1) { string(5) "boo22" } } -ArrayObject::natsort() expects exactly 0 arguments, 1 given +ArgumentCountError: ArrayObject::natsort() expects exactly 0 arguments, 1 given object(ArrayObject)#2 (1) { ["storage":"ArrayObject":private]=> array(5) { diff --git a/ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt b/ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt index 9a0e67b6052f..1eb8d17ca66c 100644 --- a/ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt +++ b/ext/spl/tests/ArrayObject/arrayObject_setIteratorClass_error1.phpt @@ -9,7 +9,7 @@ try { echo " $key=>$value\n"; } } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -19,7 +19,7 @@ try { echo " $key=>$value\n"; } } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -29,7 +29,7 @@ try { echo " $key=>$value\n"; } } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -38,12 +38,12 @@ try { echo " $key=>$value\n"; } } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(133) "ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClass given" -string(125) "ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, stdClass given" -string(128) "ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClass given" -string(120) "ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, stdClass given" +TypeError: ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClass given +TypeError: ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, stdClass given +TypeError: ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, nonExistentClass given +TypeError: ArrayObject::__construct(): Argument #3 ($iteratorClass) must be a class name derived from ArrayIterator, stdClass given diff --git a/ext/spl/tests/ArrayObject/array_014.phpt b/ext/spl/tests/ArrayObject/array_014.phpt index 37ed9abad507..ec061ca135aa 100644 --- a/ext/spl/tests/ArrayObject/array_014.phpt +++ b/ext/spl/tests/ArrayObject/array_014.phpt @@ -16,7 +16,7 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -26,7 +26,7 @@ try } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $pos = 0; @@ -41,8 +41,8 @@ foreach($it as $v) int(11) int(5) int(4) -Seek position -1 is out of range -Seek position 12 is out of range +OutOfBoundsException: Seek position -1 is out of range +OutOfBoundsException: Seek position 12 is out of range int(0) int(1) int(2) diff --git a/ext/spl/tests/ArrayObject/array_018.phpt b/ext/spl/tests/ArrayObject/array_018.phpt index 948e0dca4e53..b6ee252820bc 100644 --- a/ext/spl/tests/ArrayObject/array_018.phpt +++ b/ext/spl/tests/ArrayObject/array_018.phpt @@ -10,7 +10,7 @@ try } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); @@ -23,7 +23,7 @@ try } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($foo); diff --git a/ext/spl/tests/ArrayObject/gh15833_2.phpt b/ext/spl/tests/ArrayObject/gh15833_2.phpt index 5d7721e25dd2..1b21535aed30 100644 --- a/ext/spl/tests/ArrayObject/gh15833_2.phpt +++ b/ext/spl/tests/ArrayObject/gh15833_2.phpt @@ -16,27 +16,27 @@ $recursiveArrayIterator = new RecursiveArrayIterator($obj); try { var_dump($recursiveArrayIterator->current()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($recursiveArrayIterator->current()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $recursiveArrayIterator->next(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($recursiveArrayIterator->current()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --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 -nope 0 -nope 1 -nope 2 -nope 3 +Error: nope 0 +Error: nope 1 +Error: nope 2 +Error: nope 3 diff --git a/ext/spl/tests/ArrayObject/gh15918.phpt b/ext/spl/tests/ArrayObject/gh15918.phpt index 5efdb887f9b5..f16d25d54ad1 100644 --- a/ext/spl/tests/ArrayObject/gh15918.phpt +++ b/ext/spl/tests/ArrayObject/gh15918.phpt @@ -6,9 +6,9 @@ $foo = new SplFixedArray(5); try { $arrayObject = new ArrayObject($foo); } catch (InvalidArgumentException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: ArrayObject::__construct(): Using an object as a backing array for ArrayObject is deprecated, as it allows violating class constraints and invariants in %s on line %d -Overloaded object of type SplFixedArray is not compatible with ArrayObject +InvalidArgumentException: Overloaded object of type SplFixedArray is not compatible with ArrayObject diff --git a/ext/spl/tests/ArrayObject_construct_during_sorting.phpt b/ext/spl/tests/ArrayObject_construct_during_sorting.phpt index cec41dc92cd0..6638c8f55227 100644 --- a/ext/spl/tests/ArrayObject_construct_during_sorting.phpt +++ b/ext/spl/tests/ArrayObject_construct_during_sorting.phpt @@ -11,7 +11,7 @@ $ao->uasort(function($a, $b) use ($ao, $other, &$i) { try { $ao->__construct($other); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } return $a <=> $b; @@ -20,7 +20,7 @@ var_dump($ao); ?> --EXPECT-- -Modification of ArrayObject during sorting is prohibited +Error: Modification of ArrayObject during sorting is prohibited object(ArrayObject)#1 (1) { ["storage":"ArrayObject":private]=> array(3) { diff --git a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt index bba7e0f8a9ad..a939b739cdff 100644 --- a/ext/spl/tests/CallbackFilterIteratorTest-002.phpt +++ b/ext/spl/tests/CallbackFilterIteratorTest-002.phpt @@ -11,25 +11,25 @@ set_error_handler(function($errno, $errstr){ try { new CallbackFilterIterator(); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new CallbackFilterIterator(null); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new CallbackFilterIterator(new ArrayIterator(array()), null); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new CallbackFilterIterator(new ArrayIterator(array()), array()); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $it = new CallbackFilterIterator(new ArrayIterator(array(1)), function() { @@ -38,12 +38,12 @@ $it = new CallbackFilterIterator(new ArrayIterator(array(1)), function() { try { foreach($it as $e); } catch(Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -CallbackFilterIterator::__construct() expects exactly 2 arguments, 0 given -CallbackFilterIterator::__construct() expects exactly 2 arguments, 1 given -CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, no array or string given -CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, array callback must have exactly two members -some message +ArgumentCountError: CallbackFilterIterator::__construct() expects exactly 2 arguments, 0 given +ArgumentCountError: CallbackFilterIterator::__construct() expects exactly 2 arguments, 1 given +TypeError: CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, no array or string given +TypeError: CallbackFilterIterator::__construct(): Argument #2 ($callback) must be a valid callback, array callback must have exactly two members +Exception: some message diff --git a/ext/spl/tests/DirectoryIterator_empty_constructor.phpt b/ext/spl/tests/DirectoryIterator_empty_constructor.phpt index 3db6700d2e94..23d3168c155a 100644 --- a/ext/spl/tests/DirectoryIterator_empty_constructor.phpt +++ b/ext/spl/tests/DirectoryIterator_empty_constructor.phpt @@ -8,8 +8,8 @@ Havard Eide try { $it = new DirectoryIterator(""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -DirectoryIterator::__construct(): Argument #1 ($directory) must not be empty +ValueError: DirectoryIterator::__construct(): Argument #1 ($directory) must not be empty diff --git a/ext/spl/tests/DirectoryIterator_uninitialized.phpt b/ext/spl/tests/DirectoryIterator_uninitialized.phpt index cb63b555aab9..ea393f5da02d 100644 --- a/ext/spl/tests/DirectoryIterator_uninitialized.phpt +++ b/ext/spl/tests/DirectoryIterator_uninitialized.phpt @@ -11,9 +11,9 @@ $it = new MyDirectoryIterator; try { $it->key(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object not initialized +Error: Object not initialized diff --git a/ext/spl/tests/GH-22047.phpt b/ext/spl/tests/GH-22047.phpt index b01fbfd633c0..0a7d66ba52ed 100644 --- a/ext/spl/tests/GH-22047.phpt +++ b/ext/spl/tests/GH-22047.phpt @@ -13,9 +13,9 @@ try { echo "should not reach here\n"; } } catch (UnexpectedValueException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Cannot deserialize ArrayObject with iterator class 'GlobIterator'; this class is not derived from ArrayIterator +UnexpectedValueException: Cannot deserialize ArrayObject with iterator class 'GlobIterator'; this class is not derived from ArrayIterator diff --git a/ext/spl/tests/GlobIterator_constructor_count.phpt b/ext/spl/tests/GlobIterator_constructor_count.phpt index 5f96be6219d6..5a5dd7845604 100644 --- a/ext/spl/tests/GlobIterator_constructor_count.phpt +++ b/ext/spl/tests/GlobIterator_constructor_count.phpt @@ -7,8 +7,8 @@ $in = $rc->newInstanceWithoutConstructor(); try { count($in); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -GlobIterator is not initialized +Error: GlobIterator is not initialized diff --git a/ext/spl/tests/RecursiveIteratorIterator_invalid_aggregate.phpt b/ext/spl/tests/RecursiveIteratorIterator_invalid_aggregate.phpt index e877de6ae024..4e9264739c9c 100644 --- a/ext/spl/tests/RecursiveIteratorIterator_invalid_aggregate.phpt +++ b/ext/spl/tests/RecursiveIteratorIterator_invalid_aggregate.phpt @@ -13,9 +13,9 @@ class MyIteratorAggregate implements IteratorAggregate { try { new RecursiveIteratorIterator(new MyIteratorAggregate); } catch (LogicException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -MyIteratorAggregate::getIterator() must return an object that implements Traversable +LogicException: MyIteratorAggregate::getIterator() must return an object that implements Traversable diff --git a/ext/spl/tests/RecursiveIteratorIterator_not_initialized.phpt b/ext/spl/tests/RecursiveIteratorIterator_not_initialized.phpt index 4e90692843d6..c34122c11ac9 100644 --- a/ext/spl/tests/RecursiveIteratorIterator_not_initialized.phpt +++ b/ext/spl/tests/RecursiveIteratorIterator_not_initialized.phpt @@ -8,9 +8,9 @@ $it = $rc->newInstanceWithoutConstructor(); try { foreach ($it as $v) {} } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object is not initialized +Error: Object is not initialized diff --git a/ext/spl/tests/SPLDoublyLinkedList_iterate_by_reference.phpt b/ext/spl/tests/SPLDoublyLinkedList_iterate_by_reference.phpt index 769136c4064f..385d9590485a 100644 --- a/ext/spl/tests/SPLDoublyLinkedList_iterate_by_reference.phpt +++ b/ext/spl/tests/SPLDoublyLinkedList_iterate_by_reference.phpt @@ -18,9 +18,9 @@ try { echo $value, PHP_EOL; } } catch (\Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference diff --git a/ext/spl/tests/SplArray_fromArray.phpt b/ext/spl/tests/SplArray_fromArray.phpt index 143d2755a81d..01d2875d272c 100644 --- a/ext/spl/tests/SplArray_fromArray.phpt +++ b/ext/spl/tests/SplArray_fromArray.phpt @@ -10,8 +10,8 @@ $splArray = new SplFixedArray(); try { $splArray->fromArray($array); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -integer overflow detected +InvalidArgumentException: integer overflow detected diff --git a/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt b/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt index 347450fbe4b5..1c496aeffc0f 100644 --- a/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt @@ -6,8 +6,8 @@ try { $dll = new SplDoublyLinkedList(); var_dump($dll->add(12,'Offset 12 should not exist')); } catch (OutOfRangeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt b/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt index 1872436cea63..493265428180 100644 --- a/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt @@ -6,8 +6,8 @@ try { $dll = new SplDoublyLinkedList(); var_dump($dll->add([],2)); } catch (TypeError $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: SplDoublyLinkedList::add(): Argument #1 ($index) must be of type int, array given +TypeError: SplDoublyLinkedList::add(): Argument #1 ($index) must be of type int, array given diff --git a/ext/spl/tests/SplDoublyLinkedList_bottom_empty.phpt b/ext/spl/tests/SplDoublyLinkedList_bottom_empty.phpt index 65f0b3d404eb..fd85e6aebeab 100644 --- a/ext/spl/tests/SplDoublyLinkedList_bottom_empty.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_bottom_empty.phpt @@ -7,8 +7,8 @@ Gabriel Caruso (carusogabriel34@gmail.com) try { (new SplDoublyLinkedList)->bottom(); } catch (RuntimeException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Can't peek at an empty datastructure +RuntimeException: Can't peek at an empty datastructure diff --git a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt index 4fa65b3a53ad..234628cd2758 100644 --- a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_greater_than_elements.phpt @@ -17,9 +17,9 @@ $ll->offsetUnset($ll->count() + 1); var_dump($ll); } catch(Exception $e) { -echo $e->getMessage(); +echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt index 614ebdf01bbb..f378de684b15 100644 --- a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_negative-parameter.phpt @@ -16,8 +16,8 @@ PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) $dll->offsetUnset(-1); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt index 6782bd948983..894f80766374 100644 --- a/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_offsetUnset_parameter-larger-num-elements.phpt @@ -16,8 +16,8 @@ PHPNW Testfest 2009 - Paul Court ( g@rgoyle.com ) $dll->offsetUnset(3); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::offsetUnset(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt b/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt index 644e54bb9a1d..ddcd20b23519 100644 --- a/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt +++ b/ext/spl/tests/SplDoublyLinkedList_top_empty.phpt @@ -7,8 +7,8 @@ Gabriel Caruso (carusogabriel34@gmail.com) try { (new SplDoublyLinkedList)->top(); } catch (RuntimeException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Can't peek at an empty datastructure +RuntimeException: Can't peek at an empty datastructure diff --git a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt index 4ace511e26b0..96d4e5eddefa 100644 --- a/ext/spl/tests/SplFileInfo_setFileClass_error.phpt +++ b/ext/spl/tests/SplFileInfo_setFileClass_error.phpt @@ -8,9 +8,9 @@ $info = new SplFileInfo(__FILE__); try { $info->setFileClass('stdClass'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, stdClass given +TypeError: SplFileInfo::setFileClass(): Argument #1 ($class) must be a class name derived from SplFileObject, stdClass given diff --git a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt index 1f64c353d328..10b568bc027f 100644 --- a/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt +++ b/ext/spl/tests/SplFileInfo_setInfoClass_error.phpt @@ -8,9 +8,9 @@ $info = new SplFileInfo(__FILE__); try { $info->setInfoClass('stdClass'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplFileInfo::setInfoClass(): Argument #1 ($class) must be a class name derived from SplFileInfo, stdClass given +TypeError: SplFileInfo::setInfoClass(): Argument #1 ($class) must be a class name derived from SplFileInfo, stdClass given diff --git a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_delimiter_error.phpt b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_delimiter_error.phpt index 7bfd61bbc188..99ce5203edf0 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_delimiter_error.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_delimiter_error.phpt @@ -20,7 +20,7 @@ $fo->setCsvControl(escape: ''); try { var_dump($fo->fgetcsv('invalid')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -28,4 +28,4 @@ try { unlink('SplFileObject__fgetcsv3.csv'); ?> --EXPECT-- -SplFileObject::fgetcsv(): Argument #1 ($separator) must be a single character +ValueError: SplFileObject::fgetcsv(): Argument #1 ($separator) must be a single character diff --git a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_enclosure_error.phpt b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_enclosure_error.phpt index 8ad609efab10..a13ac8d62a53 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_enclosure_error.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_enclosure_error.phpt @@ -20,7 +20,7 @@ $fo->setCsvControl(escape: ''); try { var_dump($fo->fgetcsv(enclosure: 'invalid')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -28,4 +28,4 @@ try { unlink('SplFileObject__fgetcsv5.csv'); ?> --EXPECT-- -SplFileObject::fgetcsv(): Argument #2 ($enclosure) must be a single character +ValueError: SplFileObject::fgetcsv(): Argument #2 ($enclosure) must be a single character diff --git a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_escape_error.phpt b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_escape_error.phpt index eb6fc4916111..d2421e23271f 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_escape_error.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_fgetcsv_escape_error.phpt @@ -10,7 +10,7 @@ $fo = new SplFileObject('SplFileObject__fgetcsv8.csv'); try { var_dump($fo->fgetcsv(',', '"', 'invalid')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -18,4 +18,4 @@ try { unlink('SplFileObject__fgetcsv8.csv'); ?> --EXPECT-- -SplFileObject::fgetcsv(): Argument #3 ($escape) must be empty or a single character +ValueError: SplFileObject::fgetcsv(): Argument #3 ($escape) must be empty or a single character diff --git a/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation13.phpt b/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation13.phpt index b21379994269..136491f915eb 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation13.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation13.phpt @@ -13,7 +13,7 @@ $fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv_variation13.csv', 'w') try { var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '"')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($fo); @@ -27,5 +27,5 @@ unlink($file); ?> --EXPECT-- *** Testing fputcsv() : with default enclosure & delimiter of two chars *** -SplFileObject::fputcsv(): Argument #2 ($separator) must be a single character +ValueError: SplFileObject::fputcsv(): Argument #2 ($separator) must be a single character Done diff --git a/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation14.phpt b/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation14.phpt index c660d217acb5..8a8cb968b0af 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation14.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_fputcsv_variation14.phpt @@ -13,12 +13,12 @@ $fo = new SplFileObject(__DIR__ . '/SplFileObject_fputcsv_variation14.csv', 'w') try { var_dump($fo->fputcsv(array('water', 'fruit'), ',,', '""')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($fo->fputcsv(array('water', 'fruit'), ',', '""')); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($fo); @@ -32,6 +32,6 @@ unlink($file); ?> --EXPECT-- *** Testing fputcsv() : with enclosure & delimiter of two chars and file opened in read mode *** -SplFileObject::fputcsv(): Argument #2 ($separator) must be a single character -SplFileObject::fputcsv(): Argument #3 ($enclosure) must be a single character +ValueError: SplFileObject::fputcsv(): Argument #2 ($separator) must be a single character +ValueError: SplFileObject::fputcsv(): Argument #3 ($enclosure) must be a single character Done diff --git a/ext/spl/tests/SplFileObject/SplFileObject_ftruncate_error_001.phpt b/ext/spl/tests/SplFileObject/SplFileObject_ftruncate_error_001.phpt index a77257cc5754..4fae0a83b23c 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_ftruncate_error_001.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_ftruncate_error_001.phpt @@ -26,8 +26,8 @@ $obj = New SplFileObject("SPLtest://ftruncate_test"); try { $obj->ftruncate(1); } catch (LogicException $e) { - echo($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -Can't truncate file %s +LogicException: Can't truncate file %s diff --git a/ext/spl/tests/SplFileObject/SplFileObject_getCurrentLine_invalid_override.phpt b/ext/spl/tests/SplFileObject/SplFileObject_getCurrentLine_invalid_override.phpt index 3501816366f8..ee9930b7c8ea 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_getCurrentLine_invalid_override.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_getCurrentLine_invalid_override.phpt @@ -14,9 +14,9 @@ $obj = new MySplFileObject(__FILE__); try { var_dump($obj->current()); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -MySplFileObject::getCurrentLine(): Return value must be of type string, array returned +TypeError: MySplFileObject::getCurrentLine(): Return value must be of type string, array returned diff --git a/ext/spl/tests/SplFileObject/SplFileObject_seek_error_001.phpt b/ext/spl/tests/SplFileObject/SplFileObject_seek_error_001.phpt index d29e86b955db..a590f49a5f20 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_seek_error_001.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_seek_error_001.phpt @@ -6,8 +6,8 @@ $obj = new SplFileObject(__FILE__); try { $obj->seek(-1); } catch (\ValueError $e) { - echo($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SplFileObject::seek(): Argument #1 ($line) must be greater than or equal to 0 +ValueError: SplFileObject::seek(): Argument #1 ($line) must be greater than or equal to 0 diff --git a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error001.phpt b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error001.phpt index a2fea52d5a00..3ff6478ca1df 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error001.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error001.phpt @@ -16,7 +16,7 @@ $s->setFlags(SplFileObject::READ_CSV); try { $s->setCsvControl('||'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -24,4 +24,4 @@ try { unlink('csv_control_data_error001.csv'); ?> --EXPECT-- -SplFileObject::setCsvControl(): Argument #1 ($separator) must be a single character +ValueError: SplFileObject::setCsvControl(): Argument #1 ($separator) must be a single character diff --git a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error002.phpt b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error002.phpt index 3e4c206fe0ab..3a33c479fa06 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error002.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error002.phpt @@ -16,7 +16,7 @@ $s->setFlags(SplFileObject::READ_CSV); try { $s->setCsvControl('|', 'two'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -24,4 +24,4 @@ try { unlink('csv_control_data_error002.csv'); ?> --EXPECT-- -SplFileObject::setCsvControl(): Argument #2 ($enclosure) must be a single character +ValueError: SplFileObject::setCsvControl(): Argument #2 ($enclosure) must be a single character diff --git a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error003.phpt b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error003.phpt index 35934f5e5cb0..a68d0ad29780 100644 --- a/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error003.phpt +++ b/ext/spl/tests/SplFileObject/SplFileObject_setCsvControl_error003.phpt @@ -18,7 +18,7 @@ $s->setFlags(SplFileObject::READ_CSV); try { $s->setCsvControl('|', '\'', 'three'); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -26,4 +26,4 @@ try { unlink('csv_control_data_error003.csv'); ?> --EXPECT-- -SplFileObject::setCsvControl(): Argument #3 ($escape) must be empty or a single character +ValueError: SplFileObject::setCsvControl(): Argument #3 ($escape) must be empty or a single character diff --git a/ext/spl/tests/SplFileObject/bug54292.phpt b/ext/spl/tests/SplFileObject/bug54292.phpt index 39bfb6f4dd63..53e8eedc8c11 100644 --- a/ext/spl/tests/SplFileObject/bug54292.phpt +++ b/ext/spl/tests/SplFileObject/bug54292.phpt @@ -6,9 +6,9 @@ Bug #54292 (Wrong parameter causes crash in SplFileObject::__construct()) try { new SplFileObject('foo', array()); } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(85) "SplFileObject::__construct(): Argument #2 ($mode) must be of type string, array given" +TypeError: SplFileObject::__construct(): Argument #2 ($mode) must be of type string, array given diff --git a/ext/spl/tests/SplFileObject/bug65545.phpt b/ext/spl/tests/SplFileObject/bug65545.phpt index 8ebbf648c97c..afac7c0f2684 100644 --- a/ext/spl/tests/SplFileObject/bug65545.phpt +++ b/ext/spl/tests/SplFileObject/bug65545.phpt @@ -10,7 +10,7 @@ try { $data = $obj->fread(0); var_dump($data); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // read more data than is available @@ -20,5 +20,5 @@ var_dump(strlen($data) === filesize(__FILE__) - 5); ?> --EXPECT-- string(5) "getPath(), -1); var_dump($l != '/' && $l != '\\' && $l == $lp); } catch (LogicException $e) { - echo "LogicException: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $fo = $o->openFile(); var_dump($fo->getPathName(), $fo->getFileName(), $fo->getPath()); } catch (LogicException $e) { - echo "LogicException: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/spl/tests/SplFileObject/fileobject_setmaxlinelen_error001.phpt b/ext/spl/tests/SplFileObject/fileobject_setmaxlinelen_error001.phpt index 018ecd47b42a..ea64231d04cb 100644 --- a/ext/spl/tests/SplFileObject/fileobject_setmaxlinelen_error001.phpt +++ b/ext/spl/tests/SplFileObject/fileobject_setmaxlinelen_error001.phpt @@ -9,9 +9,9 @@ try { $s->setMaxLineLen(-1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SplFileObject::setMaxLineLen(): Argument #1 ($maxLength) must be greater than or equal to 0 +ValueError: SplFileObject::setMaxLineLen(): Argument #1 ($maxLength) must be greater than or equal to 0 diff --git a/ext/spl/tests/SplFixedArray__construct_param_array.phpt b/ext/spl/tests/SplFixedArray__construct_param_array.phpt index 76f32855b2a2..5fa62c86a543 100644 --- a/ext/spl/tests/SplFixedArray__construct_param_array.phpt +++ b/ext/spl/tests/SplFixedArray__construct_param_array.phpt @@ -8,9 +8,9 @@ PHPNW Test Fest 2009 - Jordan Hatch try { $array = new SplFixedArray( array("string", 1) ); } catch (TypeError $iae) { - echo "Ok - ".$iae->getMessage().PHP_EOL; + echo $iae::class, ': ', $iae->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, array given +TypeError: SplFixedArray::__construct(): Argument #1 ($size) must be of type int, array given diff --git a/ext/spl/tests/SplFixedArray__construct_param_string.phpt b/ext/spl/tests/SplFixedArray__construct_param_string.phpt index 1c9a681e82a1..d9a49092287d 100644 --- a/ext/spl/tests/SplFixedArray__construct_param_string.phpt +++ b/ext/spl/tests/SplFixedArray__construct_param_string.phpt @@ -7,10 +7,10 @@ PHPNW Test Fest 2009 - Jordan Hatch try { $array = new SplFixedArray( "string" ); } catch (TypeError $iae) { - echo "Ok - ".$iae->getMessage().PHP_EOL; + echo $iae::class, ': ', $iae->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given +TypeError: SplFixedArray::__construct(): Argument #1 ($size) must be of type int, string given diff --git a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt index ab9b430d2a7e..0d2723c60e6d 100644 --- a/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt +++ b/ext/spl/tests/SplFixedArray_construct_param_SplFixedArray.phpt @@ -7,9 +7,9 @@ Philip Norton philipnorton42@gmail.com try { $array = new SplFixedArray(new SplFixedArray(3)); } catch (TypeError $iae) { - echo "Ok - ".$iae->getMessage().PHP_EOL; + echo $iae::class, ': ', $iae->getMessage(), PHP_EOL; } ?> --EXPECT-- -Ok - SplFixedArray::__construct(): Argument #1 ($size) must be of type int, SplFixedArray given +TypeError: SplFixedArray::__construct(): Argument #1 ($size) must be of type int, SplFixedArray given diff --git a/ext/spl/tests/SplHeap_serialize_corrupted.phpt b/ext/spl/tests/SplHeap_serialize_corrupted.phpt index 8763a4c08293..4abf239d04cc 100644 --- a/ext/spl/tests/SplHeap_serialize_corrupted.phpt +++ b/ext/spl/tests/SplHeap_serialize_corrupted.phpt @@ -28,7 +28,7 @@ try { serialize($heap); echo "FAIL: Serialization should have thrown\n"; } catch (Exception $e) { - echo "Serialization failed: " . $e->getMessage() . "\n"; + echo 'Serialization failed: ', $e::class, ': ', $e->getMessage(), "\n"; } class ThrowingPQ extends SplPriorityQueue { @@ -56,12 +56,12 @@ try { serialize($pq); echo "FAIL: PQ Serialization should have thrown\n"; } catch (Exception $e) { - echo "PQ Serialization failed: " . $e->getMessage() . "\n"; + echo 'PQ Serialization failed: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Heap is corrupted: YES -Serialization failed: Heap is corrupted, heap properties are no longer ensured. +Serialization failed: RuntimeException: Heap is corrupted, heap properties are no longer ensured. PriorityQueue is corrupted: YES -PQ Serialization failed: Heap is corrupted, heap properties are no longer ensured. +PQ Serialization failed: RuntimeException: Heap is corrupted, heap properties are no longer ensured. diff --git a/ext/spl/tests/SplHeap_serialize_error_handling.phpt b/ext/spl/tests/SplHeap_serialize_error_handling.phpt index 458f27db5ce0..bbcbe48515f1 100644 --- a/ext/spl/tests/SplHeap_serialize_error_handling.phpt +++ b/ext/spl/tests/SplHeap_serialize_error_handling.phpt @@ -37,7 +37,7 @@ foreach ($invalid_cases as $i => $case) { $heap->__unserialize($case); echo "Case $i: UNEXPECTED SUCCESS\n"; } catch (Exception $e) { - echo "Case $i: " . $e->getMessage() . "\n"; + echo "Case $i: ", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -60,25 +60,25 @@ foreach ($pq_invalid_cases as $i => $case) { $pq->__unserialize($case); echo "PQ Case $i: UNEXPECTED SUCCESS\n"; } catch (Exception $e) { - echo "PQ Case $i: " . $e->getMessage() . "\n"; + echo "PQ Case $i: ", $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -Case 0: Invalid serialization data for SplMaxHeap object -Case 1: Invalid serialization data for SplMaxHeap object -Case 2: Invalid serialization data for SplMaxHeap object -Case 3: Invalid serialization data for SplMaxHeap object -Case 4: Invalid serialization data for SplMaxHeap object -Case 5: Invalid serialization data for SplMaxHeap object -Case 6: Invalid serialization data for SplMaxHeap object -Case 7: Invalid serialization data for SplMaxHeap object -Case 8: Invalid serialization data for SplMaxHeap object -Case 9: Invalid serialization data for SplMaxHeap object -Case 10: Invalid serialization data for SplMaxHeap object -PQ Case 0: Invalid serialization data for SplPriorityQueue object -PQ Case 1: Invalid serialization data for SplPriorityQueue object -PQ Case 2: Invalid serialization data for SplPriorityQueue object -PQ Case 3: Invalid serialization data for SplPriorityQueue object -PQ Case 4: Invalid serialization data for SplPriorityQueue object +Case 0: Exception: Invalid serialization data for SplMaxHeap object +Case 1: Exception: Invalid serialization data for SplMaxHeap object +Case 2: Exception: Invalid serialization data for SplMaxHeap object +Case 3: Exception: Invalid serialization data for SplMaxHeap object +Case 4: Exception: Invalid serialization data for SplMaxHeap object +Case 5: Exception: Invalid serialization data for SplMaxHeap object +Case 6: Exception: Invalid serialization data for SplMaxHeap object +Case 7: Exception: Invalid serialization data for SplMaxHeap object +Case 8: Exception: Invalid serialization data for SplMaxHeap object +Case 9: Exception: Invalid serialization data for SplMaxHeap object +Case 10: Exception: Invalid serialization data for SplMaxHeap object +PQ Case 0: Exception: Invalid serialization data for SplPriorityQueue object +PQ Case 1: Exception: Invalid serialization data for SplPriorityQueue object +PQ Case 2: Exception: Invalid serialization data for SplPriorityQueue object +PQ Case 3: Exception: Invalid serialization data for SplPriorityQueue object +PQ Case 4: Exception: Invalid serialization data for SplPriorityQueue object diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_coalesce.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_coalesce.phpt index d4075018d341..91d80b3d7de8 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_coalesce.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_coalesce.phpt @@ -96,4 +96,4 @@ object(SplObjectStorage)#1 (1) { bool(false) } } -} \ No newline at end of file +} diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_current_empty_storage.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_current_empty_storage.phpt index 096cd511128b..fed9330c3fc7 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_current_empty_storage.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_current_empty_storage.phpt @@ -11,10 +11,10 @@ var_dump($s->valid()); try { var_dump($s->current()); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -Called current() on invalid iterator +RuntimeException: Called current() on invalid iterator diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_offsetGet_missing_object.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_offsetGet_missing_object.phpt index 54fcc23d4dcf..772d8a09e307 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_offsetGet_missing_object.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_offsetGet_missing_object.phpt @@ -11,9 +11,9 @@ $o1 = new stdClass(); try { $s->offsetGet($o1); } catch (UnexpectedValueException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Object not found +UnexpectedValueException: Object not found diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_seek.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_seek.phpt index ce21b2a621fe..cc0b9d3ce0cc 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_seek.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_seek.phpt @@ -25,12 +25,12 @@ echo "--- Error cases ---\n"; try { $storage->seek(-1); } catch (OutOfBoundsException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $storage->seek(5); } catch (OutOfBoundsException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($storage->key()); @@ -76,14 +76,14 @@ foreach (range(0, 2) as $index) { try { $storage->seek(3); } catch (OutOfBoundsException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- --- Error cases --- -Seek position -1 is out of range -Seek position 5 is out of range +OutOfBoundsException: Seek position -1 is out of range +OutOfBoundsException: Seek position 5 is out of range int(0) object(Test)#1 (1) { ["marker"]=> @@ -136,4 +136,4 @@ object(Test)#5 (1) { ["marker"]=> string(1) "e" } -Seek position 3 is out of range +OutOfBoundsException: Seek position 3 is out of range diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_bad.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_bad.phpt index b2fbf264286b..03ad16f57fd3 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_bad.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_bad.phpt @@ -15,14 +15,14 @@ try { $so->unserialize($blob); var_dump($so); } catch(UnexpectedValueException $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "DONE\n"; ?> --EXPECT-- -Error at offset 6 of 34 bytes -Error at offset 46 of 89 bytes +UnexpectedValueException: Error at offset 6 of 34 bytes +UnexpectedValueException: Error at offset 46 of 89 bytes object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(2) { @@ -45,5 +45,5 @@ object(SplObjectStorage)#2 (1) { } } } -Error at offset 78 of 78 bytes +UnexpectedValueException: Error at offset 78 of 78 bytes DONE diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter2.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter2.phpt index 0ff158c85c57..9d1afe16ef27 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter2.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter2.phpt @@ -20,14 +20,14 @@ foreach($data_provider as $input) { try { $s->unserialize($input); } catch(UnexpectedValueException $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECTF-- -Error at offset %d of %d bytes -Error at offset %d of %d bytes -Error at offset %d of %d bytes -Error at offset %d of %d bytes -Error at offset %d of %d bytes +UnexpectedValueException: Error at offset %d of %d bytes +UnexpectedValueException: Error at offset %d of %d bytes +UnexpectedValueException: Error at offset %d of %d bytes +UnexpectedValueException: Error at offset %d of %d bytes +UnexpectedValueException: Error at offset %d of %d bytes diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter3.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter3.phpt index 6934c3af1bf8..a82242dfb451 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter3.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unserialize_invalid_parameter3.phpt @@ -10,7 +10,7 @@ $s = new SplObjectStorage(); try { $s->unserialize(''); } catch(UnexpectedValueException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unset.phpt b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unset.phpt index 2e3e58c837cb..3c69760642ba 100644 --- a/ext/spl/tests/SplObjectStorage/SplObjectStorage_unset.phpt +++ b/ext/spl/tests/SplObjectStorage/SplObjectStorage_unset.phpt @@ -16,14 +16,14 @@ $s[$o] = new HasDestructor(); try { unset($s[$o]); } catch (Exception $e) { - echo "Caught: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($s); $s[$o] = new HasDestructor(); try { $s->offsetUnset($o); } catch (Exception $e) { - echo "Caught: {$e->getMessage()}\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($s); @@ -35,7 +35,7 @@ object(SplObjectStorage)#2 (1) { array(0) { } } -Caught: thrown from destructor +RuntimeException: thrown from destructor object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { @@ -47,9 +47,9 @@ object(SplObjectStorage)#2 (1) { array(0) { } } -Caught: thrown from destructor +RuntimeException: thrown from destructor object(SplObjectStorage)#2 (1) { ["storage":"SplObjectStorage":private]=> array(0) { } -} \ No newline at end of file +} diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt index 9da6270b6d7d..a4b4e7d3a986 100644 --- a/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion.phpt @@ -33,7 +33,7 @@ $other->mutate = true; try { $victim->removeAllExcept($other); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($victim), count($other)); @@ -48,15 +48,15 @@ $other->mutate = true; try { $other->addAll($victim); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($victim), count($other)); ?> --EXPECT-- -Modification of SplObjectStorage during getHash() is prohibited +Error: Modification of SplObjectStorage during getHash() is prohibited int(1024) int(1024) -Modification of SplObjectStorage during getHash() is prohibited +Error: Modification of SplObjectStorage during getHash() is prohibited int(1024) int(1024) diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt index aadbe2acba27..6c940869915e 100644 --- a/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion_addall.phpt @@ -20,13 +20,13 @@ $evil = new EvilStorage(); try { $evil->addAll($storage); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($evil), count($storage)); ?> --EXPECT-- -Modification of SplObjectStorage during getHash() is prohibited +Error: Modification of SplObjectStorage during getHash() is prohibited int(0) int(1) diff --git a/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt b/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt index 2602bc9e1f03..27bf06c347cf 100644 --- a/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt +++ b/ext/spl/tests/SplObjectStorage/concurrent_deletion_removeexcept.phpt @@ -20,13 +20,13 @@ $evil = new EvilStorage(); try { $storage->removeAllExcept($evil); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($evil), count($storage)); ?> --EXPECT-- -Modification of SplObjectStorage during getHash() is prohibited +Error: Modification of SplObjectStorage during getHash() is prohibited int(0) int(1) diff --git a/ext/spl/tests/SplObjectStorage/gh21831.phpt b/ext/spl/tests/SplObjectStorage/gh21831.phpt index 581012d86a4f..2eb514445590 100644 --- a/ext/spl/tests/SplObjectStorage/gh21831.phpt +++ b/ext/spl/tests/SplObjectStorage/gh21831.phpt @@ -25,12 +25,12 @@ $filter->other = $storage; try { $storage->removeAllExcept($filter); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(count($storage)); ?> --EXPECT-- -Modification of SplObjectStorage during getHash() is prohibited +Error: Modification of SplObjectStorage during getHash() is prohibited int(1) diff --git a/ext/spl/tests/SplPriorityQueue_unserialize_invalid_flags.phpt b/ext/spl/tests/SplPriorityQueue_unserialize_invalid_flags.phpt index 8c785606c7fe..916c32edae06 100644 --- a/ext/spl/tests/SplPriorityQueue_unserialize_invalid_flags.phpt +++ b/ext/spl/tests/SplPriorityQueue_unserialize_invalid_flags.phpt @@ -16,7 +16,7 @@ try { $queue->__unserialize($data); echo "Should have thrown exception for invalid flags\n"; } catch (Exception $e) { - echo "Exception thrown for invalid flags: " . $e->getMessage() . "\n"; + echo 'invalid flags: ', $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -32,7 +32,7 @@ try { $queue->__unserialize($data); echo "Should have thrown exception for zero flags\n"; } catch (Exception $e) { - echo "Exception thrown for zero flags: " . $e->getMessage() . "\n"; + echo 'zero flags: ', $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -48,7 +48,7 @@ try { $queue->__unserialize($data); echo "Valid flags accepted\n"; } catch (Exception $e) { - echo "Valid flags rejected: " . $e->getMessage() . "\n"; + echo 'Valid flags rejected: ', $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -69,12 +69,12 @@ try { echo "Flags not properly masked, got: " . $queue->getExtractFlags() . "\n"; } } catch (Exception $e) { - echo "Flags with extra bits should be masked: " . $e->getMessage() . "\n"; + echo 'Flags with extra bits should be masked: ', $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception thrown for invalid flags: Invalid serialization data for SplPriorityQueue object -Exception thrown for zero flags: Invalid serialization data for SplPriorityQueue object +invalid flags: Exception: Invalid serialization data for SplPriorityQueue object +zero flags: Exception: Invalid serialization data for SplPriorityQueue object Valid flags accepted Flags properly masked diff --git a/ext/spl/tests/SplQueue_setIteratorMode.phpt b/ext/spl/tests/SplQueue_setIteratorMode.phpt index 5ad1d9258a7d..0e291b355437 100644 --- a/ext/spl/tests/SplQueue_setIteratorMode.phpt +++ b/ext/spl/tests/SplQueue_setIteratorMode.phpt @@ -8,8 +8,8 @@ $queue = new SplQueue(); try { $queue->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen +RuntimeException: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen diff --git a/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt b/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt index 255f0cd2e4d2..3d58d09a75fa 100644 --- a/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt +++ b/ext/spl/tests/SplQueue_setIteratorMode_param_lifo.phpt @@ -11,9 +11,9 @@ try { $dll->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen +RuntimeException: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen diff --git a/ext/spl/tests/SplStack_setIteratorMode.phpt b/ext/spl/tests/SplStack_setIteratorMode.phpt index 342a6b8bb24a..e059a35cfca9 100644 --- a/ext/spl/tests/SplStack_setIteratorMode.phpt +++ b/ext/spl/tests/SplStack_setIteratorMode.phpt @@ -8,8 +8,8 @@ $stack = new SplStack(); try { $stack->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen +RuntimeException: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen diff --git a/ext/spl/tests/SplTempFileObject_constructor_error.phpt b/ext/spl/tests/SplTempFileObject_constructor_error.phpt index 212a4df2ff8a..de520b1922fa 100644 --- a/ext/spl/tests/SplTempFileObject_constructor_error.phpt +++ b/ext/spl/tests/SplTempFileObject_constructor_error.phpt @@ -5,8 +5,8 @@ SPL SplTempFileObject constructor sets correct defaults when pass 0 arguments try { new SplTempFileObject('invalid'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplTempFileObject::__construct(): Argument #1 ($maxMemory) must be of type int, string given +TypeError: SplTempFileObject::__construct(): Argument #1 ($maxMemory) must be of type int, string given diff --git a/ext/spl/tests/autoloading/bug73896.phpt b/ext/spl/tests/autoloading/bug73896.phpt index 657f30c50dbe..c31d3285803d 100644 --- a/ext/spl/tests/autoloading/bug73896.phpt +++ b/ext/spl/tests/autoloading/bug73896.phpt @@ -31,8 +31,8 @@ $teLoader = new teLoader(); try { new teChild(); } catch (Throwable $e) { - echo "Exception: ", $e->getMessage() , "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception: Class "teException" not found +Error: Class "teException" not found diff --git a/ext/spl/tests/autoloading/spl_autoload_001.phpt b/ext/spl/tests/autoloading/spl_autoload_001.phpt index befb96570950..761699bd8e74 100644 --- a/ext/spl/tests/autoloading/spl_autoload_001.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_001.phpt @@ -67,7 +67,7 @@ echo "===NOFUNCTION===\n"; try { spl_autoload_register("unavailable_autoload_function"); } catch(\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -100,4 +100,4 @@ TestFunc2(TestClass) %stestclass.class.inc bool(true) ===NOFUNCTION=== -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, function "unavailable_autoload_function" not found or invalid function name +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, function "unavailable_autoload_function" not found or invalid function name diff --git a/ext/spl/tests/autoloading/spl_autoload_003.phpt b/ext/spl/tests/autoloading/spl_autoload_003.phpt index 016bcf2394b6..7485ea88ece1 100644 --- a/ext/spl/tests/autoloading/spl_autoload_003.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_003.phpt @@ -31,7 +31,7 @@ try } catch(Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/spl/tests/autoloading/spl_autoload_005.phpt b/ext/spl/tests/autoloading/spl_autoload_005.phpt index 0f2c5ed2c302..a3f2bc3c4b96 100644 --- a/ext/spl/tests/autoloading/spl_autoload_005.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_005.phpt @@ -22,7 +22,7 @@ class MyAutoLoader { try { spl_autoload_register(array('MyAutoLoader', 'autoLoad'), true); } catch(\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // and @@ -38,12 +38,12 @@ try } catch(Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::autoLoad() cannot be called statically +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::autoLoad() cannot be called statically MyAutoLoader::autoLoad(TestClass) MyAutoLoader::autoThrow(TestClass) Exception: Unavailable diff --git a/ext/spl/tests/autoloading/spl_autoload_007.phpt b/ext/spl/tests/autoloading/spl_autoload_007.phpt index 0a8183dfb403..c47b10c270c7 100644 --- a/ext/spl/tests/autoloading/spl_autoload_007.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_007.phpt @@ -45,23 +45,23 @@ foreach($funcs as $idx => $func) spl_autoload_register($func); echo "ok\n"; } catch(\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECTF-- string(22) "MyAutoLoader::notExist" -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" string(22) "MyAutoLoader::noAccess" -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() string(22) "MyAutoLoader::autoLoad" ok string(22) "MyAutoLoader::dynaLoad" -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::dynaLoad() cannot be called statically +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::dynaLoad() cannot be called statically array(2) { [0]=> @@ -69,7 +69,7 @@ array(2) { [1]=> string(8) "notExist" } -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" array(2) { [0]=> @@ -77,7 +77,7 @@ array(2) { [1]=> string(8) "noAccess" } -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() array(2) { [0]=> @@ -93,7 +93,7 @@ array(2) { [1]=> string(8) "dynaLoad" } -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::dynaLoad() cannot be called statically +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, non-static method MyAutoLoader::dynaLoad() cannot be called statically array(2) { [0]=> @@ -102,7 +102,7 @@ array(2) { [1]=> string(8) "notExist" } -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, class MyAutoLoader does not have a method "notExist" array(2) { [0]=> @@ -111,7 +111,7 @@ array(2) { [1]=> string(8) "noAccess" } -spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() +TypeError: spl_autoload_register(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method MyAutoLoader::noAccess() array(2) { [0]=> diff --git a/ext/spl/tests/autoloading/spl_autoload_008.phpt b/ext/spl/tests/autoloading/spl_autoload_008.phpt index 738c691ddfe9..9a45409beb5b 100644 --- a/ext/spl/tests/autoloading/spl_autoload_008.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_008.phpt @@ -46,7 +46,7 @@ foreach($funcs as $idx => $func) try { spl_autoload_register($func); } catch (TypeError $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump(count(spl_autoload_functions())); continue; } @@ -57,7 +57,7 @@ foreach($funcs as $idx => $func) try { var_dump(class_exists("NoExistingTestClass", true)); } catch (Exception $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } diff --git a/ext/spl/tests/autoloading/spl_autoload_012.phpt b/ext/spl/tests/autoloading/spl_autoload_012.phpt index 218d3e800ff2..a9da7cf8bbf9 100644 --- a/ext/spl/tests/autoloading/spl_autoload_012.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_012.phpt @@ -22,7 +22,7 @@ try { class_exists('ThisClassDoesNotExist'); } catch(Exception $e) { do { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } while($e = $e->getPrevious()); } @@ -30,7 +30,7 @@ try { new ThisClassDoesNotExist; } catch(Exception $e) { do { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } while($e = $e->getPrevious()); } @@ -39,9 +39,9 @@ class_exists('ThisClassDoesNotExist'); ===DONE=== --EXPECTF-- autoload_first -first +Exception: first autoload_first -first +Exception: first autoload_first Fatal error: Uncaught Exception: first in %sspl_autoload_012.php:%d diff --git a/ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt b/ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt index 943d80ae2537..48dd7120cfb0 100644 --- a/ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt +++ b/ext/spl/tests/autoloading/spl_autoload_throw_with_spl_autoloader_call_as_autoloader.phpt @@ -6,9 +6,9 @@ spl_autoload_register() function - warn when using spl_autoload_call() as the au try { spl_autoload_register('spl_autoload_call'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -spl_autoload_register(): Argument #1 ($callback) must not be the spl_autoload_call() function +ValueError: spl_autoload_register(): Argument #1 ($callback) must not be the spl_autoload_call() function diff --git a/ext/spl/tests/bug31185.phpt b/ext/spl/tests/bug31185.phpt index 70ae1c00983d..a327b4d4de1f 100644 --- a/ext/spl/tests/bug31185.phpt +++ b/ext/spl/tests/bug31185.phpt @@ -37,7 +37,7 @@ try } catch (Exception $e) { - echo "CAUGHT: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } print_R($foo); @@ -46,7 +46,7 @@ print_R($foo); FooBar::offsetSet(0, 0) FooBar::offsetSet(1, 1) FooBar::offsetSet(2, 2) -CAUGHT: FAIL +Exception: FAIL FooBar Object ( [array:FooBar:private] => Array diff --git a/ext/spl/tests/bug37457.phpt b/ext/spl/tests/bug37457.phpt index e8c7d7b9afca..c5ecd4567b61 100644 --- a/ext/spl/tests/bug37457.phpt +++ b/ext/spl/tests/bug37457.phpt @@ -64,7 +64,7 @@ try } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -75,4 +75,4 @@ Collection::valid Collection::current Collection::key TestFilter::accept -string(17) "Failure in Accept" +Exception: Failure in Accept diff --git a/ext/spl/tests/bug42703.phpt b/ext/spl/tests/bug42703.phpt index d869fef0d58b..5323b187c7d1 100644 --- a/ext/spl/tests/bug42703.phpt +++ b/ext/spl/tests/bug42703.phpt @@ -29,13 +29,13 @@ try { } } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($itit->current()); var_dump($itit->key()); ?> --EXPECT-- -string(3) "boo" +Exception: boo NULL NULL diff --git a/ext/spl/tests/bug51119.phpt b/ext/spl/tests/bug51119.phpt index 2f3348a2c493..c484a6fa5fa5 100644 --- a/ext/spl/tests/bug51119.phpt +++ b/ext/spl/tests/bug51119.phpt @@ -14,7 +14,7 @@ foreach ($limitIterator as $item) { try { $limitIterator = new LimitIterator($arrayIterator, -1); } catch (\ValueError $e){ - print $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -22,4 +22,4 @@ try { a b c -LimitIterator::__construct(): Argument #2 ($offset) must be greater than or equal to 0 +ValueError: LimitIterator::__construct(): Argument #2 ($offset) must be greater than or equal to 0 diff --git a/ext/spl/tests/bug61828.phpt b/ext/spl/tests/bug61828.phpt index 2a11b760bb35..a01f85c7b0da 100644 --- a/ext/spl/tests/bug61828.phpt +++ b/ext/spl/tests/bug61828.phpt @@ -7,9 +7,9 @@ $x = new DirectoryIterator('.'); try { $x->__construct('/tmp'); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Directory object is already initialized +Error: Directory object is already initialized diff --git a/ext/spl/tests/bug67539.phpt b/ext/spl/tests/bug67539.phpt index 61f70cf459bd..7149bd55a42f 100644 --- a/ext/spl/tests/bug67539.phpt +++ b/ext/spl/tests/bug67539.phpt @@ -9,7 +9,7 @@ function badsort($a, $b) { try { $GLOBALS['it']->unserialize($GLOBALS['it']->serialize()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } return 0; } @@ -17,4 +17,4 @@ function badsort($a, $b) { $it->uksort('badsort'); ?> --EXPECT-- -Modification of ArrayObject during sorting is prohibited +Error: Modification of ArrayObject during sorting is prohibited diff --git a/ext/spl/tests/bug70068.phpt b/ext/spl/tests/bug70068.phpt index 54f3cca44963..adc38aff1423 100644 --- a/ext/spl/tests/bug70068.phpt +++ b/ext/spl/tests/bug70068.phpt @@ -5,10 +5,10 @@ Bug #70068 (Dangling pointer in the unserialization of ArrayObject items) try { $a = unserialize('a:3:{i:0;C:11:"ArrayObject":20:{x:i:0;r:3;;m:a:0:{};}i:1;d:11;i:2;S:31:"AAAAAAAABBBBCCCC\01\00\00\00\04\00\00\00\00\00\00\00\00\00\00";}'); } catch(Exception $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> OK --EXPECT-- -Error at offset 10 of 20 bytes +UnexpectedValueException: Error at offset 10 of 20 bytes OK diff --git a/ext/spl/tests/bug70561.phpt b/ext/spl/tests/bug70561.phpt index c6c229ad89d0..47b1d3213747 100644 --- a/ext/spl/tests/bug70561.phpt +++ b/ext/spl/tests/bug70561.phpt @@ -14,10 +14,10 @@ while ($di->valid()) { try { $di->seek($cnt+1); } catch (OutOfBoundsException $ex) { - echo $ex->getMessage() . PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } echo "Is valid? " . (int) $di->valid() . PHP_EOL; ?> --EXPECTF-- -Seek position %d is out of range +OutOfBoundsException: Seek position %d is out of range Is valid? 0 diff --git a/ext/spl/tests/bug71735.phpt b/ext/spl/tests/bug71735.phpt index 7063aaab5aad..7dd000421e08 100644 --- a/ext/spl/tests/bug71735.phpt +++ b/ext/spl/tests/bug71735.phpt @@ -6,8 +6,8 @@ try { $var_1=new SplStack(); $var_1->offsetSet(100,new DateTime('2000-01-01')); } catch(OutOfRangeException $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -SplDoublyLinkedList::offsetSet(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::offsetSet(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/bug72684.phpt b/ext/spl/tests/bug72684.phpt index 06665efdaab7..5962754f5606 100644 --- a/ext/spl/tests/bug72684.phpt +++ b/ext/spl/tests/bug72684.phpt @@ -13,9 +13,9 @@ iterator_to_array($appendIterator); try { iterator_to_array($appendIterator); } catch (\Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot traverse an already closed generator +Exception: Cannot traverse an already closed generator diff --git a/ext/spl/tests/bug72888.phpt b/ext/spl/tests/bug72888.phpt index 5ca99a40a513..93bdaa7c3c66 100644 --- a/ext/spl/tests/bug72888.phpt +++ b/ext/spl/tests/bug72888.phpt @@ -7,12 +7,12 @@ $x = new SplFileObject(__FILE__); try { $y=clone $x; } catch (Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($y); ?> --EXPECTF-- -string(60) "Trying to clone an uncloneable object of class SplFileObject" +Error: Trying to clone an uncloneable object of class SplFileObject Warning: Undefined variable $y in %s on line %d NULL diff --git a/ext/spl/tests/bug73029.phpt b/ext/spl/tests/bug73029.phpt index 771e81d5c4d4..cc174bd2cdf6 100644 --- a/ext/spl/tests/bug73029.phpt +++ b/ext/spl/tests/bug73029.phpt @@ -7,19 +7,19 @@ $a = 'C:11:"ArrayObject":19:{x:i:0;r:2;;m:a:0:{}}'; $m = unserialize($a); $x = $m[2]; } catch(UnexpectedValueException $e) { - print $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $a = 'C:11:"ArrayObject":19:0x:i:0;r:2;;m:a:0:{}}'; $m = unserialize($a); $x = $m[2]; } catch(UnexpectedValueException $e) { - print $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> DONE --EXPECTF-- -Error at offset 10 of 19 bytes +UnexpectedValueException: Error at offset 10 of 19 bytes Warning: unserialize(): Error at offset 22 of 43 bytes in %s on line %d diff --git a/ext/spl/tests/bug73629.phpt b/ext/spl/tests/bug73629.phpt index f66c319ca184..dd6d78917681 100644 --- a/ext/spl/tests/bug73629.phpt +++ b/ext/spl/tests/bug73629.phpt @@ -6,13 +6,13 @@ $q = new SplQueue(); try { $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_FIFO); } catch (Exception $e) { - echo 'unexpected exception: ' . $e->getMessage() . "\n"; + echo 'unexpected: ', $e::class, ': ', $e->getMessage(), "\n"; } try { $q->setIteratorMode(SplDoublyLinkedList::IT_MODE_LIFO); } catch (Exception $e) { - echo 'expected exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -expected exception: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen +RuntimeException: Iterators' LIFO/FIFO modes for SplStack/SplQueue objects are frozen diff --git a/ext/spl/tests/bug79432.phpt b/ext/spl/tests/bug79432.phpt index 1230340e991b..c3c9a9cb35f4 100644 --- a/ext/spl/tests/bug79432.phpt +++ b/ext/spl/tests/bug79432.phpt @@ -6,9 +6,9 @@ Bug #79432 (spl_autoload_call() with non-string argument violates assertion) try { spl_autoload_call([]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -spl_autoload_call(): Argument #1 ($class) must be of type string, array given +TypeError: spl_autoload_call(): Argument #1 ($class) must be of type string, array given diff --git a/ext/spl/tests/bug79987.phpt b/ext/spl/tests/bug79987.phpt index b6ea8e2a9c41..d729f1d10cfb 100644 --- a/ext/spl/tests/bug79987.phpt +++ b/ext/spl/tests/bug79987.phpt @@ -13,26 +13,26 @@ set_error_handler(function ($type, $msg, $file, $line, $context = []) { try { var_dump($x->getLinkTarget()); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($x->getFilename()); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($x->getExtension()); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($x->getBasename()); } catch (Throwable $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object not initialized -Object not initialized -Object not initialized -Object not initialized +Error: Object not initialized +Error: Object not initialized +Error: Object not initialized +Error: Object not initialized diff --git a/ext/spl/tests/bug80719.phpt b/ext/spl/tests/bug80719.phpt index 506b250dae29..e0d7282fae38 100644 --- a/ext/spl/tests/bug80719.phpt +++ b/ext/spl/tests/bug80719.phpt @@ -7,7 +7,7 @@ $array = new ArrayObject([42]); try { $array->setIteratorClass(FilterIterator::class); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foreach ($array as $v) { var_dump($v); @@ -15,5 +15,5 @@ foreach ($array as $v) { ?> --EXPECT-- -ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, FilterIterator given +TypeError: ArrayObject::setIteratorClass(): Argument #1 ($iteratorClass) must be a class name derived from ArrayIterator, FilterIterator given int(42) diff --git a/ext/spl/tests/bug81992.phpt b/ext/spl/tests/bug81992.phpt index 52235218a78f..73cda8840ad1 100644 --- a/ext/spl/tests/bug81992.phpt +++ b/ext/spl/tests/bug81992.phpt @@ -9,12 +9,12 @@ class InvalidDestructor { try { var_dump($obj[2]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($obj[4]); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -28,5 +28,5 @@ $obj->setSize(2); ?> --EXPECT-- string(10) "AAAAAAAAAA" -Index invalid or out of range -Index invalid or out of range +OutOfBoundsException: Index invalid or out of range +OutOfBoundsException: Index invalid or out of range diff --git a/ext/spl/tests/class_implements_variation1.phpt b/ext/spl/tests/class_implements_variation1.phpt index 1f7892f12834..058079ce53dd 100644 --- a/ext/spl/tests/class_implements_variation1.phpt +++ b/ext/spl/tests/class_implements_variation1.phpt @@ -102,7 +102,7 @@ foreach($inputs as $key =>$value) { try { var_dump( class_implements($value, $autoload) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } }; @@ -113,61 +113,61 @@ fclose($res); *** Testing class_implements() : variation *** --int 0-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given --int 1-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given --int 12345-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given --int -12345-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, int given --float 10.5-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given --float -10.5-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given --float 12.3456789000e10-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given --float -12.3456789000e10-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given --float .5-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, float given --empty array-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given --int indexed array-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given --associative array-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given --nested arrays-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, array given --uppercase NULL-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given --lowercase null-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given --lowercase true-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, true given --lowercase false-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, false given --uppercase TRUE-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, true given --uppercase FALSE-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, false given --empty string DQ-- Error: 2 - class_implements(): Class does not exist and could not be loaded, %s(%d) @@ -188,10 +188,10 @@ array(0) { } --undefined var-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given --unset var-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, null given --resource-- -class_implements(): Argument #1 ($object_or_class) must be of type object|string, resource given +TypeError: class_implements(): Argument #1 ($object_or_class) must be of type object|string, resource given diff --git a/ext/spl/tests/class_uses_variation1.phpt b/ext/spl/tests/class_uses_variation1.phpt index 016a9cc0d2f4..53e628e6fd65 100644 --- a/ext/spl/tests/class_uses_variation1.phpt +++ b/ext/spl/tests/class_uses_variation1.phpt @@ -102,7 +102,7 @@ foreach($inputs as $key =>$value) { try { var_dump( class_uses($value, $autoload) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } }; @@ -113,61 +113,61 @@ fclose($res); *** Testing class_uses() : variation *** --int 0-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given --int 1-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given --int 12345-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given --int -12345-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, int given --float 10.5-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given --float -10.5-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given --float 12.3456789000e10-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given --float -12.3456789000e10-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given --float .5-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, float given --empty array-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given --int indexed array-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given --associative array-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given --nested arrays-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, array given --uppercase NULL-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given --lowercase null-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given --lowercase true-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, true given --lowercase false-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, false given --uppercase TRUE-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, true given --uppercase FALSE-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, false given --empty string DQ-- Error: 2 - class_uses(): Class does not exist and could not be loaded, %s(%d) @@ -186,10 +186,10 @@ array(0) { } --undefined var-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given --unset var-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, null given --resource-- -class_uses(): Argument #1 ($object_or_class) must be of type object|string, resource given +TypeError: class_uses(): Argument #1 ($object_or_class) must be of type object|string, resource given diff --git a/ext/spl/tests/countable_count_variation1.phpt b/ext/spl/tests/countable_count_variation1.phpt index b4b382bea35c..19474d3b50aa 100644 --- a/ext/spl/tests/countable_count_variation1.phpt +++ b/ext/spl/tests/countable_count_variation1.phpt @@ -54,7 +54,7 @@ echo "Count throws an exception:\n"; try { echo count(new throwException); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -70,4 +70,4 @@ int(1) Count returns an array: int(1) Count throws an exception: -Thrown from count +Exception: Thrown from count diff --git a/ext/spl/tests/dit_006.phpt b/ext/spl/tests/dit_006.phpt index 42a2309c9925..a83dc7e75698 100644 --- a/ext/spl/tests/dit_006.phpt +++ b/ext/spl/tests/dit_006.phpt @@ -35,7 +35,7 @@ try { $di->seek($o+1); $p = 1; } catch (\OutOfBoundsException $ex) { - echo $ex->getMessage() . PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } var_dump($n !== $m, $m === $o, $p === 0); @@ -44,7 +44,7 @@ var_dump($n !== $m, $m === $o, $p === 0); With seek(2) we get %d With seek(0) we get %d Without seek we get %d -Seek position %d is out of range +OutOfBoundsException: Seek position %d is out of range bool(true) bool(true) bool(true) diff --git a/ext/spl/tests/dllist_001.phpt b/ext/spl/tests/dllist_001.phpt index e6ac2468afde..7f02ce6b733d 100644 --- a/ext/spl/tests/dllist_001.phpt +++ b/ext/spl/tests/dllist_001.phpt @@ -7,12 +7,12 @@ $dll = new SplDoublyLinkedList(); try { $dll->pop(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $dll->shift(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // data consistency @@ -47,8 +47,8 @@ $dll_clone->pop(); echo count($dll)."\n"; ?> --EXPECT-- -Exception: Can't pop from an empty datastructure -Exception: Can't shift from an empty datastructure +RuntimeException: Can't pop from an empty datastructure +RuntimeException: Can't shift from an empty datastructure 2 2 2 diff --git a/ext/spl/tests/dllist_004.phpt b/ext/spl/tests/dllist_004.phpt index 8ac028ebf86f..33ed21d4a650 100644 --- a/ext/spl/tests/dllist_004.phpt +++ b/ext/spl/tests/dllist_004.phpt @@ -7,12 +7,12 @@ $stack = new SplStack(); try { $stack->pop(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $stack->shift(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // data consistency @@ -45,8 +45,8 @@ $stack_clone->pop(); echo count($stack)."\n"; ?> --EXPECT-- -Exception: Can't pop from an empty datastructure -Exception: Can't shift from an empty datastructure +RuntimeException: Can't pop from an empty datastructure +RuntimeException: Can't shift from an empty datastructure 2 2 [2] diff --git a/ext/spl/tests/dllist_005.phpt b/ext/spl/tests/dllist_005.phpt index 805f81a68a75..c5c8548ca7ed 100644 --- a/ext/spl/tests/dllist_005.phpt +++ b/ext/spl/tests/dllist_005.phpt @@ -7,12 +7,12 @@ $queue = new SplQueue(); try { $queue->dequeue(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $queue->shift(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // data consistency @@ -45,8 +45,8 @@ $queue_clone->dequeue(); echo count($queue)."\n"; ?> --EXPECT-- -Exception: Can't shift from an empty datastructure -Exception: Can't shift from an empty datastructure +RuntimeException: Can't shift from an empty datastructure +RuntimeException: Can't shift from an empty datastructure 2 2 [1] diff --git a/ext/spl/tests/dllist_006.phpt b/ext/spl/tests/dllist_006.phpt index 25b8bf330885..1d0bec1ef490 100644 --- a/ext/spl/tests/dllist_006.phpt +++ b/ext/spl/tests/dllist_006.phpt @@ -24,25 +24,25 @@ var_dump($a[2]); try { var_dump($a["1"]); } catch (OutOfRangeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($a["a"]); } catch (TypeError $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($a["0"]); } catch (OutOfRangeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($a["9"]); } catch (OutOfRangeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -54,6 +54,6 @@ Unsetting.. int(3) int(4) int(2) -Exception: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) must be of type int, string given +TypeError: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) must be of type int, string given int(1) -Exception: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::offsetGet(): Argument #1 ($index) is out of range diff --git a/ext/spl/tests/dllist_013.phpt b/ext/spl/tests/dllist_013.phpt index 2ec8396c0f52..8fc40eb877f0 100644 --- a/ext/spl/tests/dllist_013.phpt +++ b/ext/spl/tests/dllist_013.phpt @@ -7,7 +7,7 @@ $dll = new SplDoublyLinkedList(); try { $dll->add(2,5); } catch (OutOfRangeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $dll->add(0,6); // 6 @@ -40,7 +40,7 @@ var_dump($dll->shift()); ?> --EXPECT-- -Exception: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range +OutOfRangeException: SplDoublyLinkedList::add(): Argument #1 ($index) is out of range 7 7 6 diff --git a/ext/spl/tests/fixedarray_003.phpt b/ext/spl/tests/fixedarray_003.phpt index cca9ac07e9f7..b5b3812cb713 100644 --- a/ext/spl/tests/fixedarray_003.phpt +++ b/ext/spl/tests/fixedarray_003.phpt @@ -14,17 +14,17 @@ $o[2.5] = 'c'; try { $o[[]] = 'd'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $o[new stdClass()] = 'e'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $o[$r] = 'f'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $o['3'] = 'g'; @@ -32,17 +32,17 @@ $o['3'] = 'g'; try { $o['3.5'] = 'h'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $o['03'] = 'i'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $o[' 3'] = 'j'; } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -54,17 +54,17 @@ var_dump($o[2.5]); try { var_dump($o[[]]); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($o[new stdClass()]); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($o[$r]); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o['3']); @@ -72,17 +72,17 @@ var_dump($o['3']); try { var_dump($o['3.5']); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($o['03']); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($o[' 3']); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -94,17 +94,17 @@ var_dump(isset($o[2.5])); try { var_dump(isset($o[[]])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($o[new stdClass()])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($o[$r])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($o['3'])); @@ -112,17 +112,17 @@ var_dump(isset($o['3'])); try { var_dump(isset($o['3.5'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($o['03'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(isset($o[' 3'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo 'empty()', \PHP_EOL; @@ -133,17 +133,17 @@ var_dump(empty($o[2.5])); try { var_dump(empty($o[[]])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(empty($o[new stdClass()])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(empty($o[$r])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(empty($o['3'])); @@ -151,72 +151,72 @@ var_dump(empty($o['3'])); try { var_dump(empty($o['3.5'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(empty($o['03'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(empty($o[' 3'])); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Write context Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d -Cannot access offset of type array on SplFixedArray -Cannot access offset of type stdClass on SplFixedArray +TypeError: Cannot access offset of type array on SplFixedArray +TypeError: Cannot access offset of type stdClass on SplFixedArray Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray Read context string(1) "a" string(1) "b" Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d string(1) "c" -Cannot access offset of type array on SplFixedArray -Cannot access offset of type stdClass on SplFixedArray +TypeError: Cannot access offset of type array on SplFixedArray +TypeError: Cannot access offset of type stdClass on SplFixedArray Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d string(1) "f" string(1) "g" -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray isset() bool(true) bool(true) Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d bool(true) -Cannot access offset of type array on SplFixedArray -Cannot access offset of type stdClass on SplFixedArray +TypeError: Cannot access offset of type array on SplFixedArray +TypeError: Cannot access offset of type stdClass on SplFixedArray Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d bool(true) bool(true) -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray empty() bool(false) bool(false) Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d bool(false) -Cannot access offset of type array on SplFixedArray -Cannot access offset of type stdClass on SplFixedArray +TypeError: Cannot access offset of type array on SplFixedArray +TypeError: Cannot access offset of type stdClass on SplFixedArray Warning: Resource ID#%d used as offset, casting to integer (%d) in %s on line %d bool(false) bool(false) -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray -Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray +TypeError: Cannot access offset of type string on SplFixedArray diff --git a/ext/spl/tests/fixedarray_004.phpt b/ext/spl/tests/fixedarray_004.phpt index c1bf3054030a..64773f7fdf5d 100644 --- a/ext/spl/tests/fixedarray_004.phpt +++ b/ext/spl/tests/fixedarray_004.phpt @@ -8,9 +8,9 @@ $a = new SplFixedArray(10); try { $a[] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -[] operator not supported for SplFixedArray +Error: [] operator not supported for SplFixedArray diff --git a/ext/spl/tests/fixedarray_006.phpt b/ext/spl/tests/fixedarray_006.phpt index 75ecbb7c7f22..6bf1ae0bc23e 100644 --- a/ext/spl/tests/fixedarray_006.phpt +++ b/ext/spl/tests/fixedarray_006.phpt @@ -11,12 +11,12 @@ try { $a[] = new stdClass; } } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } print "ok\n"; ?> --EXPECT-- -[] operator not supported for SplFixedArray +Error: [] operator not supported for SplFixedArray ok diff --git a/ext/spl/tests/fixedarray_007.phpt b/ext/spl/tests/fixedarray_007.phpt index 65b4dad90e2b..1bb80f260544 100644 --- a/ext/spl/tests/fixedarray_007.phpt +++ b/ext/spl/tests/fixedarray_007.phpt @@ -9,7 +9,7 @@ $a = new SplFixedArray($b); try { $a[1] = $a; } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foreach ($a as $c) { diff --git a/ext/spl/tests/fixedarray_012.phpt b/ext/spl/tests/fixedarray_012.phpt index 0c54dc10552c..961e0022b04e 100644 --- a/ext/spl/tests/fixedarray_012.phpt +++ b/ext/spl/tests/fixedarray_012.phpt @@ -8,12 +8,12 @@ $a = new SplFixedArray(100); try { $b = &$a[]; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } print "ok\n"; ?> --EXPECT-- -[] operator not supported for SplFixedArray +Error: [] operator not supported for SplFixedArray ok diff --git a/ext/spl/tests/fixedarray_013.phpt b/ext/spl/tests/fixedarray_013.phpt index fa0d33a41655..9c6488602f7e 100644 --- a/ext/spl/tests/fixedarray_013.phpt +++ b/ext/spl/tests/fixedarray_013.phpt @@ -13,9 +13,9 @@ function test(SplFixedArray &$arr) { try { test($a[]); } catch (\Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -[] operator not supported for SplFixedArray +Error: [] operator not supported for SplFixedArray diff --git a/ext/spl/tests/fixedarray_014.phpt b/ext/spl/tests/fixedarray_014.phpt index 75108b586847..94bbfb884c33 100644 --- a/ext/spl/tests/fixedarray_014.phpt +++ b/ext/spl/tests/fixedarray_014.phpt @@ -7,9 +7,9 @@ try { $a = new SplFixedArray(0); echo $a[0]++; } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Index invalid or out of range +OutOfBoundsException: Index invalid or out of range diff --git a/ext/spl/tests/fixedarray_020.phpt b/ext/spl/tests/fixedarray_020.phpt index c0ff6e3b436c..6152e199fba7 100644 --- a/ext/spl/tests/fixedarray_020.phpt +++ b/ext/spl/tests/fixedarray_020.phpt @@ -14,14 +14,14 @@ try { SplFixedArray::fromArray(array("foo"=>"bar"), false); echo "No exception\n"; } catch (Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo "From Array with string keys, preserve\n"; SplFixedArray::fromArray(array("foo"=>"bar"), true); echo "No exception\n"; } catch (Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -33,4 +33,4 @@ bool(true) From Array with string keys, no preserve No exception From Array with string keys, preserve -Exception: array must contain only positive integer keys +InvalidArgumentException: array must contain only positive integer keys diff --git a/ext/spl/tests/fixedarray_021.phpt b/ext/spl/tests/fixedarray_021.phpt index 376985fd5d28..0f2bd694c67e 100644 --- a/ext/spl/tests/fixedarray_021.phpt +++ b/ext/spl/tests/fixedarray_021.phpt @@ -13,7 +13,7 @@ var_dump($a->count()); try { $b = new SplFixedArray(-10); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* resize and negative value */ @@ -21,7 +21,7 @@ $b = new SplFixedArray(); try { $b->setSize(-5); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* calling __construct() twice */ @@ -47,7 +47,7 @@ try { var_dump($v); } } catch (\Error $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } //non-long indexes @@ -63,14 +63,14 @@ var_dump(empty($a["3"])); --EXPECTF-- int(0) int(0) -SplFixedArray::__construct(): Argument #1 ($size) must be greater than or equal to 0 -SplFixedArray::setSize(): Argument #1 ($size) must be greater than or equal to 0 +ValueError: SplFixedArray::__construct(): Argument #1 ($size) must be greater than or equal to 0 +ValueError: SplFixedArray::setSize(): Argument #1 ($size) must be greater than or equal to 0 NULL int(0) int(0) object(SplFixedArray)#%d (0) { } -string(52) "An iterator cannot be used with foreach by reference" +Error: An iterator cannot be used with foreach by reference bool(false) string(3) "foo" bool(true) diff --git a/ext/spl/tests/fixedarray_023.phpt b/ext/spl/tests/fixedarray_023.phpt index 781685b7891d..9f2506eb2d87 100644 --- a/ext/spl/tests/fixedarray_023.phpt +++ b/ext/spl/tests/fixedarray_023.phpt @@ -33,4 +33,4 @@ object(SplFixedArray)#2 (4) refcount(6){ *RECURSION* [3]=> *RECURSION* -} \ No newline at end of file +} diff --git a/ext/spl/tests/gh13685.phpt b/ext/spl/tests/gh13685.phpt index 2bdddec4584e..3f79f9280f5a 100644 --- a/ext/spl/tests/gh13685.phpt +++ b/ext/spl/tests/gh13685.phpt @@ -19,7 +19,7 @@ while (($data = $file->fgetcsv(',', '"', ''))) { try { var_dump((string) $file); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "--- Use csv control ---\n"; @@ -35,7 +35,7 @@ foreach ($file as $row) { try { var_dump((string) $file); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/spl/tests/gh16217.phpt b/ext/spl/tests/gh16217.phpt index 71760389c8e4..c6a0846e64f9 100644 --- a/ext/spl/tests/gh16217.phpt +++ b/ext/spl/tests/gh16217.phpt @@ -9,13 +9,13 @@ function uninitialized(): SplFileObject { try { (new ReflectionMethod(SplFileObject::class, "fputcsv"))->invoke(uninitialized(), []); } catch (Error $e) { - echo "fputcsv: ", $e->getMessage(), "\n"; + echo 'fputcsv: ', $e::class, ': ', $e->getMessage(), "\n"; } try { (new ReflectionMethod(SplFileObject::class, "next"))->invoke(uninitialized()); } catch (Error $e) { - echo "next: ", $e->getMessage(), "\n"; + echo 'next: ', $e::class, ': ', $e->getMessage(), "\n"; } $obj = uninitialized(); @@ -23,13 +23,13 @@ $obj = uninitialized(); try { (new ReflectionMethod(SplFileObject::class, "next"))->invoke($obj); } catch (Error $e) { - echo "next (READ_AHEAD): ", $e->getMessage(), "\n"; + echo 'next (READ_AHEAD): ', $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -fputcsv: Object not initialized -next: Object not initialized -next (READ_AHEAD): Object not initialized +fputcsv: Error: Object not initialized +next: Error: Object not initialized +next (READ_AHEAD): Error: Object not initialized Done diff --git a/ext/spl/tests/gh16337.phpt b/ext/spl/tests/gh16337.phpt index 94cf9d90cb1a..6b6424b0f68f 100644 --- a/ext/spl/tests/gh16337.phpt +++ b/ext/spl/tests/gh16337.phpt @@ -9,12 +9,12 @@ class C { try { $heap->extract(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $heap->insert(1); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo $heap->top(), "\n"; return "0"; @@ -29,21 +29,21 @@ $heap->insert(new C); ?> --EXPECT-- -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 -Heap cannot be changed when it is already being modified. -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. 0 diff --git a/ext/spl/tests/gh16604_2.phpt b/ext/spl/tests/gh16604_2.phpt index 703b37ce87df..042646393710 100644 --- a/ext/spl/tests/gh16604_2.phpt +++ b/ext/spl/tests/gh16604_2.phpt @@ -9,7 +9,7 @@ $obj = new SplFileObject(__DIR__.'/gh16604_2.tmp'); try { $obj->__construct(__DIR__.'/gh16604_2.tmp'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -18,4 +18,4 @@ try { @unlink(__DIR__.'/gh16604_2.tmp'); ?> --EXPECT-- -Cannot call constructor twice +Error: Cannot call constructor twice diff --git a/ext/spl/tests/gh17463.phpt b/ext/spl/tests/gh17463.phpt index 41939c62f5b2..60524dd96b27 100644 --- a/ext/spl/tests/gh17463.phpt +++ b/ext/spl/tests/gh17463.phpt @@ -9,8 +9,8 @@ $cls = new SplTempFileObject(); try { $cls->ftruncate(-1); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -SplFileObject::ftruncate(): Argument #1 ($size) must be greater than or equal to 0 +ValueError: SplFileObject::ftruncate(): Argument #1 ($size) must be greater than or equal to 0 diff --git a/ext/spl/tests/gh17516.phpt b/ext/spl/tests/gh17516.phpt index f1a05f9ca184..669f2286abdd 100644 --- a/ext/spl/tests/gh17516.phpt +++ b/ext/spl/tests/gh17516.phpt @@ -11,7 +11,7 @@ var_dump($cls->getPathInfo('SplFileInfoChild')); try { $cls->getPathInfo('BadSplFileInfo'); } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -21,4 +21,4 @@ object(SplFileInfoChild)#2 (2) { ["fileName":"SplFileInfo":private]=> string(4) "php:" } -SplFileInfo::getPathInfo(): Argument #1 ($class) must be a class name derived from SplFileInfo or null, BadSplFileInfo given +TypeError: SplFileInfo::getPathInfo(): Argument #1 ($class) must be a class name derived from SplFileInfo or null, BadSplFileInfo given diff --git a/ext/spl/tests/gh18421.phpt b/ext/spl/tests/gh18421.phpt index 42584ef8aacc..7b2306f0a9f6 100644 --- a/ext/spl/tests/gh18421.phpt +++ b/ext/spl/tests/gh18421.phpt @@ -9,9 +9,9 @@ try { { } } catch (OutOfBoundsException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Seek position %d is out of range +OutOfBoundsException: Seek position %d is out of range diff --git a/ext/spl/tests/gh19094.phpt b/ext/spl/tests/gh19094.phpt index d0665c3e8f06..6e507c26aaa0 100644 --- a/ext/spl/tests/gh19094.phpt +++ b/ext/spl/tests/gh19094.phpt @@ -35,22 +35,22 @@ $canary = new stdClass; try { $cls[$canary] = 1; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $cls[new MyAggregate] = 1; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $cls[new MyIterator] = 1; try { $cls->key(); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Can only attach objects that implement the Iterator interface -Can only attach objects that implement the Iterator interface -Called key() with non valid sub iterator +TypeError: Can only attach objects that implement the Iterator interface +TypeError: Can only attach objects that implement the Iterator interface +RuntimeException: Called key() with non valid sub iterator diff --git a/ext/spl/tests/heap_001.phpt b/ext/spl/tests/heap_001.phpt index 33f091838b03..438a62fe596a 100644 --- a/ext/spl/tests/heap_001.phpt +++ b/ext/spl/tests/heap_001.phpt @@ -8,7 +8,7 @@ $h = new SplMaxHeap(); try { $h->extract(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -37,7 +37,7 @@ echo $h->extract()."\n"; echo $h2->extract()."\n"; ?> --EXPECT-- -Exception: Can't extract from an empty heap +RuntimeException: Can't extract from an empty heap 5 3 3 diff --git a/ext/spl/tests/heap_002.phpt b/ext/spl/tests/heap_002.phpt index 452fdf189a70..ce62a4bd0857 100644 --- a/ext/spl/tests/heap_002.phpt +++ b/ext/spl/tests/heap_002.phpt @@ -8,7 +8,7 @@ $h = new SplMinHeap(); try { $h->extract(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -35,7 +35,7 @@ $b = 5; echo $h->extract()."\n"; ?> --EXPECT-- -Exception: Can't extract from an empty heap +RuntimeException: Can't extract from an empty heap 5 1 2 diff --git a/ext/spl/tests/heap_004.phpt b/ext/spl/tests/heap_004.phpt index 3db18b673383..70f10c3ab317 100644 --- a/ext/spl/tests/heap_004.phpt +++ b/ext/spl/tests/heap_004.phpt @@ -18,25 +18,25 @@ try { $h->insert(3); echo "inserted 3\n"; } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $h->insert(4); echo "inserted 4\n"; } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Recovering..\n"; @@ -45,20 +45,20 @@ $h->recoverFromCorruption(); try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- inserted 1 Exception: foo -Exception: Heap is corrupted, heap properties are no longer ensured. -Exception: Heap is corrupted, heap properties are no longer ensured. -Exception: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. Recovering.. int(1) int(2) diff --git a/ext/spl/tests/heap_009.phpt b/ext/spl/tests/heap_009.phpt index 833d079b253b..1b3b3a7dd3eb 100644 --- a/ext/spl/tests/heap_009.phpt +++ b/ext/spl/tests/heap_009.phpt @@ -13,7 +13,7 @@ function testForException( $heap ) } catch( \Error $e ) { - echo $e->getMessage(),"\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -46,9 +46,9 @@ testForException( $heap ); ?> --EXPECT-- -An iterator cannot be used with foreach by reference -An iterator cannot be used with foreach by reference -An iterator cannot be used with foreach by reference -An iterator cannot be used with foreach by reference -An iterator cannot be used with foreach by reference -An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference +Error: An iterator cannot be used with foreach by reference diff --git a/ext/spl/tests/heap_corruption.phpt b/ext/spl/tests/heap_corruption.phpt index 149d0b671996..9e75cce35450 100644 --- a/ext/spl/tests/heap_corruption.phpt +++ b/ext/spl/tests/heap_corruption.phpt @@ -48,14 +48,14 @@ try { $heap->extract(); } catch (Exception $e) { - echo "Compare Exception: " . $e->getMessage() . PHP_EOL; + echo 'Compare: ', $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $heap->top(); } catch (Exception $e) { - echo "Corruption Exception: " . $e->getMessage() . PHP_EOL; + echo 'Corruption: ', $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($heap->isCorrupted()); @@ -64,7 +64,7 @@ var_dump($heap->isCorrupted()); ?> --EXPECT-- bool(false) -Compare Exception: Compare exception -Corruption Exception: Heap is corrupted, heap properties are no longer ensured. +Compare: Exception: Compare exception +Corruption: RuntimeException: Heap is corrupted, heap properties are no longer ensured. bool(true) bool(false) diff --git a/ext/spl/tests/heap_next_write_lock.phpt b/ext/spl/tests/heap_next_write_lock.phpt index fcad94f3ccd3..f8beafbddddf 100644 --- a/ext/spl/tests/heap_next_write_lock.phpt +++ b/ext/spl/tests/heap_next_write_lock.phpt @@ -26,7 +26,7 @@ try { $q->insert("d$i", 100 - $i); } } catch (RuntimeException $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/spl/tests/heap_top_variation_002.phpt b/ext/spl/tests/heap_top_variation_002.phpt index 0a9a8db613be..48f995e9c234 100644 --- a/ext/spl/tests/heap_top_variation_002.phpt +++ b/ext/spl/tests/heap_top_variation_002.phpt @@ -24,8 +24,8 @@ try { try { $h->top(); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. diff --git a/ext/spl/tests/heap_top_variation_003.phpt b/ext/spl/tests/heap_top_variation_003.phpt index 40d70c5966b9..466723c1220b 100644 --- a/ext/spl/tests/heap_top_variation_003.phpt +++ b/ext/spl/tests/heap_top_variation_003.phpt @@ -9,8 +9,8 @@ $h = new SplMinHeap(); try { $h->top(); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Can't peek at an empty heap +RuntimeException: Can't peek at an empty heap diff --git a/ext/spl/tests/heap_unserialize_under_corruption_or_modification.phpt b/ext/spl/tests/heap_unserialize_under_corruption_or_modification.phpt index 2e54be09ad1a..0523aad9f47a 100644 --- a/ext/spl/tests/heap_unserialize_under_corruption_or_modification.phpt +++ b/ext/spl/tests/heap_unserialize_under_corruption_or_modification.phpt @@ -22,9 +22,9 @@ $heap->insert(0); try { $heap->insert(2); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Heap cannot be changed when it is already being modified. +RuntimeException: Heap cannot be changed when it is already being modified. diff --git a/ext/spl/tests/iterator_022.phpt b/ext/spl/tests/iterator_022.phpt index fda42a97c830..afe024df0df2 100644 --- a/ext/spl/tests/iterator_022.phpt +++ b/ext/spl/tests/iterator_022.phpt @@ -121,7 +121,7 @@ try } catch(UnexpectedValueException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -180,4 +180,4 @@ MyRecursiveArrayIterator::valid = false RecursiveArrayIteratorIterator::endChildren(1) RecursiveArrayIteratorIterator::callHasChildren(0) = yes/yes RecursiveArrayIteratorIterator::callGetChildren(skip) -Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator +UnexpectedValueException: Objects returned by RecursiveIterator::getChildren() must implement RecursiveIterator diff --git a/ext/spl/tests/iterator_023.phpt b/ext/spl/tests/iterator_023.phpt index 8c7121ff2cb5..2ce54132abc3 100644 --- a/ext/spl/tests/iterator_023.phpt +++ b/ext/spl/tests/iterator_023.phpt @@ -121,7 +121,7 @@ try } catch(UnexpectedValueException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/spl/tests/iterator_024.phpt b/ext/spl/tests/iterator_024.phpt index 21f0216d9b97..9fc13e82d3e7 100644 --- a/ext/spl/tests/iterator_024.phpt +++ b/ext/spl/tests/iterator_024.phpt @@ -16,7 +16,7 @@ try } catch (InvalidArgumentException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "===MANUAL===\n"; @@ -35,7 +35,7 @@ foreach(new RecursiveIteratorIterator($it) as $v) echo "$v\n"; 331 4 string(13) "ArrayIterator" -An instance of RecursiveIterator or IteratorAggregate creating it is required +InvalidArgumentException: An instance of RecursiveIterator or IteratorAggregate creating it is required ===MANUAL=== string(22) "RecursiveArrayIterator" 1 diff --git a/ext/spl/tests/iterator_028.phpt b/ext/spl/tests/iterator_028.phpt index 92e00b4f78b3..9f9990e4b0dc 100644 --- a/ext/spl/tests/iterator_028.phpt +++ b/ext/spl/tests/iterator_028.phpt @@ -43,7 +43,7 @@ $it->setMaxDepth(4); try { $it->setMaxDepth(-2); } catch(\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($it->getMaxDepth()); ?> @@ -102,5 +102,5 @@ int(0) 0: 4 ===-1=== bool(false) -RecursiveIteratorIterator::setMaxDepth(): Argument #1 ($maxDepth) must be greater than or equal to -1 +ValueError: RecursiveIteratorIterator::setMaxDepth(): Argument #1 ($maxDepth) must be greater than or equal to -1 int(4) diff --git a/ext/spl/tests/iterator_030.phpt b/ext/spl/tests/iterator_030.phpt index 6a684ec30004..0520260b6909 100644 --- a/ext/spl/tests/iterator_030.phpt +++ b/ext/spl/tests/iterator_030.phpt @@ -17,7 +17,7 @@ try } catch(BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -26,7 +26,7 @@ try } catch(BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($it->valid()); @@ -36,6 +36,6 @@ var_dump($it->valid()); bool(false) bool(false) bool(false) -Accessing the key of an EmptyIterator -Accessing the value of an EmptyIterator +BadMethodCallException: Accessing the key of an EmptyIterator +BadMethodCallException: Accessing the value of an EmptyIterator bool(false) diff --git a/ext/spl/tests/iterator_031.phpt b/ext/spl/tests/iterator_031.phpt index c2b5885dd23e..388512e48506 100644 --- a/ext/spl/tests/iterator_031.phpt +++ b/ext/spl/tests/iterator_031.phpt @@ -60,7 +60,7 @@ $ap = new MyAppendIterator; try { $ap->append($it); } catch(\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ap->parent__construct(); @@ -68,7 +68,7 @@ $ap->parent__construct(); try { $ap->parent__construct($it); } catch(BadMethodCallException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ap->append($it); @@ -87,8 +87,8 @@ MyArrayIterator::rewind 1=>2 MyAppendIterator::__construct MyAppendIterator::append -The object is in an invalid state as the parent constructor was not called -AppendIterator::getIterator() must be called exactly once per instance +Error: The object is in an invalid state as the parent constructor was not called +BadMethodCallException: AppendIterator::getIterator() must be called exactly once per instance MyAppendIterator::append MyArrayIterator::rewind MyAppendIterator::append diff --git a/ext/spl/tests/iterator_032.phpt b/ext/spl/tests/iterator_032.phpt index 9f56d7574db7..a08320cc56d7 100644 --- a/ext/spl/tests/iterator_032.phpt +++ b/ext/spl/tests/iterator_032.phpt @@ -17,7 +17,7 @@ try } catch(OutOfBoundsException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $it->seek(2); @@ -29,7 +29,7 @@ try } catch(OutOfBoundsException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $it->next(); @@ -41,7 +41,7 @@ var_dump($it->valid()); int(1) 2=>3 int(2) -Cannot seek to 0 which is below the offset 1 +OutOfBoundsException: Cannot seek to 0 which is below the offset 1 int(3) -Cannot seek to 3 which is behind offset 1 plus count 2 +OutOfBoundsException: Cannot seek to 3 which is behind offset 1 plus count 2 bool(false) diff --git a/ext/spl/tests/iterator_037.phpt b/ext/spl/tests/iterator_037.phpt index c6c465baa2bf..011c63138bcd 100644 --- a/ext/spl/tests/iterator_037.phpt +++ b/ext/spl/tests/iterator_037.phpt @@ -10,7 +10,7 @@ function test($ar, $flags) try { $it->setFlags($flags); } catch (\ValueError $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; var_dump($it->getFlags()); return; } @@ -21,7 +21,7 @@ function test($ar, $flags) var_dump((string)$it); } } catch (Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -66,7 +66,7 @@ try } catch (Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -75,7 +75,7 @@ try } catch (Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -101,20 +101,20 @@ string(3) "0:1" string(3) "1:2" string(3) "2:3" ===3=== -Exception: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER int(0) ===5=== -Exception: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER int(0) ===9=== -Exception: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER int(0) ===6=== -Exception: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER int(0) ===10=== -Exception: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::setFlags(): Argument #1 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER int(0) ===X=== -Exception: Unsetting flag CALL_TO_STRING is not possible -Exception: Unsetting flag TOSTRING_USE_INNER is not possible +InvalidArgumentException: Unsetting flag CALL_TO_STRING is not possible +InvalidArgumentException: Unsetting flag TOSTRING_USE_INNER is not possible diff --git a/ext/spl/tests/iterator_041.phpt b/ext/spl/tests/iterator_041.phpt index 1fc73c1a1dda..3d3266db66cc 100644 --- a/ext/spl/tests/iterator_041.phpt +++ b/ext/spl/tests/iterator_041.phpt @@ -72,7 +72,7 @@ class MyArrayIterator extends ArrayIterator } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (isset($skip[self::$fail])) { @@ -92,13 +92,13 @@ MyArrayIterator::test('iterator_count', array(3 => 6)); ?> --EXPECT-- ===iterator_to_array=== -State 0: __construct() -State 1: __construct() -State 2: rewind() -State 3: valid() -State 4: current() -State 5: key() -State 6: next() +Exception: State 0: __construct() +Exception: State 1: __construct() +Exception: State 2: rewind() +Exception: State 3: valid() +Exception: State 4: current() +Exception: State 5: key() +Exception: State 6: next() array(2) { [0]=> int(1) @@ -106,9 +106,9 @@ array(2) { int(2) } ===iterator_count=== -State 0: __construct() -State 1: __construct() -State 2: rewind() -State 3: valid() -State 6: next() +Exception: State 0: __construct() +Exception: State 1: __construct() +Exception: State 2: rewind() +Exception: State 3: valid() +Exception: State 6: next() int(2) diff --git a/ext/spl/tests/iterator_041a.phpt b/ext/spl/tests/iterator_041a.phpt index d57735dc2cd0..5a316a109a3c 100644 --- a/ext/spl/tests/iterator_041a.phpt +++ b/ext/spl/tests/iterator_041a.phpt @@ -72,7 +72,7 @@ class MyArrayIterator extends ArrayIterator } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (isset($skip[self::$fail])) { @@ -92,7 +92,7 @@ MyArrayIterator::test('iterator_count', array(3 => 6)); ?> --EXPECT-- ===iterator_to_array=== -State 7: __destruct() +Exception: State 7: __destruct() array(2) { [0]=> int(1) @@ -100,5 +100,5 @@ array(2) { int(2) } ===iterator_count=== -State 7: __destruct() +Exception: State 7: __destruct() int(2) diff --git a/ext/spl/tests/iterator_041b.phpt b/ext/spl/tests/iterator_041b.phpt index 83d9388161e3..48c57882826d 100644 --- a/ext/spl/tests/iterator_041b.phpt +++ b/ext/spl/tests/iterator_041b.phpt @@ -72,7 +72,7 @@ class MyArrayIterator extends ArrayIterator } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (isset($skip[self::$fail])) { @@ -96,14 +96,14 @@ MyArrayIterator::test('iterator_count', array(3 => 6)); ?> --EXPECT-- ===iterator_to_array=== -State 0: __construct() -State 1: __construct() -State 2: rewind() -State 3: valid() -State 4: current() -State 5: key() -State 6: next() -State 7: __destruct() +Exception: State 0: __construct() +Exception: State 1: __construct() +Exception: State 2: rewind() +Exception: State 3: valid() +Exception: State 4: current() +Exception: State 5: key() +Exception: State 6: next() +Exception: State 7: __destruct() array(2) { [0]=> int(1) @@ -111,10 +111,10 @@ array(2) { int(2) } ===iterator_count=== -State 0: __construct() -State 1: __construct() -State 2: rewind() -State 3: valid() -State 6: next() -State 7: __destruct() +Exception: State 0: __construct() +Exception: State 1: __construct() +Exception: State 2: rewind() +Exception: State 3: valid() +Exception: State 6: next() +Exception: State 7: __destruct() int(2) diff --git a/ext/spl/tests/iterator_044.phpt b/ext/spl/tests/iterator_044.phpt index 74321194e098..64b545118bbb 100644 --- a/ext/spl/tests/iterator_044.phpt +++ b/ext/spl/tests/iterator_044.phpt @@ -27,12 +27,12 @@ class MyCachingIterator extends CachingIterator try { var_dump($this->offsetExists($v)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($this->offsetGet($v)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -46,7 +46,7 @@ try } catch(Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -55,7 +55,7 @@ try } catch(Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $it = new MyCachingIterator(new ArrayIterator(array(0, 'foo'=>1, 2, 'bar'=>3, 4)), CachingIterator::FULL_CACHE); @@ -72,8 +72,8 @@ $it->test($checks); ?> --EXPECTF-- -Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) -Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) +BadMethodCallException: MyCachingIterator does not use a full cache (see CachingIterator::__construct) +BadMethodCallException: MyCachingIterator does not use a full cache (see CachingIterator::__construct) ===0=== int(0) bool(false) @@ -83,8 +83,8 @@ NULL ===1=== object(stdClass)#%d (0) { } -CachingIterator::offsetExists(): Argument #1 ($key) must be of type string, stdClass given -CachingIterator::offsetGet(): Argument #1 ($key) must be of type string, stdClass given +TypeError: CachingIterator::offsetExists(): Argument #1 ($key) must be of type string, stdClass given +TypeError: CachingIterator::offsetGet(): Argument #1 ($key) must be of type string, stdClass given ===2=== object(MyFoo)#%d (0) { } @@ -128,8 +128,8 @@ int(0) ===1=== object(stdClass)#1 (0) { } -CachingIterator::offsetExists(): Argument #1 ($key) must be of type string, stdClass given -CachingIterator::offsetGet(): Argument #1 ($key) must be of type string, stdClass given +TypeError: CachingIterator::offsetExists(): Argument #1 ($key) must be of type string, stdClass given +TypeError: CachingIterator::offsetGet(): Argument #1 ($key) must be of type string, stdClass given ===2=== object(MyFoo)#2 (0) { } diff --git a/ext/spl/tests/iterator_045.phpt b/ext/spl/tests/iterator_045.phpt index e245b9568886..fed62cc1e71c 100644 --- a/ext/spl/tests/iterator_045.phpt +++ b/ext/spl/tests/iterator_045.phpt @@ -59,7 +59,7 @@ try } catch(Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -68,7 +68,7 @@ try } catch(Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $it = new MyCachingIterator(new ArrayIterator(array(0, 1, 2, 3)), CachingIterator::FULL_CACHE); @@ -89,8 +89,8 @@ $it->show(); ?> --EXPECT-- -Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) -Exception: MyCachingIterator does not use a full cache (see CachingIterator::__construct) +BadMethodCallException: MyCachingIterator does not use a full cache (see CachingIterator::__construct) +BadMethodCallException: MyCachingIterator does not use a full cache (see CachingIterator::__construct) MyCachingIterator::testSet() set(0,25) set(1,42) diff --git a/ext/spl/tests/iterator_047.phpt b/ext/spl/tests/iterator_047.phpt index 353990856bd8..7245397494bd 100644 --- a/ext/spl/tests/iterator_047.phpt +++ b/ext/spl/tests/iterator_047.phpt @@ -48,7 +48,7 @@ class MyRecursiveCachingIterator extends RecursiveCachingIterator } catch (Exception $e) { - echo "Exception: " . $e->getMessage() . " in " . $e->getFile() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n"; } MyRecursiveArrayIterator::$fail++; } diff --git a/ext/spl/tests/iterator_056.phpt b/ext/spl/tests/iterator_056.phpt index 84427b8707dc..477d71037bb9 100644 --- a/ext/spl/tests/iterator_056.phpt +++ b/ext/spl/tests/iterator_056.phpt @@ -22,43 +22,43 @@ class myNoRewindIterator extends NoRewindIterator {} try { $it = new myFilterIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $it = new myCachingIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $it = new myRecursiveCachingIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $it = new myParentIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $it = new myLimitIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $it = new myNoRewindIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -FilterIterator::__construct() expects exactly 1 argument, 0 given -CachingIterator::__construct() expects at least 1 argument, 0 given -RecursiveCachingIterator::__construct() expects at least 1 argument, 0 given -ParentIterator::__construct() expects exactly 1 argument, 0 given -LimitIterator::__construct() expects at least 1 argument, 0 given -NoRewindIterator::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: FilterIterator::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: CachingIterator::__construct() expects at least 1 argument, 0 given +ArgumentCountError: RecursiveCachingIterator::__construct() expects at least 1 argument, 0 given +ArgumentCountError: ParentIterator::__construct() expects exactly 1 argument, 0 given +ArgumentCountError: LimitIterator::__construct() expects at least 1 argument, 0 given +ArgumentCountError: NoRewindIterator::__construct() expects exactly 1 argument, 0 given diff --git a/ext/spl/tests/iterator_062.phpt b/ext/spl/tests/iterator_062.phpt index 904b7f0ccfdf..bbea651c223f 100644 --- a/ext/spl/tests/iterator_062.phpt +++ b/ext/spl/tests/iterator_062.phpt @@ -11,8 +11,8 @@ class myRecursiveIteratorIterator extends RecursiveIteratorIterator { try { $it = new myRecursiveIteratorIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -RecursiveIteratorIterator::__construct() expects at least 1 argument, 0 given +ArgumentCountError: RecursiveIteratorIterator::__construct() expects at least 1 argument, 0 given diff --git a/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt b/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt index c5fc21ea8bc7..b0635e34c1fe 100644 --- a/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt +++ b/ext/spl/tests/iterator_to_array_nonscalar_keys.phpt @@ -15,7 +15,7 @@ function gen() { try { var_dump(iterator_to_array(gen())); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -23,4 +23,4 @@ try { Deprecated: Implicit conversion from float 2.5 to int loses precision in %s on line %d Deprecated: Using null as an array offset is deprecated, use an empty string instead in %s on line %d -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array diff --git a/ext/spl/tests/multiple_iterator_001.phpt b/ext/spl/tests/multiple_iterator_001.phpt index e022b54dafd4..5b7f76fbd573 100644 --- a/ext/spl/tests/multiple_iterator_001.phpt +++ b/ext/spl/tests/multiple_iterator_001.phpt @@ -16,12 +16,12 @@ foreach($m as $value) { try { var_dump($m->current()); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($m->key()); } catch (RuntimeException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $m->attachIterator($iter1); @@ -38,12 +38,12 @@ foreach($m as $key => $value) { try { $m->current(); } catch(RuntimeException $e) { - echo "RuntimeException thrown: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $m->key(); } catch(RuntimeException $e) { - echo "RuntimeException thrown: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Flags = MultipleIterator::MIT_NEED_ANY | MultipleIterator::MIT_KEYS_NUMERIC --\n"; @@ -71,7 +71,7 @@ $m->rewind(); try { $m->current(); } catch(InvalidArgumentException $e) { - echo "InvalidArgumentException thrown: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Flags |= MultipleIterator::MIT_KEYS_ASSOC --\n"; @@ -89,7 +89,7 @@ echo "-- Associate with invalid value --\n"; try { $m->attachIterator($iter3, new stdClass()); } catch(TypeError $e) { - echo "TypeError thrown: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Associate with duplicate value --\n"; @@ -97,7 +97,7 @@ echo "-- Associate with duplicate value --\n"; try { $m->attachIterator($iter3, "iter1"); } catch(InvalidArgumentException $e) { - echo "InvalidArgumentException thrown: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Count, contains, detach, count, contains, iterate --\n"; @@ -114,8 +114,8 @@ foreach($m as $key => $value) { ?> --EXPECTF-- -- Default flags, no iterators -- -Called current() on an invalid iterator -Called key() on an invalid iterator +RuntimeException: Called current() on an invalid iterator +RuntimeException: Called key() on an invalid iterator -- Default flags, MultipleIterator::MIT_NEED_ALL | MultipleIterator::MIT_KEYS_NUMERIC -- bool(true) array(3) { @@ -151,8 +151,8 @@ array(3) { [2]=> string(6) "string" } -RuntimeException thrown: Called current() with non valid sub iterator -RuntimeException thrown: Called key() with non valid sub iterator +RuntimeException: Called current() with non valid sub iterator +RuntimeException: Called key() with non valid sub iterator -- Flags = MultipleIterator::MIT_NEED_ANY | MultipleIterator::MIT_KEYS_NUMERIC -- bool(true) array(3) { @@ -255,7 +255,7 @@ array(3) { int(3) } -- Flags |= MultipleIterator::MIT_KEYS_ASSOC, with iterator associated with NULL -- -InvalidArgumentException thrown: Sub-Iterator is associated with NULL +InvalidArgumentException: Sub-Iterator is associated with NULL -- Flags |= MultipleIterator::MIT_KEYS_ASSOC -- array(3) { ["iter1"]=> @@ -307,9 +307,9 @@ array(3) { int(3) } -- Associate with invalid value -- -TypeError thrown: MultipleIterator::attachIterator(): Argument #2 ($info) must be of type string|int|null, stdClass given +TypeError: MultipleIterator::attachIterator(): Argument #2 ($info) must be of type string|int|null, stdClass given -- Associate with duplicate value -- -InvalidArgumentException thrown: Key duplication error +InvalidArgumentException: Key duplication error -- Count, contains, detach, count, contains, iterate -- int(3) bool(true) diff --git a/ext/spl/tests/pqueue_001.phpt b/ext/spl/tests/pqueue_001.phpt index a318487273eb..fd0629b62146 100644 --- a/ext/spl/tests/pqueue_001.phpt +++ b/ext/spl/tests/pqueue_001.phpt @@ -8,7 +8,7 @@ $pq = new SplPriorityQueue(); try { $pq->extract(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $pq->insert("a", 1); @@ -60,7 +60,7 @@ foreach ($pq3 as $k=>$v) { ?> --EXPECT-- -Exception: Can't extract from an empty heap +RuntimeException: Can't extract from an empty heap 2=>b 1=>a 0=>c diff --git a/ext/spl/tests/pqueue_002.phpt b/ext/spl/tests/pqueue_002.phpt index df4a64f4b2d0..c33477e96528 100644 --- a/ext/spl/tests/pqueue_002.phpt +++ b/ext/spl/tests/pqueue_002.phpt @@ -18,25 +18,25 @@ try { $h->insert(3, 1); echo "inserted 3\n"; } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $h->insert(4, 1); echo "inserted 4\n"; } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Recovering..\n"; @@ -45,20 +45,20 @@ $h->recoverFromCorruption(); try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($h->extract()); } catch(Exception $e) { - echo "Exception: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- inserted 1 Exception: foo -Exception: Heap is corrupted, heap properties are no longer ensured. -Exception: Heap is corrupted, heap properties are no longer ensured. -Exception: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. Recovering.. int(1) int(2) diff --git a/ext/spl/tests/recursive_tree_iterator_002.phpt b/ext/spl/tests/recursive_tree_iterator_002.phpt index 01f12bf59538..6f2262dc275f 100644 --- a/ext/spl/tests/recursive_tree_iterator_002.phpt +++ b/ext/spl/tests/recursive_tree_iterator_002.phpt @@ -7,8 +7,8 @@ error_reporting=E_ALL&~E_NOTICE try { new RecursiveTreeIterator(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -RecursiveTreeIterator::__construct() expects at least 1 argument, 0 given +ArgumentCountError: RecursiveTreeIterator::__construct() expects at least 1 argument, 0 given diff --git a/ext/spl/tests/recursive_tree_iterator_003.phpt b/ext/spl/tests/recursive_tree_iterator_003.phpt index 80225720f27b..f1898206eb08 100644 --- a/ext/spl/tests/recursive_tree_iterator_003.phpt +++ b/ext/spl/tests/recursive_tree_iterator_003.phpt @@ -5,8 +5,8 @@ SPL: RecursiveTreeIterator(non-traversable) try { new RecursiveTreeIterator(new ArrayIterator(array())); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -RecursiveCachingIterator::__construct(): Argument #1 ($iterator) must be of type RecursiveIterator, ArrayIterator given +TypeError: RecursiveCachingIterator::__construct(): Argument #1 ($iterator) must be of type RecursiveIterator, ArrayIterator given diff --git a/ext/spl/tests/recursive_tree_iterator_007.phpt b/ext/spl/tests/recursive_tree_iterator_007.phpt index 75f1e6386c8e..996ef3fbef2c 100644 --- a/ext/spl/tests/recursive_tree_iterator_007.phpt +++ b/ext/spl/tests/recursive_tree_iterator_007.phpt @@ -24,7 +24,7 @@ try { echo "[$k] => $v\n"; } } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -34,4 +34,4 @@ try { [1] => \-Array 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 -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/spl/tests/recursive_tree_iterator_008.phpt b/ext/spl/tests/recursive_tree_iterator_008.phpt index 2dd531882463..339eb14635ea 100644 --- a/ext/spl/tests/recursive_tree_iterator_008.phpt +++ b/ext/spl/tests/recursive_tree_iterator_008.phpt @@ -21,12 +21,12 @@ foreach($it as $k => $v) { try { $it->setPrefixPart(-1, ""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $it->setPrefixPart(6, ""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- @@ -34,5 +34,5 @@ try { [0] => 0145b [c] => 045Array [0] => 0245d -RecursiveTreeIterator::setPrefixPart(): Argument #1 ($part) must be a RecursiveTreeIterator::PREFIX_* constant -RecursiveTreeIterator::setPrefixPart(): Argument #1 ($part) must be a RecursiveTreeIterator::PREFIX_* constant +ValueError: RecursiveTreeIterator::setPrefixPart(): Argument #1 ($part) must be a RecursiveTreeIterator::PREFIX_* constant +ValueError: RecursiveTreeIterator::setPrefixPart(): Argument #1 ($part) must be a RecursiveTreeIterator::PREFIX_* constant diff --git a/ext/spl/tests/regexIterator_setMode_error.phpt b/ext/spl/tests/regexIterator_setMode_error.phpt index 10df255f4a01..808fb2c960be 100644 --- a/ext/spl/tests/regexIterator_setMode_error.phpt +++ b/ext/spl/tests/regexIterator_setMode_error.phpt @@ -13,12 +13,12 @@ var_dump($regexIterator->getMode()); try { $regexIterator->setMode(7); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($e->getCode()); } ?> --EXPECT-- int(0) -RegexIterator::setMode(): Argument #1 ($mode) must be RegexIterator::MATCH, RegexIterator::GET_MATCH, RegexIterator::ALL_MATCHES, RegexIterator::SPLIT, or RegexIterator::REPLACE +ValueError: RegexIterator::setMode(): Argument #1 ($mode) must be RegexIterator::MATCH, RegexIterator::GET_MATCH, RegexIterator::ALL_MATCHES, RegexIterator::SPLIT, or RegexIterator::REPLACE int(0) diff --git a/ext/spl/tests/spl_004.phpt b/ext/spl/tests/spl_004.phpt index 3538fa6b489c..8c61739d96e8 100644 --- a/ext/spl/tests/spl_004.phpt +++ b/ext/spl/tests/spl_004.phpt @@ -45,17 +45,17 @@ echo "===ERRORS===\n"; try { var_dump(iterator_apply($it, 'test', 1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(iterator_apply($it, 'non_existing_function')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(iterator_apply($it, 'non_existing_function', NULL, 2)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -84,6 +84,6 @@ int(5) int(6) int(4) ===ERRORS=== -iterator_apply(): Argument #3 ($args) must be of type ?array, int given -iterator_apply(): Argument #2 ($callback) must be a valid callback, function "non_existing_function" not found or invalid function name -iterator_apply() expects at most 3 arguments, 4 given +TypeError: iterator_apply(): Argument #3 ($args) must be of type ?array, int given +TypeError: iterator_apply(): Argument #2 ($callback) must be a valid callback, function "non_existing_function" not found or invalid function name +ArgumentCountError: iterator_apply() expects at most 3 arguments, 4 given diff --git a/ext/spl/tests/spl_caching_iterator_constructor_flags.phpt b/ext/spl/tests/spl_caching_iterator_constructor_flags.phpt index 0d107d206f4a..9676ceae82c5 100644 --- a/ext/spl/tests/spl_caching_iterator_constructor_flags.phpt +++ b/ext/spl/tests/spl_caching_iterator_constructor_flags.phpt @@ -16,10 +16,10 @@ new CachingIterator($arrayIterator, CachingIterator::TOSTRING_USE_INNER); try { $test = new CachingIterator($arrayIterator, 3); // this throws an exception } catch (\ValueError $e){ - print $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -CachingIterator::__construct(): Argument #2 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER +ValueError: CachingIterator::__construct(): Argument #2 ($flags) must contain only one of CachingIterator::CALL_TOSTRING, CachingIterator::TOSTRING_USE_KEY, CachingIterator::TOSTRING_USE_CURRENT, or CachingIterator::TOSTRING_USE_INNER diff --git a/ext/spl/tests/spl_heap_count_basic.phpt b/ext/spl/tests/spl_heap_count_basic.phpt index e8be968e06d4..42ecd2cfc5ae 100644 --- a/ext/spl/tests/spl_heap_count_basic.phpt +++ b/ext/spl/tests/spl_heap_count_basic.phpt @@ -26,7 +26,7 @@ $heap->insert(1); try { count($heap);// refers to MyHeap->count() method } catch (Exception $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/spl/tests/spl_iterator_apply_error.phpt b/ext/spl/tests/spl_iterator_apply_error.phpt index 2a5caa008670..c047c6fc5b3f 100644 --- a/ext/spl/tests/spl_iterator_apply_error.phpt +++ b/ext/spl/tests/spl_iterator_apply_error.phpt @@ -16,11 +16,11 @@ $it = new MyArrayIterator(array(1, 21, 22)); try { $res = iterator_apply($it, 'test'); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Make the iterator break +Exception: Make the iterator break diff --git a/ext/spl/tests/spl_iterator_apply_error_001.phpt b/ext/spl/tests/spl_iterator_apply_error_001.phpt index 9c021cf98fe0..c4c239578ebf 100644 --- a/ext/spl/tests/spl_iterator_apply_error_001.phpt +++ b/ext/spl/tests/spl_iterator_apply_error_001.phpt @@ -12,9 +12,9 @@ $it = new RecursiveArrayIterator(array(1, 21, 22)); try { iterator_apply($it, 'test'); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Broken callback +Exception: Broken callback diff --git a/ext/spl/tests/spl_iterator_getcallchildren.phpt b/ext/spl/tests/spl_iterator_getcallchildren.phpt index 8a0d1cd735be..04701b5394e5 100644 --- a/ext/spl/tests/spl_iterator_getcallchildren.phpt +++ b/ext/spl/tests/spl_iterator_getcallchildren.phpt @@ -17,7 +17,7 @@ try { $output = $test->callGetChildren(); } catch (TypeError $exception) { $output = null; - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($output); @@ -33,5 +33,5 @@ array(3) { int(9) } int(7) -ArrayIterator::__construct(): Argument #1 ($array) must be of type array, int given +TypeError: ArrayIterator::__construct(): Argument #1 ($array) must be of type array, int given NULL diff --git a/ext/spl/tests/spl_iterator_iterator_constructor.phpt b/ext/spl/tests/spl_iterator_iterator_constructor.phpt index 2349a13e3160..f7ed07265e45 100644 --- a/ext/spl/tests/spl_iterator_iterator_constructor.phpt +++ b/ext/spl/tests/spl_iterator_iterator_constructor.phpt @@ -16,9 +16,9 @@ try { $test = new IteratorIterator($arrayIterator, 1, 1, 1); $test = new IteratorIterator($arrayIterator, 1, 1, 1, 1); } catch (TypeError $e){ - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -IteratorIterator::__construct() expects at most 2 arguments, 3 given +ArgumentCountError: IteratorIterator::__construct() expects at most 2 arguments, 3 given diff --git a/ext/spl/tests/spl_iterator_to_array_error.phpt b/ext/spl/tests/spl_iterator_to_array_error.phpt index 1185f8082d29..467b6901f555 100644 --- a/ext/spl/tests/spl_iterator_to_array_error.phpt +++ b/ext/spl/tests/spl_iterator_to_array_error.phpt @@ -15,19 +15,19 @@ try { // get keys $ar = iterator_to_array($it); } catch (Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { // get values $ar = iterator_to_array($it, false); } catch (Exception $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Make the iterator break -Make the iterator break +Exception: Make the iterator break +Exception: Make the iterator break diff --git a/ext/spl/tests/spl_limit_iterator_check_limits.phpt b/ext/spl/tests/spl_limit_iterator_check_limits.phpt index 3cf4bbab175e..a7c85decb1cb 100644 --- a/ext/spl/tests/spl_limit_iterator_check_limits.phpt +++ b/ext/spl/tests/spl_limit_iterator_check_limits.phpt @@ -11,18 +11,18 @@ $arrayIterator = new ArrayIterator($array); try { $limitIterator = new LimitIterator($arrayIterator, -1); } catch (\ValueError $e){ - print $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $limitIterator = new LimitIterator($arrayIterator, 0, -2); } catch (\ValueError $e){ - print $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $limitIterator = new LimitIterator($arrayIterator, 0, -1); ?> --EXPECT-- -LimitIterator::__construct(): Argument #2 ($offset) must be greater than or equal to 0 -LimitIterator::__construct(): Argument #3 ($limit) must be greater than or equal to -1 +ValueError: LimitIterator::__construct(): Argument #2 ($offset) must be greater than or equal to 0 +ValueError: LimitIterator::__construct(): Argument #3 ($limit) must be greater than or equal to -1 diff --git a/ext/spl/tests/spl_pq_top_error_corrupt.phpt b/ext/spl/tests/spl_pq_top_error_corrupt.phpt index 60f532b02fe8..f8b33e37dd62 100644 --- a/ext/spl/tests/spl_pq_top_error_corrupt.phpt +++ b/ext/spl/tests/spl_pq_top_error_corrupt.phpt @@ -30,9 +30,9 @@ try { try { $priorityQueue->top(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Exception: Heap is corrupted, heap properties are no longer ensured. +RuntimeException: Heap is corrupted, heap properties are no longer ensured. diff --git a/ext/spl/tests/spl_pq_top_error_empty.phpt b/ext/spl/tests/spl_pq_top_error_empty.phpt index 9e2a31bbc07a..62d74f1f6f8d 100644 --- a/ext/spl/tests/spl_pq_top_error_empty.phpt +++ b/ext/spl/tests/spl_pq_top_error_empty.phpt @@ -11,9 +11,9 @@ $priorityQueue = new SplPriorityQueue(); try { $priorityQueue->top(); } catch (RuntimeException $e) { - echo "Exception: ".$e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Exception: Can't peek at an empty heap +RuntimeException: Can't peek at an empty heap diff --git a/ext/spl/tests/unserialize_errors.phpt b/ext/spl/tests/unserialize_errors.phpt index 64356923ae29..ee616129ac59 100644 --- a/ext/spl/tests/unserialize_errors.phpt +++ b/ext/spl/tests/unserialize_errors.phpt @@ -9,38 +9,38 @@ try { // empty array unserialize('O:11:"ArrayObject":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:11:"ArrayObject":3:{i:0;b:1;i:1;a:0:{}i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:11:"ArrayObject":3:{i:0;i:0;i:1;a:0:{}i:2;i:0;}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:11:"ArrayObject":3:{i:0;i:0;i:1;i:0;i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { // iterator class name is not a string unserialize('O:11:"ArrayObject":4:{i:0;i:0;i:1;i:0;i:2;a:0:{}i:3;i:0;}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:11:"ArrayObject":4:{i:0;i:0;i:1;a:2:{i:0;i:1;i:1;i:2;}i:2;a:0:{}i:3;s:11:"NonExistent";}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class Existent {} @@ -48,7 +48,7 @@ class Existent {} try { unserialize('O:11:"ArrayObject":4:{i:0;i:0;i:1;a:2:{i:0;i:1;i:1;i:2;}i:2;a:0:{}i:3;s:8:"Existent";}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "ArrayIterator:\n"; @@ -56,25 +56,25 @@ echo "ArrayIterator:\n"; try { unserialize('O:13:"ArrayIterator":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:13:"ArrayIterator":3:{i:0;b:1;i:1;a:0:{}i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:13:"ArrayIterator":3:{i:0;i:0;i:1;a:0:{}i:2;i:0;}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:13:"ArrayIterator":3:{i:0;i:0;i:1;i:0;i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "SplDoublyLinkedList:\n"; @@ -82,25 +82,25 @@ echo "SplDoublyLinkedList:\n"; try { unserialize('O:19:"SplDoublyLinkedList":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:19:"SplDoublyLinkedList":3:{i:0;b:1;i:1;a:0:{}i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:19:"SplDoublyLinkedList":3:{i:0;i:0;i:1;a:0:{}i:2;i:0;}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:19:"SplDoublyLinkedList":3:{i:0;i:0;i:1;i:0;i:2;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "SplObjectStorage:\n"; @@ -108,56 +108,56 @@ echo "SplObjectStorage:\n"; try { unserialize('O:16:"SplObjectStorage":0:{}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:16:"SplObjectStorage":2:{i:0;i:0;i:1;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:16:"SplObjectStorage":2:{i:0;a:0:{}i:1;i:1;}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:16:"SplObjectStorage":2:{i:0;a:1:{i:0;i:0;}i:1;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:16:"SplObjectStorage":2:{i:0;a:2:{i:0;i:0;i:1;i:0;}i:1;a:0:{}}'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- ArrayObject: -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Passed variable is not an array or object -Incomplete or ill-typed serialization data -Cannot deserialize ArrayObject with iterator class 'NonExistent'; no such class exists -Cannot deserialize ArrayObject with iterator class 'Existent'; this class is not derived from ArrayIterator +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +InvalidArgumentException: Passed variable is not an array or object +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Cannot deserialize ArrayObject with iterator class 'NonExistent'; no such class exists +UnexpectedValueException: Cannot deserialize ArrayObject with iterator class 'Existent'; this class is not derived from ArrayIterator ArrayIterator: -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Passed variable is not an array or object +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +InvalidArgumentException: Passed variable is not an array or object SplDoublyLinkedList: -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data SplObjectStorage: -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Incomplete or ill-typed serialization data -Odd number of elements -Non-object key +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data +UnexpectedValueException: Odd number of elements +UnexpectedValueException: Non-object key diff --git a/ext/sqlite3/tests/bug66550.phpt b/ext/sqlite3/tests/bug66550.phpt index 60477a0b17ae..11548906a5b1 100644 --- a/ext/sqlite3/tests/bug66550.phpt +++ b/ext/sqlite3/tests/bug66550.phpt @@ -16,8 +16,8 @@ $db->close(); try { $stmt->reset(); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -The SQLite3 object has not been correctly initialised or is already closed +Error: The SQLite3 object has not been correctly initialised or is already closed diff --git a/ext/sqlite3/tests/bug68760.phpt b/ext/sqlite3/tests/bug68760.phpt index c6cc9ed3b1e2..cfcc7080b9f0 100644 --- a/ext/sqlite3/tests/bug68760.phpt +++ b/ext/sqlite3/tests/bug68760.phpt @@ -24,7 +24,7 @@ try { $db->close(); } catch(\Exception $e) { - echo "Exception: ".$e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/sqlite3/tests/bug72668.phpt b/ext/sqlite3/tests/bug72668.phpt index 7f33338eb5e6..551ec18cae0c 100644 --- a/ext/sqlite3/tests/bug72668.phpt +++ b/ext/sqlite3/tests/bug72668.phpt @@ -16,14 +16,14 @@ try { var_dump($result); } catch(\Exception $e) { - echo "Exception: ".$e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = $db->querySingle("SELECT my_udf_md5('test')"); var_dump($result); } catch(\Exception $e) { - echo "Exception: ".$e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $statement = $db->prepare("SELECT my_udf_md5('test')"); try { @@ -31,10 +31,12 @@ try { var_dump($result); } catch(\Exception $e) { - echo "Exception: ".$e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- Exception: test exception + Exception: test exception + Exception: test exception diff --git a/ext/sqlite3/tests/bug77051.phpt b/ext/sqlite3/tests/bug77051.phpt index 7b44516b7fdf..7cba3ca8c968 100644 --- a/ext/sqlite3/tests/bug77051.phpt +++ b/ext/sqlite3/tests/bug77051.phpt @@ -81,4 +81,4 @@ array(3) { string(4) "TEST" [2]=> string(3) "!!!" -} \ No newline at end of file +} diff --git a/ext/sqlite3/tests/gh9032.phpt b/ext/sqlite3/tests/gh9032.phpt index 34ca992ab26b..f479cbdfd200 100644 --- a/ext/sqlite3/tests/gh9032.phpt +++ b/ext/sqlite3/tests/gh9032.phpt @@ -18,9 +18,9 @@ try { $st->execute(); var_dump($db->exec('create table db2.r (id int)')); } catch (SQLite3Exception $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- bool(true) -Unable to prepare statement: not authorized +SQLite3Exception: Unable to prepare statement: not authorized diff --git a/ext/sqlite3/tests/gh_sqlite3_escapestring_nul.phpt b/ext/sqlite3/tests/gh_sqlite3_escapestring_nul.phpt index 49d66a1accf5..25fb24e53170 100644 --- a/ext/sqlite3/tests/gh_sqlite3_escapestring_nul.phpt +++ b/ext/sqlite3/tests/gh_sqlite3_escapestring_nul.phpt @@ -17,7 +17,7 @@ foreach ($cases as $in) { SQLite3::escapeString($in); echo "FAIL: no exception for ", bin2hex($in), "\n"; } catch (ValueError $e) { - echo "ValueError: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/sqlite3/tests/sqlite3_02_open.phpt b/ext/sqlite3/tests/sqlite3_02_open.phpt index 128e8c1b2484..a292bc1e7c74 100644 --- a/ext/sqlite3/tests/sqlite3_02_open.phpt +++ b/ext/sqlite3/tests/sqlite3_02_open.phpt @@ -11,9 +11,9 @@ sqlite3 try { $db = new SQLite3(); } catch (TypeError $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(59) "SQLite3::__construct() expects at least 1 argument, 0 given" +ArgumentCountError: SQLite3::__construct() expects at least 1 argument, 0 given diff --git a/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt b/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt index 67037e22695e..777aaffe1190 100644 --- a/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt +++ b/ext/sqlite3/tests/sqlite3_12_unfinalized_stmt_cleanup.phpt @@ -30,7 +30,7 @@ echo "Check db was closed\n"; try { var_dump($results->numColumns()); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; ?> @@ -50,5 +50,5 @@ array(2) { Closing database bool(true) Check db was closed -The SQLite3Result object has not been correctly initialised or is already closed +Error: The SQLite3Result object has not been correctly initialised or is already closed Done diff --git a/ext/sqlite3/tests/sqlite3_31_open.phpt b/ext/sqlite3/tests/sqlite3_31_open.phpt index 3b5705cb98df..3553c1db3ce5 100644 --- a/ext/sqlite3/tests/sqlite3_31_open.phpt +++ b/ext/sqlite3/tests/sqlite3_31_open.phpt @@ -12,11 +12,11 @@ try { $db = new SQLite3(__DIR__ . '/db1.db'); $db->open(__DIR__ . '/db1.db'); } catch (Exception $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --CLEAN-- --EXPECT-- -string(29) "Already initialised DB Object" +Exception: Already initialised DB Object diff --git a/ext/sqlite3/tests/sqlite3_33_createAggregate_notcallable.phpt b/ext/sqlite3/tests/sqlite3_33_createAggregate_notcallable.phpt index 497c54062dcb..7af587f639ba 100644 --- a/ext/sqlite3/tests/sqlite3_33_createAggregate_notcallable.phpt +++ b/ext/sqlite3/tests/sqlite3_33_createAggregate_notcallable.phpt @@ -16,13 +16,13 @@ $db = new SQLite3(':memory:'); try { $db->createAggregate('TESTAGGREGATE', 'aggregate_test_step', 'aggregate_final'); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $db->createAggregate('TESTAGGREGATE2', 'aggregate_step', 'aggregate_test_final'); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($db->createAggregate ('TESTAGGREGATE3', 'aggregate_step', 'aggregate_final')); @@ -32,7 +32,7 @@ $db->close(); echo "Done" ?> --EXPECT-- -SQLite3::createAggregate(): Argument #2 ($stepCallback) must be a valid callback, function "aggregate_test_step" not found or invalid function name -SQLite3::createAggregate(): Argument #3 ($finalCallback) must be a valid callback, function "aggregate_test_final" not found or invalid function name +TypeError: SQLite3::createAggregate(): Argument #2 ($stepCallback) must be a valid callback, function "aggregate_test_step" not found or invalid function name +TypeError: SQLite3::createAggregate(): Argument #3 ($finalCallback) must be a valid callback, function "aggregate_test_final" not found or invalid function name bool(true) Done diff --git a/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt b/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt index 0be7469c8944..57f6e5f380cf 100644 --- a/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt +++ b/ext/sqlite3/tests/sqlite3_33_load_extension_param.phpt @@ -21,9 +21,9 @@ $db = new SQLite3(':memory:'); try { $db->loadExtension(""); } catch (\Throwable $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECTF-- -string(63) "SQLite3::loadExtension(): Argument #1 ($name) must not be empty" +ValueError: SQLite3::loadExtension(): Argument #1 ($name) must not be empty diff --git a/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt b/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt index e23d9a8dad84..252801302619 100644 --- a/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt +++ b/ext/sqlite3/tests/sqlite3_34_load_extension_ext_dir.phpt @@ -19,7 +19,7 @@ $db = new SQLite3(':memory:'); try { $db->loadExtension(""); } catch (Extension $ex) { - var_dump($ex->getMessage()); + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> diff --git a/ext/sqlite3/tests/sqlite3_38_backup.phpt b/ext/sqlite3/tests/sqlite3_38_backup.phpt index 54ca9e95c231..e97ce758b427 100644 --- a/ext/sqlite3/tests/sqlite3_38_backup.phpt +++ b/ext/sqlite3/tests/sqlite3_38_backup.phpt @@ -55,4 +55,4 @@ bool(true) Backup to DB2 (should fail) Warning: SQLite3::backup(): Backup failed: source database is busy in %s on line %d -bool(false) \ No newline at end of file +bool(false) diff --git a/ext/sqlite3/tests/sqlite3_38_extended_error.phpt b/ext/sqlite3/tests/sqlite3_38_extended_error.phpt index 433e1efce047..7647980d074f 100644 --- a/ext/sqlite3/tests/sqlite3_38_extended_error.phpt +++ b/ext/sqlite3/tests/sqlite3_38_extended_error.phpt @@ -33,4 +33,3 @@ Second Extended Error Code: 1555 Closing database bool(true) Done - diff --git a/ext/sqlite3/tests/sqlite3_39_toggleExtended.phpt b/ext/sqlite3/tests/sqlite3_39_toggleExtended.phpt index 135c1cdd1095..3e3d290c130b 100644 --- a/ext/sqlite3/tests/sqlite3_39_toggleExtended.phpt +++ b/ext/sqlite3/tests/sqlite3_39_toggleExtended.phpt @@ -40,4 +40,3 @@ Third (Extended) Error Code: 1555 Closing database bool(true) Done - diff --git a/ext/sqlite3/tests/sqlite3_40_setauthorizer.phpt b/ext/sqlite3/tests/sqlite3_40_setauthorizer.phpt index a4f30040334c..63d50714715a 100644 --- a/ext/sqlite3/tests/sqlite3_40_setauthorizer.phpt +++ b/ext/sqlite3/tests/sqlite3_40_setauthorizer.phpt @@ -23,7 +23,7 @@ try { // This one should fail var_dump($db->querySingle('CREATE TABLE test (a, b);')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Test disabling the authorizer @@ -53,7 +53,7 @@ $db->setAuthorizer(function () { try { var_dump($db->querySingle('SELECT 1;')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo $e->getPrevious()->getMessage() . "\n"; } @@ -64,14 +64,14 @@ $db->setAuthorizer(function () { try { var_dump($db->querySingle('SELECT 1;')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo $e->getPrevious()->getMessage() . "\n"; } ?> --EXPECT-- int(1) -Unable to prepare statement: not authorized +SQLite3Exception: Unable to prepare statement: not authorized bool(true) int(42) string(6) "SELECT" @@ -98,7 +98,7 @@ string(28) "sqlite_master,rootpage,main," string(4) "READ" string(28) "sqlite_master,rootpage,main," bool(true) -Unable to prepare statement: not authorized +SQLite3Exception: Unable to prepare statement: not authorized The authorizer callback returned an invalid type: expected int -Unable to prepare statement: not authorized +SQLite3Exception: Unable to prepare statement: not authorized The authorizer callback returned an invalid value: 4200 diff --git a/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt b/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt index a072f31c9476..4669f57ded16 100644 --- a/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt +++ b/ext/sqlite3/tests/sqlite3_enable_exceptions.phpt @@ -13,7 +13,7 @@ var_dump($db->enableExceptions(true)); try{ $db->query("SELECT * FROM non_existent_table"); } catch(Exception $e) { - echo $e->getMessage().PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($db->enableExceptions(false)); $db->query("SELECT * FROM non_existent_table"); @@ -23,7 +23,7 @@ echo "Done\n"; ?> --EXPECTF-- bool(false) -no such table: non_existent_table +SQLite3Exception: no such table: non_existent_table Deprecated: SQLite3::enableExceptions(): Use of warnings for SQLite3 is deprecated in %s bool(true) diff --git a/ext/sqlite3/tests/sqlite3_explain.phpt b/ext/sqlite3/tests/sqlite3_explain.phpt index 1f9d4fc940e4..710e6a51fbec 100644 --- a/ext/sqlite3/tests/sqlite3_explain.phpt +++ b/ext/sqlite3/tests/sqlite3_explain.phpt @@ -41,13 +41,13 @@ var_dump($result); try { $stmts->setExplain(-1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $stmts->setExplain(256); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($stmts->explain() == Sqlite3Stmt::EXPLAIN_MODE_PREPARED); @@ -385,6 +385,6 @@ array(2) { string(13) "second_insert" } } -SQLite3Stmt::setExplain(): Argument #1 ($mode) must be one of the SQLite3Stmt::EXPLAIN_MODE_* constants -SQLite3Stmt::setExplain(): Argument #1 ($mode) must be one of the SQLite3Stmt::EXPLAIN_MODE_* constants +ValueError: SQLite3Stmt::setExplain(): Argument #1 ($mode) must be one of the SQLite3Stmt::EXPLAIN_MODE_* constants +ValueError: SQLite3Stmt::setExplain(): Argument #1 ($mode) must be one of the SQLite3Stmt::EXPLAIN_MODE_* constants bool(true) diff --git a/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer.phpt b/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer.phpt index 9a89d36f8e68..9793dcc230e1 100644 --- a/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer.phpt +++ b/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer.phpt @@ -30,7 +30,7 @@ try { // This one should fail var_dump($db->querySingle('CREATE TABLE test (a, b);')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -38,4 +38,4 @@ try { Trampoline for authorizer int(1) Trampoline for authorizer -Unable to prepare statement: not authorized +SQLite3Exception: Unable to prepare statement: not authorized diff --git a/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer_null.phpt b/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer_null.phpt index 2cea279f077e..d0fbc16a7d24 100644 --- a/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer_null.phpt +++ b/ext/sqlite3/tests/sqlite3_trampoline_setauthorizer_null.phpt @@ -17,7 +17,7 @@ try { // This one should fail var_dump($db->querySingle('CREATE TABLE test (a, b);')); } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt index 2e3e85357e13..8f3fb358d492 100644 --- a/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt +++ b/ext/standard/tests/array/GHSA-h96m-rvf9-jgm2.phpt @@ -8,9 +8,9 @@ $arr = range(0, 2**$power); try { array_merge(...array_fill(0, 2**(32-$power), $arr)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The total number of elements must be lower than %d +Error: The total number of elements must be lower than %d diff --git a/ext/standard/tests/array/array_chunk2.phpt b/ext/standard/tests/array/array_chunk2.phpt index c83f051a271d..a12836e741c2 100644 --- a/ext/standard/tests/array/array_chunk2.phpt +++ b/ext/standard/tests/array/array_chunk2.phpt @@ -7,13 +7,13 @@ $input_array = array('a', 'b', 'c', 'd', 'e'); try { var_dump(array_chunk($input_array, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_chunk($input_array, 0, true)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(array_chunk($input_array, 1)); @@ -24,8 +24,8 @@ var_dump(array_chunk($input_array, 10)); var_dump(array_chunk($input_array, 10, true)); ?> --EXPECT-- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 array(5) { [0]=> array(1) { diff --git a/ext/standard/tests/array/array_chunk_variation5.phpt b/ext/standard/tests/array/array_chunk_variation5.phpt index dfae48974d88..94b727de1c88 100644 --- a/ext/standard/tests/array/array_chunk_variation5.phpt +++ b/ext/standard/tests/array/array_chunk_variation5.phpt @@ -24,17 +24,17 @@ foreach ($sizes as $size){ try { var_dump( array_chunk($input_array, $size) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, true) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_chunk($input_array, $size, false) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> @@ -42,9 +42,9 @@ foreach ($sizes as $size){ *** Testing array_chunk() : usage variations *** -- Testing array_chunk() when size = -1 -- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 4 -- array(1) { @@ -82,9 +82,9 @@ array(1) { } -- Testing array_chunk() when size = 0 -- -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 -array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 +ValueError: array_chunk(): Argument #2 ($length) must be greater than 0 -- Testing array_chunk() when size = 1 -- array(3) { diff --git a/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt b/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt index 322cd1f0ab0b..99aad1d71473 100644 --- a/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt +++ b/ext/standard/tests/array/array_column_scalar_index_strict_types.phpt @@ -8,38 +8,38 @@ echo "\n-- Testing array_column() column key parameter should be a string or an try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() column key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], array())); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', array())); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,17 +47,17 @@ try { DONE --EXPECT-- -- Testing array_column() column key parameter should be a string or an integer (testing bool) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, false given -array_column(): Argument #2 ($column_key) must be of type string|int|null, true given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, false given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, true given -- Testing array_column() column key parameter should be a string or integer (testing array) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, array given -- Testing array_column() index key parameter should be a string or an integer (testing bool) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, false given -array_column(): Argument #3 ($index_key) must be of type string|int|null, true given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, false given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, true given -- Testing array_column() index key parameter should be a string or integer (testing array) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, array given DONE diff --git a/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt b/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt index 42ca676ebfca..02a767bd184e 100644 --- a/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt +++ b/ext/standard/tests/array/array_column_scalar_index_weak_types.phpt @@ -6,38 +6,38 @@ echo "\n-- Testing array_column() column key parameter should be a string or an try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() column key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php7', 'foo'], ['php8', 'bar']], array())); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or an integer (testing bool) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', false)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', true)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_column() index key parameter should be a string or integer (testing array) --\n"; try { var_dump(array_column([['php' => 7, 'foo'], ['php' => 8, 'bar']], 'php', array())); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -59,7 +59,7 @@ array(2) { } -- Testing array_column() column key parameter should be a string or integer (testing array) -- -array_column(): Argument #2 ($column_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #2 ($column_key) must be of type string|int|null, array given -- Testing array_column() index key parameter should be a string or an integer (testing bool) -- array(2) { @@ -76,6 +76,6 @@ array(2) { } -- Testing array_column() index key parameter should be a string or integer (testing array) -- -array_column(): Argument #3 ($index_key) must be of type string|int|null, array given +TypeError: array_column(): Argument #3 ($index_key) must be of type string|int|null, array given DONE diff --git a/ext/standard/tests/array/array_combine_error2.phpt b/ext/standard/tests/array/array_combine_error2.phpt index 8d3440eaac5d..e0371a26060e 100644 --- a/ext/standard/tests/array/array_combine_error2.phpt +++ b/ext/standard/tests/array/array_combine_error2.phpt @@ -13,23 +13,23 @@ echo "\n-- Testing array_combine() function with empty array for \$keys argument try { var_dump( array_combine(array(), array(1, 2)) ); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_combine by passing empty array to $values -echo "\n-- Testing array_combine() function with empty array for \$values argument --\n"; +echo "-- Testing array_combine() function with empty array for \$values argument --\n"; try { var_dump( array_combine(array(1, 2), array()) ); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_combine with arrays having unequal number of elements -echo "\n-- Testing array_combine() function by passing array with unequal number of elements --\n"; +echo "-- Testing array_combine() function by passing array with unequal number of elements --\n"; try { var_dump( array_combine(array(1, 2), array(1, 2, 3)) ); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -41,8 +41,8 @@ array(0) { } -- Testing array_combine() function with empty array for $keys argument -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements -- Testing array_combine() function with empty array for $values argument -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements -- Testing array_combine() function by passing array with unequal number of elements -- -array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements +ValueError: array_combine(): Argument #1 ($keys) and argument #2 ($values) must have the same number of elements diff --git a/ext/standard/tests/array/array_diff_1.phpt b/ext/standard/tests/array/array_diff_1.phpt index 7b58077e95af..aa05c718ceea 100644 --- a/ext/standard/tests/array/array_diff_1.phpt +++ b/ext/standard/tests/array/array_diff_1.phpt @@ -9,11 +9,11 @@ $c = array(5); try { array_diff($a, $b, $c); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //-=-=-=-=-=- echo "OK!"; ?> --EXPECT-- -array_diff(): Argument #2 must be of type array, int given +TypeError: array_diff(): Argument #2 must be of type array, int given OK! diff --git a/ext/standard/tests/array/array_diff_key_variation1.phpt b/ext/standard/tests/array/array_diff_key_variation1.phpt index 7b422153a0a0..020810250edc 100644 --- a/ext/standard/tests/array/array_diff_key_variation1.phpt +++ b/ext/standard/tests/array/array_diff_key_variation1.phpt @@ -88,12 +88,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_key($value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($value, $array2, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,105 +103,105 @@ fclose($fp); *** Testing array_diff_key() : usage variation *** --int 0-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_key(): Argument #1 ($array) must be of type array, int given -array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_key(): Argument #1 ($array) must be of type array, float given -array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_key(): Argument #1 ($array) must be of type array, true given -array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_key(): Argument #1 ($array) must be of type array, false given -array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_key(): Argument #1 ($array) must be of type array, true given -array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_key(): Argument #1 ($array) must be of type array, false given -array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_key(): Argument #1 ($array) must be of type array, string given -array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given -array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given -array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_key(): Argument #1 ($array) must be of type array, null given -array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_key(): Argument #1 ($array) must be of type array, resource given -array_diff_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_key(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_key_variation2.phpt b/ext/standard/tests/array/array_diff_key_variation2.phpt index b7093606c60a..ba5b93e4d7ea 100644 --- a/ext/standard/tests/array/array_diff_key_variation2.phpt +++ b/ext/standard/tests/array/array_diff_key_variation2.phpt @@ -89,12 +89,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_key($array1, $value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_key($array1, $value, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -104,105 +104,105 @@ fclose($fp); *** Testing array_diff_key() : usage variation *** --int 0-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int 1-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int 12345-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --int -12345-- -array_diff_key(): Argument #2 must be of type array, int given -array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given +TypeError: array_diff_key(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --float .5-- -array_diff_key(): Argument #2 must be of type array, float given -array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given +TypeError: array_diff_key(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_key(): Argument #2 must be of type array, true given -array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_key(): Argument #2 must be of type array, false given -array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_key(): Argument #2 must be of type array, true given -array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given +TypeError: array_diff_key(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_key(): Argument #2 must be of type array, false given -array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given +TypeError: array_diff_key(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --string DQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --string SQ-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --heredoc-- -array_diff_key(): Argument #2 must be of type array, string given -array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given +TypeError: array_diff_key(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_key(): Argument #2 must be of type array, classWithToString given -array_diff_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_key(): Argument #2 must be of type array, classWithoutToString given -array_diff_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_key(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --unset var-- -array_diff_key(): Argument #2 must be of type array, null given -array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given +TypeError: array_diff_key(): Argument #2 must be of type array, null given --resource-- -array_diff_key(): Argument #2 must be of type array, resource given -array_diff_key(): Argument #2 must be of type array, resource given +TypeError: array_diff_key(): Argument #2 must be of type array, resource given +TypeError: array_diff_key(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt index 77aef0ccc08b..b2cfb5f1270b 100644 --- a/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt +++ b/ext/standard/tests/array/array_diff_leak_custom_type_checks.phpt @@ -6,9 +6,9 @@ array_diff() memory leak with custom type checks try { array_diff([123], 'x'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_diff(): Argument #2 must be of type array, string given +TypeError: array_diff(): Argument #2 must be of type array, string given diff --git a/ext/standard/tests/array/array_diff_max_elements.phpt b/ext/standard/tests/array/array_diff_max_elements.phpt index 4c65cd049b33..d09755a93cf7 100644 --- a/ext/standard/tests/array/array_diff_max_elements.phpt +++ b/ext/standard/tests/array/array_diff_max_elements.phpt @@ -8,9 +8,9 @@ $arr = range(0, 2**$power); try { array_diff(...array_fill(0, 2**(32-$power), $arr)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The total number of elements must be lower than %d +Error: The total number of elements must be lower than %d diff --git a/ext/standard/tests/array/array_diff_uassoc_error.phpt b/ext/standard/tests/array/array_diff_uassoc_error.phpt index 1d158dc2d49c..f8fa03bd4dfc 100644 --- a/ext/standard/tests/array/array_diff_uassoc_error.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_error.phpt @@ -24,12 +24,12 @@ echo "\n-- Testing array_diff_uassoc() function with more than expected no. of a try { var_dump( array_diff_uassoc($array1, $array2, "key_compare_func", $extra_arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_uassoc($array1, $array2, $array3, $array4, "key_compare_func", $extra_arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Testing array_diff_uassoc with one less than the expected number of arguments @@ -37,7 +37,7 @@ echo "\n-- Testing array_diff_uassoc() function with less than expected no. of a try { var_dump( array_diff_uassoc($array1, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -45,8 +45,8 @@ try { *** Testing array_diff_uassoc() : error conditions *** -- Testing array_diff_uassoc() function with more than expected no. of arguments -- -array_diff_uassoc(): Argument #4 must be a valid callback, array callback must have exactly two members -array_diff_uassoc(): Argument #6 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #4 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #6 must be a valid callback, array callback must have exactly two members -- Testing array_diff_uassoc() function with less than expected no. of arguments -- -array_diff_uassoc(): Argument #2 must be a valid callback, array callback must have exactly two members +TypeError: array_diff_uassoc(): Argument #2 must be a valid callback, array callback must have exactly two members diff --git a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt index 49d6903a90ea..5a9b22cb2a28 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation1.phpt @@ -100,7 +100,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_uassoc($value, $array2, "key_compare_func") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -110,79 +110,79 @@ fclose($fp); *** Testing array_diff_uassoc() : usage variation *** --int 0-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_uassoc(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt index 7466da23d426..b6ac7027c7b7 100644 --- a/ext/standard/tests/array/array_diff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_diff_uassoc_variation2.phpt @@ -100,7 +100,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_uassoc($array1, $value, "key_compare_func") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -110,79 +110,79 @@ fclose($fp); *** Testing array_diff_uassoc() : usage variation *** --int 0-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_diff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_diff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_diff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_diff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, null given --resource-- -array_diff_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_diff_uassoc(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_ukey_variation1.phpt b/ext/standard/tests/array/array_diff_ukey_variation1.phpt index 125406497eda..8671348aa427 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation1.phpt @@ -96,12 +96,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_ukey($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_ukey($value, $array2, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -111,105 +111,105 @@ fclose($fp); *** Testing array_diff_ukey() : usage variation *** --int 0-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int 1-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_diff_ukey(): Argument #1 ($array) must be of type array, int given -array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --float .5-- -array_diff_ukey(): Argument #1 ($array) must be of type array, float given -array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_diff_ukey(): Argument #1 ($array) must be of type array, true given -array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_diff_ukey(): Argument #1 ($array) must be of type array, false given -array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_diff_ukey(): Argument #1 ($array) must be of type array, true given -array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_diff_ukey(): Argument #1 ($array) must be of type array, false given -array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_diff_ukey(): Argument #1 ($array) must be of type array, string given -array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given -array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --unset var-- -array_diff_ukey(): Argument #1 ($array) must be of type array, null given -array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, null given --resource-- -array_diff_ukey(): Argument #1 ($array) must be of type array, resource given -array_diff_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_diff_ukey(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_diff_ukey_variation10.phpt b/ext/standard/tests/array/array_diff_ukey_variation10.phpt index b8dfb73873bb..696bdf4ce24d 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation10.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation10.phpt @@ -12,18 +12,18 @@ $array2 = array("a" => "green", "yellow", "red"); try { var_dump( array_diff_ukey($array1, $array1, "unknown_function") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //function name within single quotes try { var_dump( array_diff_ukey($array1, $array1, 'unknown_function') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_diff_ukey() : usage variation *** -array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name -array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_diff_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name diff --git a/ext/standard/tests/array/array_diff_ukey_variation2.phpt b/ext/standard/tests/array/array_diff_ukey_variation2.phpt index cf71a26d22be..6be4e8c2f39e 100644 --- a/ext/standard/tests/array/array_diff_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_diff_ukey_variation2.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_diff_ukey($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_diff_ukey($array1, $value, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_diff_ukey() : usage variation *** --int 0-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int 1-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int 12345-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --int -12345-- -array_diff_ukey(): Argument #2 must be of type array, int given -array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given +TypeError: array_diff_ukey(): Argument #2 must be of type array, int given --float 10.5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float -10.5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --float .5-- -array_diff_ukey(): Argument #2 must be of type array, float given -array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given +TypeError: array_diff_ukey(): Argument #2 must be of type array, float given --uppercase NULL-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --lowercase null-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --lowercase true-- -array_diff_ukey(): Argument #2 must be of type array, true given -array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given --lowercase false-- -array_diff_ukey(): Argument #2 must be of type array, false given -array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_diff_ukey(): Argument #2 must be of type array, true given -array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given +TypeError: array_diff_ukey(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_diff_ukey(): Argument #2 must be of type array, false given -array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given +TypeError: array_diff_ukey(): Argument #2 must be of type array, false given --empty string DQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --empty string SQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --string DQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --string SQ-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --mixed case string-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --heredoc-- -array_diff_ukey(): Argument #2 must be of type array, string given -array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given +TypeError: array_diff_ukey(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_diff_ukey(): Argument #2 must be of type array, classWithToString given -array_diff_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given -array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_diff_ukey(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --unset var-- -array_diff_ukey(): Argument #2 must be of type array, null given -array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given +TypeError: array_diff_ukey(): Argument #2 must be of type array, null given --resource-- -array_diff_ukey(): Argument #2 must be of type array, resource given -array_diff_ukey(): Argument #2 must be of type array, resource given +TypeError: array_diff_ukey(): Argument #2 must be of type array, resource given +TypeError: array_diff_ukey(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_fill_error.phpt b/ext/standard/tests/array/array_fill_error.phpt index 9b04f7553944..678e545e9a07 100644 --- a/ext/standard/tests/array/array_fill_error.phpt +++ b/ext/standard/tests/array/array_fill_error.phpt @@ -12,10 +12,10 @@ $val = 1; try { var_dump( array_fill($start_key,$num,$val) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_fill() : error conditions *** -array_fill(): Argument #2 ($count) must be greater than or equal to 0 +ValueError: array_fill(): Argument #2 ($count) must be greater than or equal to 0 diff --git a/ext/standard/tests/array/array_fill_error2.phpt b/ext/standard/tests/array/array_fill_error2.phpt index 1f8b841c8421..18d895140002 100644 --- a/ext/standard/tests/array/array_fill_error2.phpt +++ b/ext/standard/tests/array/array_fill_error2.phpt @@ -10,7 +10,7 @@ $intMax = 2147483647; try { $array = array_fill(0, $intMax+1, 1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // calling array_fill() with 'count' equals to INT_MAX @@ -18,6 +18,6 @@ $array = array_fill(0, $intMax, 1); ?> --EXPECTF-- -array_fill(): Argument #2 ($count) is too large +ValueError: array_fill(): Argument #2 ($count) is too large Fatal error: Possible integer overflow in memory allocation (%d * %d + %d) in %s on line %d diff --git a/ext/standard/tests/array/array_fill_variation6.phpt b/ext/standard/tests/array/array_fill_variation6.phpt index 60dcec7e231e..cf0bc860f0c5 100644 --- a/ext/standard/tests/array/array_fill_variation6.phpt +++ b/ext/standard/tests/array/array_fill_variation6.phpt @@ -10,10 +10,10 @@ var_dump( try { $a[] = "bar"; } catch (Error $ex) { - echo $ex->getMessage(), PHP_EOL; + echo $ex::class, ': ', $ex->getMessage(), PHP_EOL; } ?> --EXPECT-- int(1) bool(true) -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/ext/standard/tests/array/array_filter_invalid_mode.phpt b/ext/standard/tests/array/array_filter_invalid_mode.phpt index b312bcfe5a23..4994aa63a004 100644 --- a/ext/standard/tests/array/array_filter_invalid_mode.phpt +++ b/ext/standard/tests/array/array_filter_invalid_mode.phpt @@ -6,7 +6,7 @@ Test array_filter() function : usage variations - mode exception try { var_dump(array_filter([], mode: 999)); } catch (Throwable $e) { - echo $e::class . ': '.$e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" diff --git a/ext/standard/tests/array/array_filter_variation10.phpt b/ext/standard/tests/array/array_filter_variation10.phpt index eef7b6462033..f39efb581dac 100644 --- a/ext/standard/tests/array/array_filter_variation10.phpt +++ b/ext/standard/tests/array/array_filter_variation10.phpt @@ -32,7 +32,7 @@ echo "*** Testing array_filter() : usage variations - 'callback' expecting secon try { var_dump( array_filter($small, 'dump', false) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "*** Testing array_filter() with various use types ***\n"; @@ -46,7 +46,7 @@ var_dump(array_filter($mixed, 'is_numeric', 0)); try { var_dump(array_filter($mixed, 'is_numeric', ARRAY_FILTER_USE_BOTH)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -73,7 +73,7 @@ array(3) { NULL } *** Testing array_filter() : usage variations - 'callback' expecting second argument *** -Exception: Too few arguments to function dump(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function dump(), 1 passed and exactly 2 expected *** Testing array_filter() with various use types *** array(2) { [1]=> @@ -87,5 +87,5 @@ array(2) { ["b"]=> int(2) } -is_numeric() expects exactly 1 argument, 2 given +ArgumentCountError: is_numeric() expects exactly 1 argument, 2 given Done diff --git a/ext/standard/tests/array/array_filter_variation9.phpt b/ext/standard/tests/array/array_filter_variation9.phpt index 2e6efc0eda5d..bc936346ea13 100644 --- a/ext/standard/tests/array/array_filter_variation9.phpt +++ b/ext/standard/tests/array/array_filter_variation9.phpt @@ -20,14 +20,14 @@ var_dump( array_filter($input, 'chr') ); try { var_dump( array_filter($input, 'echo') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // using language construct 'isset' as 'callback' try { var_dump( array_filter($input, 'isset') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -54,6 +54,6 @@ array(4) { [3]=> int(100) } -array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name -array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name +TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_filter(): Argument #2 ($callback) must be a valid callback or null, function "isset" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt index 9c9cef73dd1f..6a90fff127b5 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation1.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect_assoc($unexpected_value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect_assoc() with more arguments try { var_dump( array_intersect_assoc($unexpected_value, $array2, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -113,75 +113,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect_assoc() : Passing non-array values to $array1 argument *** --- Iteration 1 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 1 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 2 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 2 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 3 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 3 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 4 --array_intersect_assoc(): Argument #1 ($array) must be of type array, int given -array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +-- Iteration 4 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, int given --- Iteration 5 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 5 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 6 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 6 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 7 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 7 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 8 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 8 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 9 --array_intersect_assoc(): Argument #1 ($array) must be of type array, float given -array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +-- Iteration 9 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, float given --- Iteration 10 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 10 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 11 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 11 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 12 --array_intersect_assoc(): Argument #1 ($array) must be of type array, true given -array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +-- Iteration 12 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given --- Iteration 13 --array_intersect_assoc(): Argument #1 ($array) must be of type array, false given -array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +-- Iteration 13 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given --- Iteration 14 --array_intersect_assoc(): Argument #1 ($array) must be of type array, true given -array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +-- Iteration 14 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, true given --- Iteration 15 --array_intersect_assoc(): Argument #1 ($array) must be of type array, false given -array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +-- Iteration 15 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, false given --- Iteration 16 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 16 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 17 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 17 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 18 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 18 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 19 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 19 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 20 --array_intersect_assoc(): Argument #1 ($array) must be of type array, string given -array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +-- Iteration 20 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given -array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given +-- Iteration 21 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, classA given --- Iteration 22 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 22 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 23 --array_intersect_assoc(): Argument #1 ($array) must be of type array, null given -array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +-- Iteration 23 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, null given --- Iteration 24 --array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given -array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given +-- Iteration 24 --TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_assoc(): Argument #1 ($array) must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt index 31b54469863a..98abaef9d1ac 100644 --- a/ext/standard/tests/array/array_intersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_assoc_variation2.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect_assoc($array1,$unexpected_value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect_assoc() with more arguments try { var_dump( array_intersect_assoc($array1, $unexpected_value, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -114,75 +114,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect_assoc() : Passing non-array values to $array2 argument *** --- Iteration 1 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 1 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 2 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 2 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 3 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 3 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 4 --array_intersect_assoc(): Argument #2 must be of type array, int given -array_intersect_assoc(): Argument #2 must be of type array, int given +-- Iteration 4 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, int given --- Iteration 5 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 5 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 6 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 6 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 7 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 7 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 8 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 8 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 9 --array_intersect_assoc(): Argument #2 must be of type array, float given -array_intersect_assoc(): Argument #2 must be of type array, float given +-- Iteration 9 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, float given --- Iteration 10 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 10 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 11 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 11 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 12 --array_intersect_assoc(): Argument #2 must be of type array, true given -array_intersect_assoc(): Argument #2 must be of type array, true given +-- Iteration 12 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given --- Iteration 13 --array_intersect_assoc(): Argument #2 must be of type array, false given -array_intersect_assoc(): Argument #2 must be of type array, false given +-- Iteration 13 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given --- Iteration 14 --array_intersect_assoc(): Argument #2 must be of type array, true given -array_intersect_assoc(): Argument #2 must be of type array, true given +-- Iteration 14 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, true given --- Iteration 15 --array_intersect_assoc(): Argument #2 must be of type array, false given -array_intersect_assoc(): Argument #2 must be of type array, false given +-- Iteration 15 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, false given --- Iteration 16 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 16 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 17 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 17 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 18 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 18 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 19 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 19 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 20 --array_intersect_assoc(): Argument #2 must be of type array, string given -array_intersect_assoc(): Argument #2 must be of type array, string given +-- Iteration 20 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, string given --- Iteration 21 --array_intersect_assoc(): Argument #2 must be of type array, classA given -array_intersect_assoc(): Argument #2 must be of type array, classA given +-- Iteration 21 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, classA given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, classA given --- Iteration 22 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 22 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 23 --array_intersect_assoc(): Argument #2 must be of type array, null given -array_intersect_assoc(): Argument #2 must be of type array, null given +-- Iteration 23 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, null given --- Iteration 24 --array_intersect_assoc(): Argument #2 must be of type array, resource given -array_intersect_assoc(): Argument #2 must be of type array, resource given +-- Iteration 24 --TypeError: array_intersect_assoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_assoc(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_key_variation1.phpt b/ext/standard/tests/array/array_intersect_key_variation1.phpt index ae11e0a2ec93..996481d6aade 100644 --- a/ext/standard/tests/array/array_intersect_key_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation1.phpt @@ -92,12 +92,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_key($value, $array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($value, $array2, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -107,105 +107,105 @@ fclose($fp); *** Testing array_intersect_key() : usage variation *** --int 0-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_key(): Argument #1 ($array) must be of type array, int given -array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_key(): Argument #1 ($array) must be of type array, float given -array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_key(): Argument #1 ($array) must be of type array, true given -array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_key(): Argument #1 ($array) must be of type array, false given -array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_key(): Argument #1 ($array) must be of type array, true given -array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_key(): Argument #1 ($array) must be of type array, false given -array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_key(): Argument #1 ($array) must be of type array, string given -array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_key(): Argument #1 ($array) must be of type array, null given -array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, null given --resource var-- -array_intersect_key(): Argument #1 ($array) must be of type array, resource given -array_intersect_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_key(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_key_variation2.phpt b/ext/standard/tests/array/array_intersect_key_variation2.phpt index d2a8672e284c..efe9d870ab12 100644 --- a/ext/standard/tests/array/array_intersect_key_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_key_variation2.phpt @@ -93,12 +93,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_key($array1, $value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_key($array1, $value, $array3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -108,105 +108,105 @@ fclose($fp); *** Testing array_intersect_key() : usage variation *** --int 0-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int 1-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_key(): Argument #2 must be of type array, int given -array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given +TypeError: array_intersect_key(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --float .5-- -array_intersect_key(): Argument #2 must be of type array, float given -array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given +TypeError: array_intersect_key(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_key(): Argument #2 must be of type array, true given -array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_key(): Argument #2 must be of type array, false given -array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_key(): Argument #2 must be of type array, true given -array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given +TypeError: array_intersect_key(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_key(): Argument #2 must be of type array, false given -array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given +TypeError: array_intersect_key(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_key(): Argument #2 must be of type array, string given -array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given +TypeError: array_intersect_key(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_key(): Argument #2 must be of type array, classWithToString given -array_intersect_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_key(): Argument #2 must be of type array, classWithoutToString given -array_intersect_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_key(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --unset var-- -array_intersect_key(): Argument #2 must be of type array, null given -array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given +TypeError: array_intersect_key(): Argument #2 must be of type array, null given --resource var-- -array_intersect_key(): Argument #2 must be of type array, resource given -array_intersect_key(): Argument #2 must be of type array, resource given +TypeError: array_intersect_key(): Argument #2 must be of type array, resource given +TypeError: array_intersect_key(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt index ea6ce6a1a5a1..0c51c703cbfc 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation1.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_uassoc($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_uassoc($value, $array2, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_intersect_uassoc() : usage variation *** --int 0-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, null given --resource-- -array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given -array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt index 03a7dc8d07e5..b74dbe4ce783 100644 --- a/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_uassoc_variation2.phpt @@ -100,12 +100,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_uassoc($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_uassoc($array1, $value, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -115,105 +115,105 @@ fclose($fp); *** Testing array_intersect_uassoc() : usage variation *** --int 0-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_uassoc(): Argument #2 must be of type array, int given -array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_intersect_uassoc(): Argument #2 must be of type array, float given -array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_uassoc(): Argument #2 must be of type array, true given -array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_uassoc(): Argument #2 must be of type array, false given -array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_uassoc(): Argument #2 must be of type array, true given -array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_uassoc(): Argument #2 must be of type array, false given -array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_uassoc(): Argument #2 must be of type array, string given -array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given -array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given -array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_intersect_uassoc(): Argument #2 must be of type array, null given -array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, null given --resource-- -array_intersect_uassoc(): Argument #2 must be of type array, resource given -array_intersect_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, resource given +TypeError: array_intersect_uassoc(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt index 8195d45c294e..0ba74cdd9283 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation1.phpt @@ -98,12 +98,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_ukey($value, $array2, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_ukey($value, $array2, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -113,105 +113,105 @@ fclose($fp); *** Testing array_intersect_ukey() : usage variation *** --int 0-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int 1-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given -array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --float .5-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given -array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given -array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given -array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given -array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given -array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --unset var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given -array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, null given --resource var-- -array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given -array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #1 ($array) must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt index d32c0632ca5e..c88833960683 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation2.phpt @@ -98,12 +98,12 @@ foreach($inputs as $key =>$value) { try { var_dump( array_intersect_ukey($array1, $value, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_intersect_ukey($array1, $value, $array3, 'key_compare_func') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -113,105 +113,105 @@ fclose($fp); *** Testing array_intersect_ukey() : usage variation *** --int 0-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int 1-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int 12345-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --int -12345-- -array_intersect_ukey(): Argument #2 must be of type array, int given -array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, int given --float 10.5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float -10.5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --float .5-- -array_intersect_ukey(): Argument #2 must be of type array, float given -array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, float given --uppercase NULL-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --lowercase null-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --lowercase true-- -array_intersect_ukey(): Argument #2 must be of type array, true given -array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given --lowercase false-- -array_intersect_ukey(): Argument #2 must be of type array, false given -array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_intersect_ukey(): Argument #2 must be of type array, true given -array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_intersect_ukey(): Argument #2 must be of type array, false given -array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, false given --empty string DQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --empty string SQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --string DQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --string SQ-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --mixed case string-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --heredoc-- -array_intersect_ukey(): Argument #2 must be of type array, string given -array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_intersect_ukey(): Argument #2 must be of type array, classWithToString given -array_intersect_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given -array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --unset var-- -array_intersect_ukey(): Argument #2 must be of type array, null given -array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, null given --resource var-- -array_intersect_ukey(): Argument #2 must be of type array, resource given -array_intersect_ukey(): Argument #2 must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, resource given +TypeError: array_intersect_ukey(): Argument #2 must be of type array, resource given diff --git a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt index 71126a1eddfa..6dd1b20ace90 100644 --- a/ext/standard/tests/array/array_intersect_ukey_variation8.phpt +++ b/ext/standard/tests/array/array_intersect_ukey_variation8.phpt @@ -12,18 +12,18 @@ $array2 = array('green' => 5, 'blue' => 6, 'yellow' => 7, 'cyan' => 8); try { var_dump( array_intersect_ukey($array1, $array2, "unknown_function") ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //function name within single quotes try { var_dump( array_intersect_ukey($array1, $array2, 'unknown_function') ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing array_intersect_ukey() : usage variation *** -array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name -array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name +TypeError: array_intersect_ukey(): Argument #3 must be a valid callback, function "unknown_function" not found or invalid function name diff --git a/ext/standard/tests/array/array_intersect_variation1.phpt b/ext/standard/tests/array/array_intersect_variation1.phpt index 733250b69f70..9028911590b8 100644 --- a/ext/standard/tests/array/array_intersect_variation1.phpt +++ b/ext/standard/tests/array/array_intersect_variation1.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect($unexpected_value,$array2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect() with more arguments try { var_dump( array_intersect($unexpected_value, $array2, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -113,75 +113,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect() : Passing non-array values to $array1 argument *** --- Iterator 1 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 1 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 2 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 2 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 3 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 3 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 4 --array_intersect(): Argument #1 ($array) must be of type array, int given -array_intersect(): Argument #1 ($array) must be of type array, int given +-- Iterator 4 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, int given --- Iterator 5 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 5 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 6 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 6 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 7 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 7 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 8 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 8 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 9 --array_intersect(): Argument #1 ($array) must be of type array, float given -array_intersect(): Argument #1 ($array) must be of type array, float given +-- Iterator 9 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, float given --- Iterator 10 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 10 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 11 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 11 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 12 --array_intersect(): Argument #1 ($array) must be of type array, true given -array_intersect(): Argument #1 ($array) must be of type array, true given +-- Iterator 12 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given --- Iterator 13 --array_intersect(): Argument #1 ($array) must be of type array, false given -array_intersect(): Argument #1 ($array) must be of type array, false given +-- Iterator 13 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given --- Iterator 14 --array_intersect(): Argument #1 ($array) must be of type array, true given -array_intersect(): Argument #1 ($array) must be of type array, true given +-- Iterator 14 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, true given --- Iterator 15 --array_intersect(): Argument #1 ($array) must be of type array, false given -array_intersect(): Argument #1 ($array) must be of type array, false given +-- Iterator 15 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, false given --- Iterator 16 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 16 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 17 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 17 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 18 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 18 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 19 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 19 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 20 --array_intersect(): Argument #1 ($array) must be of type array, string given -array_intersect(): Argument #1 ($array) must be of type array, string given +-- Iterator 20 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, string given --- Iterator 21 --array_intersect(): Argument #1 ($array) must be of type array, classA given -array_intersect(): Argument #1 ($array) must be of type array, classA given +-- Iterator 21 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, classA given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, classA given --- Iterator 22 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 22 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 23 --array_intersect(): Argument #1 ($array) must be of type array, null given -array_intersect(): Argument #1 ($array) must be of type array, null given +-- Iterator 23 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, null given --- Iterator 24 --array_intersect(): Argument #1 ($array) must be of type array, resource given -array_intersect(): Argument #1 ($array) must be of type array, resource given +-- Iterator 24 --TypeError: array_intersect(): Argument #1 ($array) must be of type array, resource given +TypeError: array_intersect(): Argument #1 ($array) must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_intersect_variation2.phpt b/ext/standard/tests/array/array_intersect_variation2.phpt index b09683446b87..1026fb9a7904 100644 --- a/ext/standard/tests/array/array_intersect_variation2.phpt +++ b/ext/standard/tests/array/array_intersect_variation2.phpt @@ -93,14 +93,14 @@ foreach($arrays as $unexpected_value) { try { var_dump( array_intersect($array1,$unexpected_value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Calling array_intersect() with more arguments try { var_dump( array_intersect($array1, $unexpected_value, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -114,75 +114,75 @@ echo "Done"; --EXPECT-- *** Testing array_intersect() : Passing non-array values to $array2 argument *** --- Iterator 1 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 1 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 2 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 2 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 3 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 3 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 4 --array_intersect(): Argument #2 must be of type array, int given -array_intersect(): Argument #2 must be of type array, int given +-- Iterator 4 --TypeError: array_intersect(): Argument #2 must be of type array, int given +TypeError: array_intersect(): Argument #2 must be of type array, int given --- Iterator 5 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 5 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 6 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 6 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 7 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 7 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 8 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 8 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 9 --array_intersect(): Argument #2 must be of type array, float given -array_intersect(): Argument #2 must be of type array, float given +-- Iterator 9 --TypeError: array_intersect(): Argument #2 must be of type array, float given +TypeError: array_intersect(): Argument #2 must be of type array, float given --- Iterator 10 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 10 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 11 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 11 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 12 --array_intersect(): Argument #2 must be of type array, true given -array_intersect(): Argument #2 must be of type array, true given +-- Iterator 12 --TypeError: array_intersect(): Argument #2 must be of type array, true given +TypeError: array_intersect(): Argument #2 must be of type array, true given --- Iterator 13 --array_intersect(): Argument #2 must be of type array, false given -array_intersect(): Argument #2 must be of type array, false given +-- Iterator 13 --TypeError: array_intersect(): Argument #2 must be of type array, false given +TypeError: array_intersect(): Argument #2 must be of type array, false given --- Iterator 14 --array_intersect(): Argument #2 must be of type array, true given -array_intersect(): Argument #2 must be of type array, true given +-- Iterator 14 --TypeError: array_intersect(): Argument #2 must be of type array, true given +TypeError: array_intersect(): Argument #2 must be of type array, true given --- Iterator 15 --array_intersect(): Argument #2 must be of type array, false given -array_intersect(): Argument #2 must be of type array, false given +-- Iterator 15 --TypeError: array_intersect(): Argument #2 must be of type array, false given +TypeError: array_intersect(): Argument #2 must be of type array, false given --- Iterator 16 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 16 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 17 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 17 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 18 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 18 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 19 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 19 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 20 --array_intersect(): Argument #2 must be of type array, string given -array_intersect(): Argument #2 must be of type array, string given +-- Iterator 20 --TypeError: array_intersect(): Argument #2 must be of type array, string given +TypeError: array_intersect(): Argument #2 must be of type array, string given --- Iterator 21 --array_intersect(): Argument #2 must be of type array, classA given -array_intersect(): Argument #2 must be of type array, classA given +-- Iterator 21 --TypeError: array_intersect(): Argument #2 must be of type array, classA given +TypeError: array_intersect(): Argument #2 must be of type array, classA given --- Iterator 22 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 22 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 23 --array_intersect(): Argument #2 must be of type array, null given -array_intersect(): Argument #2 must be of type array, null given +-- Iterator 23 --TypeError: array_intersect(): Argument #2 must be of type array, null given +TypeError: array_intersect(): Argument #2 must be of type array, null given --- Iterator 24 --array_intersect(): Argument #2 must be of type array, resource given -array_intersect(): Argument #2 must be of type array, resource given +-- Iterator 24 --TypeError: array_intersect(): Argument #2 must be of type array, resource given +TypeError: array_intersect(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_key_exists.phpt b/ext/standard/tests/array/array_key_exists.phpt index 92373b04bb45..67123e8495fd 100644 --- a/ext/standard/tests/array/array_key_exists.phpt +++ b/ext/standard/tests/array/array_key_exists.phpt @@ -64,7 +64,7 @@ echo "\n*** Testing error conditions ***\n"; try { array_key_exists(array(), array()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Testing operation on objects ***\n"; @@ -77,7 +77,7 @@ $key_check_obj = new key_check; //new object try { var_dump(array_key_exists("public_var", $key_check_obj)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -250,8 +250,8 @@ bool(false) bool(true) *** Testing error conditions *** -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array *** Testing operation on objects *** -array_key_exists(): Argument #2 ($array) must be of type array, key_check given +TypeError: array_key_exists(): Argument #2 ($array) must be of type array, key_check given Done diff --git a/ext/standard/tests/array/array_key_exists_variation1.phpt b/ext/standard/tests/array/array_key_exists_variation1.phpt index d12fbc839b79..44ee64f49638 100644 --- a/ext/standard/tests/array/array_key_exists_variation1.phpt +++ b/ext/standard/tests/array/array_key_exists_variation1.phpt @@ -80,7 +80,7 @@ foreach($inputs as $input) { try { var_dump( array_key_exists($input, $search) ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; }; @@ -133,7 +133,7 @@ bool(false) bool(false) -- Iteration 13 -- -Cannot access offset of type array on array +TypeError: Cannot access offset of type array on array -- Iteration 14 -- bool(true) @@ -145,7 +145,7 @@ bool(true) bool(true) -- Iteration 17 -- -Cannot access offset of type classA on array +TypeError: Cannot access offset of type classA on array -- Iteration 18 -- diff --git a/ext/standard/tests/array/array_key_exists_variation3.phpt b/ext/standard/tests/array/array_key_exists_variation3.phpt index 5abff19378fd..7beb05ed709b 100644 --- a/ext/standard/tests/array/array_key_exists_variation3.phpt +++ b/ext/standard/tests/array/array_key_exists_variation3.phpt @@ -20,7 +20,7 @@ foreach($keys as $key) { try { var_dump(array_key_exists($key, $search)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Cast float to int:\n"; var_dump(array_key_exists((int)$key, $search)); diff --git a/ext/standard/tests/array/array_map_error.phpt b/ext/standard/tests/array/array_map_error.phpt index 7d1d6986aba5..e95984697381 100644 --- a/ext/standard/tests/array/array_map_error.phpt +++ b/ext/standard/tests/array/array_map_error.phpt @@ -12,7 +12,7 @@ function callback1() { try { var_dump( array_map('callback1') ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_map() function with less no. of arrays than callback function arguments --\n"; @@ -23,7 +23,7 @@ function callback2($p, $q) { try { var_dump( array_map('callback2', $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_map() function with more no. of arrays than callback function arguments --\n"; @@ -37,10 +37,10 @@ echo "Done"; *** Testing array_map() : error conditions *** -- Testing array_map() function with one less than expected no. of arguments -- -Exception: array_map() expects at least 2 arguments, 1 given +ArgumentCountError: array_map() expects at least 2 arguments, 1 given -- Testing array_map() function with less no. of arrays than callback function arguments -- -Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected -- Testing array_map() function with more no. of arrays than callback function arguments -- array(2) { diff --git a/ext/standard/tests/array/array_map_object1.phpt b/ext/standard/tests/array/array_map_object1.phpt index d86919bf9c4e..0f4cb4685533 100644 --- a/ext/standard/tests/array/array_map_object1.phpt +++ b/ext/standard/tests/array/array_map_object1.phpt @@ -26,7 +26,7 @@ function test($cb, $args) { try { var_dump(array_map($cb, $args)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } test(array('SimpleClass', 'square'), array(1, 2)); @@ -132,15 +132,15 @@ array(2) { -- simple class with private variable and method -- SimpleClassPri::add -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method SimpleClassPri::add() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method SimpleClassPri::add() -- simple class with protected variable and method -- SimpleClassPro::mul -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method SimpleClassPro::mul() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method SimpleClassPro::mul() -- class without members -- EmptyClass -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members -- abstract class -- ChildClass::emptyFunction @@ -173,9 +173,9 @@ array(2) { int(4) } StaticClass::cube -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method StaticClass::cube() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access private method StaticClass::cube() StaticClass::retVal -array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method StaticClass::retVal() +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, cannot access protected method StaticClass::retVal() -- class implementing an interface -- InterClass::square array(2) { diff --git a/ext/standard/tests/array/array_map_object2.phpt b/ext/standard/tests/array/array_map_object2.phpt index 3b9666ce50ac..8aac77327b6b 100644 --- a/ext/standard/tests/array/array_map_object2.phpt +++ b/ext/standard/tests/array/array_map_object2.phpt @@ -24,14 +24,14 @@ echo "-- with non-existent class --\n"; try { var_dump( array_map(array('non-existent', 'square'), array(1, 2)) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with existent class and non-existent method --\n"; try { var_dump( array_map(array('SimpleClass', 'non-existent'), array(1, 2)) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -39,7 +39,7 @@ echo "Done"; --EXPECT-- *** Testing array_map() : with non-existent class and method *** -- with non-existent class -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class "non-existent" not found +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class "non-existent" not found -- with existent class and non-existent method -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class SimpleClass does not have a method "non-existent" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class SimpleClass does not have a method "non-existent" Done diff --git a/ext/standard/tests/array/array_map_object3.phpt b/ext/standard/tests/array/array_map_object3.phpt index 55a97a317f2a..914ca52d9c1d 100644 --- a/ext/standard/tests/array/array_map_object3.phpt +++ b/ext/standard/tests/array/array_map_object3.phpt @@ -49,7 +49,7 @@ echo "-- accessing child method from parent class --\n"; try { var_dump( array_map(array('ParentClass', 'staticChild'), $arr1) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- accessing parent method using child class object --\n"; @@ -59,7 +59,7 @@ echo "-- accessing child method using parent class object --\n"; try { var_dump( array_map(array($parentobj, 'staticChild'), $arr1) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -76,7 +76,7 @@ array(3) { int(7) } -- accessing child method from parent class -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" -- accessing parent method using child class object -- array(3) { [0]=> @@ -87,5 +87,5 @@ array(3) { int(7) } -- accessing child method using parent class object -- -array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, class ParentClass does not have a method "staticChild" Done diff --git a/ext/standard/tests/array/array_map_variation10.phpt b/ext/standard/tests/array/array_map_variation10.phpt index 2f7bac4c9146..daf257dfe3b9 100644 --- a/ext/standard/tests/array/array_map_variation10.phpt +++ b/ext/standard/tests/array/array_map_variation10.phpt @@ -18,7 +18,7 @@ echo "-- anonymous function with two parameters and passing one array --\n"; try { var_dump( array_map( function($a, $b) { return array($a, $b); }, $array1)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- anonymous function with NULL parameter --\n"; @@ -31,7 +31,7 @@ echo "-- passing NULL as 'array1' --\n"; try { var_dump( array_map( function($a) { return array($a); }, NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -63,7 +63,7 @@ array(3) { } } -- anonymous function with two parameters and passing one array -- -Exception: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 1 passed and exactly 2 expected -- anonymous function with NULL parameter -- array(3) { [0]=> @@ -83,5 +83,5 @@ array(3) { NULL } -- passing NULL as 'array1' -- -array_map(): Argument #2 ($array) must be of type array, null given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/array/array_map_variation12.phpt b/ext/standard/tests/array/array_map_variation12.phpt index d3fa62e93d67..c1664364d962 100644 --- a/ext/standard/tests/array/array_map_variation12.phpt +++ b/ext/standard/tests/array/array_map_variation12.phpt @@ -18,14 +18,14 @@ echo "-- with built-in function 'pow' and one parameter --\n"; try { var_dump( array_map('pow', $array1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with language construct --\n"; try { var_dump( array_map('echo', $array1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -42,7 +42,7 @@ array(3) { int(243) } -- with built-in function 'pow' and one parameter -- -pow() expects exactly 2 arguments, 1 given +ArgumentCountError: pow() expects exactly 2 arguments, 1 given -- with language construct -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation14.phpt b/ext/standard/tests/array/array_map_variation14.phpt index d8977e73acd4..b29a7164bea9 100644 --- a/ext/standard/tests/array/array_map_variation14.phpt +++ b/ext/standard/tests/array/array_map_variation14.phpt @@ -34,14 +34,14 @@ echo "-- with empty string --\n"; try { var_dump( array_map("", $arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- with empty array --\n"; try { var_dump( array_map(array(), $arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -118,7 +118,7 @@ array(2) { int(2) } -- with empty string -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- with empty array -- -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members Done diff --git a/ext/standard/tests/array/array_map_variation15.phpt b/ext/standard/tests/array/array_map_variation15.phpt index d053a7204639..0052c57af641 100644 --- a/ext/standard/tests/array/array_map_variation15.phpt +++ b/ext/standard/tests/array/array_map_variation15.phpt @@ -16,12 +16,12 @@ $arr3 = array(1.1, 2.2); try { var_dump( array_map('non_existent', $arr1, $arr2, $arr3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_map() : non existent 'callback' function *** -array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "non_existent" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation16.phpt b/ext/standard/tests/array/array_map_variation16.phpt index 7ee1f04967c5..e895a87c1253 100644 --- a/ext/standard/tests/array/array_map_variation16.phpt +++ b/ext/standard/tests/array/array_map_variation16.phpt @@ -21,18 +21,18 @@ foreach($callbacks as $callback) try { var_dump( array_map($callback, $arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "Done"; ?> --EXPECT-- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name -array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "echo" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "array" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "empty" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "eval" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "isset" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "list" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "print" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_map_variation17.phpt b/ext/standard/tests/array/array_map_variation17.phpt index 751167baa04a..9ac42d73c647 100644 --- a/ext/standard/tests/array/array_map_variation17.phpt +++ b/ext/standard/tests/array/array_map_variation17.phpt @@ -65,7 +65,7 @@ for($count = 0; $count < count($unexpected_callbacks); $count++) { try { var_dump( array_map($unexpected_callbacks[$count], $arr1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -76,62 +76,62 @@ echo "Done"; *** Testing array_map() : unexpected values for 'callback' argument *** -- Iteration 1 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 2 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 3 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 4 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 5 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 6 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 7 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 8 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 9 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 10 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 11 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 12 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 13 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 14 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- Iteration 15 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, function "" not found or invalid function name -- Iteration 16 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, array callback must have exactly two members -- Iteration 17 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object -- Iteration 18 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, first array member is not a valid class name or object -- Iteration 19 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given -- Iteration 20 -- -array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given +TypeError: array_map(): Argument #1 ($callback) must be a valid callback or null, no array or string given Done diff --git a/ext/standard/tests/array/array_map_variation9.phpt b/ext/standard/tests/array/array_map_variation9.phpt index eb4d400aad48..f452bfb3eb2d 100644 --- a/ext/standard/tests/array/array_map_variation9.phpt +++ b/ext/standard/tests/array/array_map_variation9.phpt @@ -27,7 +27,7 @@ echo "-- checking binary safe array with two parameter callback function --\n"; try { var_dump( array_map(b"callback2", $arr1) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -46,5 +46,5 @@ array(4) { string(5) "22.22" } -- checking binary safe array with two parameter callback function -- -Exception: Too few arguments to function callback2(), 1 passed and exactly 2 expected +ArgumentCountError: Too few arguments to function callback2(), 1 passed and exactly 2 expected Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation1.phpt b/ext/standard/tests/array/array_merge_recursive_variation1.phpt index 121f7969d43c..9a9442c4e814 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation1.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation1.phpt @@ -90,7 +90,7 @@ foreach($arrays as $arr1) { try { var_dump( array_merge_recursive($arr1) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with more arguments @@ -98,7 +98,7 @@ foreach($arrays as $arr1) { try { var_dump( array_merge_recursive($arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; @@ -113,98 +113,98 @@ echo "Done"; *** Testing array_merge_recursive() : Passing non array values to $arr1 argument *** -- Iteration 1 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 2 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 3 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 4 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, int given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, int given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, int given -- Iteration 5 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 6 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 7 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 8 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 9 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, float given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, float given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, float given -- Iteration 10 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 11 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 12 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, true given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, true given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given -- Iteration 13 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, false given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, false given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given -- Iteration 14 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, true given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, true given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, true given -- Iteration 15 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, false given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, false given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, false given -- Iteration 16 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 17 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 18 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 19 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 20 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, string given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, string given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, string given -- Iteration 21 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 22 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, null given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, null given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, null given -- Iteration 23 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, resource given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, resource given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, resource given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, resource given -- Iteration 24 -- --- With default argument --array_merge_recursive(): Argument #1 must be of type array, A given --- With more arguments --array_merge_recursive(): Argument #1 must be of type array, A given +-- With default argument --TypeError: array_merge_recursive(): Argument #1 must be of type array, A given +-- With more arguments --TypeError: array_merge_recursive(): Argument #1 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_recursive_variation2.phpt b/ext/standard/tests/array/array_merge_recursive_variation2.phpt index 4588d8d160aa..c9252b79c54c 100644 --- a/ext/standard/tests/array/array_merge_recursive_variation2.phpt +++ b/ext/standard/tests/array/array_merge_recursive_variation2.phpt @@ -87,7 +87,7 @@ foreach($arrays as $arr2) { try { var_dump( array_merge_recursive($arr1, $arr2) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; } @@ -100,51 +100,51 @@ echo "Done"; --EXPECT-- *** Testing array_merge_recursive() : Passing non array values to $arr2 argument *** --- Iteration 1 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 1 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 2 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 2 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 3 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 3 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 4 --array_merge_recursive(): Argument #2 must be of type array, int given +-- Iteration 4 --TypeError: array_merge_recursive(): Argument #2 must be of type array, int given --- Iteration 5 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 5 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 6 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 6 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 7 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 7 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 8 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 8 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 9 --array_merge_recursive(): Argument #2 must be of type array, float given +-- Iteration 9 --TypeError: array_merge_recursive(): Argument #2 must be of type array, float given --- Iteration 10 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 10 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 11 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 11 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 12 --array_merge_recursive(): Argument #2 must be of type array, true given +-- Iteration 12 --TypeError: array_merge_recursive(): Argument #2 must be of type array, true given --- Iteration 13 --array_merge_recursive(): Argument #2 must be of type array, false given +-- Iteration 13 --TypeError: array_merge_recursive(): Argument #2 must be of type array, false given --- Iteration 14 --array_merge_recursive(): Argument #2 must be of type array, true given +-- Iteration 14 --TypeError: array_merge_recursive(): Argument #2 must be of type array, true given --- Iteration 15 --array_merge_recursive(): Argument #2 must be of type array, false given +-- Iteration 15 --TypeError: array_merge_recursive(): Argument #2 must be of type array, false given --- Iteration 16 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 16 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 17 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 17 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 18 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 18 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 19 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 19 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 20 --array_merge_recursive(): Argument #2 must be of type array, string given +-- Iteration 20 --TypeError: array_merge_recursive(): Argument #2 must be of type array, string given --- Iteration 21 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 21 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 22 --array_merge_recursive(): Argument #2 must be of type array, null given +-- Iteration 22 --TypeError: array_merge_recursive(): Argument #2 must be of type array, null given --- Iteration 23 --array_merge_recursive(): Argument #2 must be of type array, resource given +-- Iteration 23 --TypeError: array_merge_recursive(): Argument #2 must be of type array, resource given --- Iteration 24 --array_merge_recursive(): Argument #2 must be of type array, A given +-- Iteration 24 --TypeError: array_merge_recursive(): Argument #2 must be of type array, A given Done diff --git a/ext/standard/tests/array/array_merge_variation2.phpt b/ext/standard/tests/array/array_merge_variation2.phpt index 2ef55565742f..7901757f23aa 100644 --- a/ext/standard/tests/array/array_merge_variation2.phpt +++ b/ext/standard/tests/array/array_merge_variation2.phpt @@ -87,7 +87,7 @@ foreach($inputs as $input) { try { var_dump( array_merge($arr1, $input) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -100,55 +100,55 @@ echo "Done"; *** Testing array_merge() : usage variations *** -- Iteration 1 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 2 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 3 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 4 -- -array_merge(): Argument #2 must be of type array, int given +TypeError: array_merge(): Argument #2 must be of type array, int given -- Iteration 5 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 6 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 7 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 8 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 9 -- -array_merge(): Argument #2 must be of type array, float given +TypeError: array_merge(): Argument #2 must be of type array, float given -- Iteration 10 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 11 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 12 -- -array_merge(): Argument #2 must be of type array, true given +TypeError: array_merge(): Argument #2 must be of type array, true given -- Iteration 13 -- -array_merge(): Argument #2 must be of type array, false given +TypeError: array_merge(): Argument #2 must be of type array, false given -- Iteration 14 -- -array_merge(): Argument #2 must be of type array, true given +TypeError: array_merge(): Argument #2 must be of type array, true given -- Iteration 15 -- -array_merge(): Argument #2 must be of type array, false given +TypeError: array_merge(): Argument #2 must be of type array, false given -- Iteration 16 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 17 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 18 -- array(2) { @@ -159,23 +159,23 @@ array(2) { } -- Iteration 19 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 20 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 21 -- -array_merge(): Argument #2 must be of type array, string given +TypeError: array_merge(): Argument #2 must be of type array, string given -- Iteration 22 -- -array_merge(): Argument #2 must be of type array, classA given +TypeError: array_merge(): Argument #2 must be of type array, classA given -- Iteration 23 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 24 -- -array_merge(): Argument #2 must be of type array, null given +TypeError: array_merge(): Argument #2 must be of type array, null given -- Iteration 25 -- -array_merge(): Argument #2 must be of type array, resource given +TypeError: array_merge(): Argument #2 must be of type array, resource given Done diff --git a/ext/standard/tests/array/array_pad_too_large_padding.phpt b/ext/standard/tests/array/array_pad_too_large_padding.phpt index 3a45e834f9a0..d3b178a6fe91 100644 --- a/ext/standard/tests/array/array_pad_too_large_padding.phpt +++ b/ext/standard/tests/array/array_pad_too_large_padding.phpt @@ -7,7 +7,7 @@ function test($length) { try { var_dump(array_pad(array("", -1, 2.0), $length, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -16,5 +16,5 @@ test(PHP_INT_MAX); ?> --EXPECT-- -array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size -array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size +ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size +ValueError: array_pad(): Argument #2 ($length) must not exceed the maximum allowed array size diff --git a/ext/standard/tests/array/array_product_variation1.phpt b/ext/standard/tests/array/array_product_variation1.phpt index 330479f4ef8b..b84471f00fc4 100644 --- a/ext/standard/tests/array/array_product_variation1.phpt +++ b/ext/standard/tests/array/array_product_variation1.phpt @@ -53,4 +53,3 @@ array Warning: array_product(): Multiplication is not supported on type array in %s on line %d int(1) - diff --git a/ext/standard/tests/array/array_product_variation5.phpt b/ext/standard/tests/array/array_product_variation5.phpt index 525b6a52bd14..a0c237ff1fcb 100644 --- a/ext/standard/tests/array/array_product_variation5.phpt +++ b/ext/standard/tests/array/array_product_variation5.phpt @@ -11,7 +11,7 @@ echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry * $value, 1)); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -20,4 +20,4 @@ array_product() version: Warning: array_product(): Multiplication is not supported on type resource in %s on line %d int(30) array_reduce() version: -Unsupported operand types: int * resource +TypeError: Unsupported operand types: int * resource diff --git a/ext/standard/tests/array/array_push_error2.phpt b/ext/standard/tests/array/array_push_error2.phpt index 0ed0af6e1b4a..7ec7ba711086 100644 --- a/ext/standard/tests/array/array_push_error2.phpt +++ b/ext/standard/tests/array/array_push_error2.phpt @@ -13,14 +13,14 @@ $array = array(PHP_INT_MAX => 'max'); try { var_dump(array_push($array, 'new')); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($array); ?> --EXPECTF-- *** Testing array_push() : error conditions *** -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied array(1) { [%d]=> string(3) "max" diff --git a/ext/standard/tests/array/array_rand.phpt b/ext/standard/tests/array/array_rand.phpt index 24f6966bb085..d9351d070527 100644 --- a/ext/standard/tests/array/array_rand.phpt +++ b/ext/standard/tests/array/array_rand.phpt @@ -6,31 +6,31 @@ array_rand() tests try { var_dump(array_rand(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(), 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_rand(array(1,2,3), 10)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(array_rand(array(1,2,3), 3)); @@ -38,11 +38,11 @@ var_dump(array_rand(array(1,2,3), 2)); ?> --EXPECTF-- -array_rand(): Argument #1 ($array) must not be empty -array_rand(): Argument #1 ($array) must not be empty -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #1 ($array) must not be empty +ValueError: array_rand(): Argument #1 ($array) must not be empty +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) array(3) { [0]=> int(%d) diff --git a/ext/standard/tests/array/array_rand_variation5.phpt b/ext/standard/tests/array/array_rand_variation5.phpt index 57f5ee03af99..3b20ee8c3aef 100644 --- a/ext/standard/tests/array/array_rand_variation5.phpt +++ b/ext/standard/tests/array/array_rand_variation5.phpt @@ -29,28 +29,28 @@ echo"\n-- With num_req = 0 --\n"; try { var_dump( array_rand($input, 0) ); // with $num_req=0 } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req = -1 --\n"; try { var_dump( array_rand($input, -1) ); // with $num_req=-1 } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req = -2 --\n"; try { var_dump( array_rand($input, -2) ); // with $num_req=-2 } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- With num_req more than number of members in 'input' array --\n"; try { var_dump( array_rand($input, 13) ); // with $num_req=13 } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -64,13 +64,13 @@ int(%d) int(%d) -- With num_req = 0 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -1 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req = -2 -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) -- With num_req more than number of members in 'input' array -- -array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) +ValueError: array_rand(): Argument #2 ($num) must be between 1 and the number of elements in argument #1 ($array) diff --git a/ext/standard/tests/array/array_reduce_variation1.phpt b/ext/standard/tests/array/array_reduce_variation1.phpt index d1b6bf204d68..84dc3d4f8e1b 100644 --- a/ext/standard/tests/array/array_reduce_variation1.phpt +++ b/ext/standard/tests/array/array_reduce_variation1.phpt @@ -22,7 +22,7 @@ echo "\n--- Testing with a callback with too many parameters ---\n"; try { var_dump(array_reduce($array, "threeArgs", 2)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -33,4 +33,4 @@ try { int(2) --- Testing with a callback with too many parameters --- -Exception: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function threeArgs(), 2 passed and exactly 3 expected diff --git a/ext/standard/tests/array/array_search_variation3.phpt b/ext/standard/tests/array/array_search_variation3.phpt index 36a405175e22..ca70b29aecec 100644 --- a/ext/standard/tests/array/array_search_variation3.phpt +++ b/ext/standard/tests/array/array_search_variation3.phpt @@ -30,13 +30,13 @@ $array_search_obj = new array_search_check(); //creating new object try { var_dump( array_search("array_var", $array_search_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //error: as wrong datatype for second argument try { var_dump( array_search("foo", $array_search_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //element found as "one" exists in array $array_var var_dump( array_search("one", $array_search_obj->array_var) ); @@ -50,7 +50,7 @@ string(5) "three" int(5) *** Testing objects with array_search() *** -array_search(): Argument #2 ($haystack) must be of type array, array_search_check given -array_search(): Argument #2 ($haystack) must be of type array, array_search_check given +TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given +TypeError: array_search(): Argument #2 ($haystack) must be of type array, array_search_check given int(1) Done diff --git a/ext/standard/tests/array/array_slice_variation1.phpt b/ext/standard/tests/array/array_slice_variation1.phpt index b1d80d3f5229..59c7caf8e2c1 100644 --- a/ext/standard/tests/array/array_slice_variation1.phpt +++ b/ext/standard/tests/array/array_slice_variation1.phpt @@ -18,12 +18,12 @@ $a = 'foo'; try { var_dump(array_slice(range(1, 3), 0, $a)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_slice(range(1, 3), 0, $a)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); @@ -61,6 +61,6 @@ array(1) { [2]=> int(3) } -array_slice(): Argument #3 ($length) must be of type ?int, string given -array_slice(): Argument #3 ($length) must be of type ?int, string given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given +TypeError: array_slice(): Argument #3 ($length) must be of type ?int, string given string(3) "foo" diff --git a/ext/standard/tests/array/array_sum_variation8.phpt b/ext/standard/tests/array/array_sum_variation8.phpt index 017b1b8b44b1..c405c22881a8 100644 --- a/ext/standard/tests/array/array_sum_variation8.phpt +++ b/ext/standard/tests/array/array_sum_variation8.phpt @@ -11,7 +11,7 @@ echo "array_reduce() version:\n"; try { var_dump(array_reduce($input, fn($carry, $value) => $carry + $value, 0)); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- @@ -20,4 +20,4 @@ array_sum() version: Warning: array_sum(): Addition is not supported on type resource in %s on line %d int(13) array_reduce() version: -Unsupported operand types: int + resource +TypeError: Unsupported operand types: int + resource diff --git a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt index 3cc54bdc4e78..99ad1072d0cc 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_assoc($value, $array2, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_assoc() : usage variation *** --int 0-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_assoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt index 9e5c796484ae..22817325ad0b 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_assoc($array1, $value, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_assoc() : usage variation *** --int 0-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int 1-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int 12345-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --int -12345-- -array_udiff_assoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --float .5-- -array_udiff_assoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff_assoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff_assoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff_assoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff_assoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --string DQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --string SQ-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --heredoc-- -array_udiff_assoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff_assoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_assoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given --unset var-- -array_udiff_assoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt index ea63891067f8..a5144564a840 100644 --- a/ext/standard/tests/array/array_udiff_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_assoc_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -40,7 +40,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(1) { diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt index 4bf85a3c2098..3df03b686d48 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation1.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_uassoc($value, $array2, $data_comp_func, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_uassoc() : usage variation *** --int 0-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt index 765e159bab54..eae666b02e9f 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation2.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff_uassoc($array1, $value, $data_comp_func, $key_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff_uassoc() : usage variation *** --int 0-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_udiff_uassoc(): Argument #2 must be of type array, int given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_udiff_uassoc(): Argument #2 must be of type array, float given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff_uassoc(): Argument #2 must be of type array, true given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff_uassoc(): Argument #2 must be of type array, false given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_udiff_uassoc(): Argument #2 must be of type array, string given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_udiff_uassoc(): Argument #2 must be of type array, null given +TypeError: array_udiff_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt index 90e3af153339..468ffd7504eb 100644 --- a/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_udiff_uassoc_variation6.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -40,7 +40,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(1) { diff --git a/ext/standard/tests/array/array_udiff_variation1.phpt b/ext/standard/tests/array/array_udiff_variation1.phpt index 59cfca596864..51083bdd929e 100644 --- a/ext/standard/tests/array/array_udiff_variation1.phpt +++ b/ext/standard/tests/array/array_udiff_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff($value, $array2, $data_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff() : usage variation *** --int 0-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int 1-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_udiff(): Argument #1 ($array) must be of type array, int given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --float .5-- -array_udiff(): Argument #1 ($array) must be of type array, float given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_udiff(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_udiff(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_udiff(): Argument #1 ($array) must be of type array, true given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_udiff(): Argument #1 ($array) must be of type array, false given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_udiff(): Argument #1 ($array) must be of type array, string given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given --unset var-- -array_udiff(): Argument #1 ($array) must be of type array, null given +TypeError: array_udiff(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation2.phpt b/ext/standard/tests/array/array_udiff_variation2.phpt index 6637692e0b25..6a0e78c6ca3b 100644 --- a/ext/standard/tests/array/array_udiff_variation2.phpt +++ b/ext/standard/tests/array/array_udiff_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_udiff($array1, $value, $data_comp_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_udiff() : usage variation *** --int 0-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int 1-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int 12345-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --int -12345-- -array_udiff(): Argument #2 must be of type array, int given +TypeError: array_udiff(): Argument #2 must be of type array, int given --float 10.5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float -10.5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --float .5-- -array_udiff(): Argument #2 must be of type array, float given +TypeError: array_udiff(): Argument #2 must be of type array, float given --uppercase NULL-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --lowercase null-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --lowercase true-- -array_udiff(): Argument #2 must be of type array, true given +TypeError: array_udiff(): Argument #2 must be of type array, true given --lowercase false-- -array_udiff(): Argument #2 must be of type array, false given +TypeError: array_udiff(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_udiff(): Argument #2 must be of type array, true given +TypeError: array_udiff(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_udiff(): Argument #2 must be of type array, false given +TypeError: array_udiff(): Argument #2 must be of type array, false given --empty string DQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --empty string SQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --string DQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --string SQ-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --mixed case string-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --heredoc-- -array_udiff(): Argument #2 must be of type array, string given +TypeError: array_udiff(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_udiff(): Argument #2 must be of type array, classWithToString given +TypeError: array_udiff(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_udiff(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_udiff(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given --unset var-- -array_udiff(): Argument #2 must be of type array, null given +TypeError: array_udiff(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_udiff_variation5.phpt b/ext/standard/tests/array/array_udiff_variation5.phpt index ee5ad82d677e..c789ca645987 100644 --- a/ext/standard/tests/array/array_udiff_variation5.phpt +++ b/ext/standard/tests/array/array_udiff_variation5.phpt @@ -21,7 +21,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_udiff($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -41,7 +41,7 @@ array(1) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt index 64e21a30d1ae..33b13323f89a 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_assoc($value, $array2, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_assoc() : usage variation *** --int 0-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt index 4078bec27dcc..a57de7a78d08 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_assoc($array1, $value, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_assoc() : usage variation *** --int 0-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int 1-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect_assoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --float .5-- -array_uintersect_assoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect_assoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect_assoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect_assoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect_assoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_assoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given --unset var-- -array_uintersect_assoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_assoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt index ed71142170d3..9386afeeee73 100644 --- a/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_assoc_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect_assoc($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,9 +38,8 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { } - diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt index 651e78e62855..3dc679d1bd13 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation1.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_uassoc($value, $array2, $data_compare_func, $key_compare_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_uassoc() : usage variation *** --int 0-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt index e01d3b4e9572..42d0cadb59d1 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation2.phpt @@ -90,7 +90,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect_uassoc($array1, $value, $data_compare_func, $key_compare_func) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -99,76 +99,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect_uassoc() : usage variation *** --int 0-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int 1-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect_uassoc(): Argument #2 must be of type array, int given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --float .5-- -array_uintersect_uassoc(): Argument #2 must be of type array, float given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect_uassoc(): Argument #2 must be of type array, true given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect_uassoc(): Argument #2 must be of type array, false given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect_uassoc(): Argument #2 must be of type array, string given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect_uassoc(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect_uassoc(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given --unset var-- -array_uintersect_uassoc(): Argument #2 must be of type array, null given +TypeError: array_uintersect_uassoc(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt index 7574bc119f7e..2199f7b00279 100644 --- a/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt +++ b/ext/standard/tests/array/array_uintersect_uassoc_variation6.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect_uassoc($arr1, $arr2, 'too_many_parameters', 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,7 +38,7 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { diff --git a/ext/standard/tests/array/array_uintersect_variation1.phpt b/ext/standard/tests/array/array_uintersect_variation1.phpt index 390fc6137401..841cfdb48b27 100644 --- a/ext/standard/tests/array/array_uintersect_variation1.phpt +++ b/ext/standard/tests/array/array_uintersect_variation1.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect($value, $array2, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect() : usage variation *** --int 0-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int 1-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int 12345-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --int -12345-- -array_uintersect(): Argument #1 ($array) must be of type array, int given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, int given --float 10.5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float -10.5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float 12.3456789000e10-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float -12.3456789000e10-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --float .5-- -array_uintersect(): Argument #1 ($array) must be of type array, float given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, float given --uppercase NULL-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --lowercase null-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --lowercase true-- -array_uintersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, true given --lowercase false-- -array_uintersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, false given --uppercase TRUE-- -array_uintersect(): Argument #1 ($array) must be of type array, true given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, true given --uppercase FALSE-- -array_uintersect(): Argument #1 ($array) must be of type array, false given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, false given --empty string DQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --empty string SQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --string DQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --string SQ-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --mixed case string-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --heredoc-- -array_uintersect(): Argument #1 ($array) must be of type array, string given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #1 ($array) must be of type array, classWithToString given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #1 ($array) must be of type array, classWithoutToString given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, classWithoutToString given --undefined var-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given --unset var-- -array_uintersect(): Argument #1 ($array) must be of type array, null given +TypeError: array_uintersect(): Argument #1 ($array) must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation2.phpt b/ext/standard/tests/array/array_uintersect_variation2.phpt index ca3a4bff3a90..3ee9b95fc39d 100644 --- a/ext/standard/tests/array/array_uintersect_variation2.phpt +++ b/ext/standard/tests/array/array_uintersect_variation2.phpt @@ -89,7 +89,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_uintersect($array1, $value, $data_compare_function) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -98,76 +98,76 @@ foreach($inputs as $key =>$value) { *** Testing array_uintersect() : usage variation *** --int 0-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int 1-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int 12345-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --int -12345-- -array_uintersect(): Argument #2 must be of type array, int given +TypeError: array_uintersect(): Argument #2 must be of type array, int given --float 10.5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float -10.5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float 12.3456789000e10-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float -12.3456789000e10-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --float .5-- -array_uintersect(): Argument #2 must be of type array, float given +TypeError: array_uintersect(): Argument #2 must be of type array, float given --uppercase NULL-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --lowercase null-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --lowercase true-- -array_uintersect(): Argument #2 must be of type array, true given +TypeError: array_uintersect(): Argument #2 must be of type array, true given --lowercase false-- -array_uintersect(): Argument #2 must be of type array, false given +TypeError: array_uintersect(): Argument #2 must be of type array, false given --uppercase TRUE-- -array_uintersect(): Argument #2 must be of type array, true given +TypeError: array_uintersect(): Argument #2 must be of type array, true given --uppercase FALSE-- -array_uintersect(): Argument #2 must be of type array, false given +TypeError: array_uintersect(): Argument #2 must be of type array, false given --empty string DQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --empty string SQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --string DQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --string SQ-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --mixed case string-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --heredoc-- -array_uintersect(): Argument #2 must be of type array, string given +TypeError: array_uintersect(): Argument #2 must be of type array, string given --instance of classWithToString-- -array_uintersect(): Argument #2 must be of type array, classWithToString given +TypeError: array_uintersect(): Argument #2 must be of type array, classWithToString given --instance of classWithoutToString-- -array_uintersect(): Argument #2 must be of type array, classWithoutToString given +TypeError: array_uintersect(): Argument #2 must be of type array, classWithoutToString given --undefined var-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given --unset var-- -array_uintersect(): Argument #2 must be of type array, null given +TypeError: array_uintersect(): Argument #2 must be of type array, null given diff --git a/ext/standard/tests/array/array_uintersect_variation5.phpt b/ext/standard/tests/array/array_uintersect_variation5.phpt index 836bb80cc268..f95184011125 100644 --- a/ext/standard/tests/array/array_uintersect_variation5.phpt +++ b/ext/standard/tests/array/array_uintersect_variation5.phpt @@ -20,7 +20,7 @@ function too_many_parameters ($val1, $val2, $val3) { try { var_dump(array_uintersect($arr1, $arr2, 'too_many_parameters')); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- comparison function taking too few parameters --\n"; @@ -38,9 +38,8 @@ array(0) { } -- comparison function taking too many parameters -- -Exception: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function too_many_parameters(), 2 passed and exactly 3 expected -- comparison function taking too few parameters -- array(0) { } - diff --git a/ext/standard/tests/array/array_walk/array_walk.phpt b/ext/standard/tests/array/array_walk/array_walk.phpt index 151c9c70d043..d4383c2b1bee 100644 --- a/ext/standard/tests/array/array_walk/array_walk.phpt +++ b/ext/standard/tests/array/array_walk/array_walk.phpt @@ -19,7 +19,7 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -32,5 +32,5 @@ int(2) int(1) string(4) "data" bool(true) -string(4) "data" +Exception: data Done diff --git a/ext/standard/tests/array/array_walk/array_walk_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_error2.phpt index 57b082db95af..d537953a3db6 100644 --- a/ext/standard/tests/array/array_walk/array_walk_error2.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_error2.phpt @@ -20,41 +20,41 @@ echo "*** Testing array_walk() : error conditions - callback parameters ***\n"; try { var_dump( array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // expected: Warning is suppressed try { var_dump( @array_walk($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( @array_walk($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing array_walk() function with too many callback parameters --\n"; try { var_dump( array_walk($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_walk() : error conditions - callback parameters *** -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk() function with too many callback parameters -- -Exception: array_walk() expects at most 3 arguments, 4 given +ArgumentCountError: array_walk() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_objects.phpt index 44b5b27e51e8..09535005ce2b 100644 --- a/ext/standard/tests/array/array_walk/array_walk_objects.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_objects.phpt @@ -27,7 +27,7 @@ $var = ""; try { array_walk($var, "walk"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -43,5 +43,5 @@ string(10) "%r\0%r*%r\0%rvar_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" -array_walk(): Argument #1 ($array) must be of type array, string given +TypeError: array_walk(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt index 91a97437d217..491175f23bf3 100644 --- a/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_rec_objects.phpt @@ -27,7 +27,7 @@ $var = ""; try { array_walk_recursive($var, "walk"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -43,5 +43,5 @@ string(10) "%0*%0var_pro" string(14) "test_protected" string(7) "var_pub" string(11) "test_public" -array_walk_recursive(): Argument #1 ($array) must be of type array, string given +TypeError: array_walk_recursive(): Argument #1 ($array) must be of type array, string given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt index d4d3e7d8eb26..f0b23b4be97d 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive1.phpt @@ -19,7 +19,7 @@ function foo2($v1, $v2, $v3) { try { var_dump(array_walk_recursive($var,"foo2", "data")); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -38,5 +38,5 @@ int(3) int(1) string(4) "data" bool(true) -string(4) "data" +Exception: data Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt index fa5161e5c1bd..44e59692e669 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive_error2.phpt @@ -20,41 +20,41 @@ echo "*** Testing array_walk_recursive() : error conditions - callback parameter try { var_dump( array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // expected: Warning is suppressed try { var_dump( @array_walk_recursive($input, "callback1") ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( @array_walk_recursive($input, "callback2", 4) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing array_walk_recursive() function with too many callback parameters --\n"; try { var_dump( array_walk_recursive($input, "callback1", 20, 10) ); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECT-- *** Testing array_walk_recursive() : error conditions - callback parameters *** -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected -Exception: Too few arguments to function callback1(), 2 passed and exactly 3 expected -Exception: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected +ArgumentCountError: Too few arguments to function callback1(), 2 passed and exactly 3 expected +ArgumentCountError: Too few arguments to function callback2(), 3 passed and exactly 4 expected -- Testing array_walk_recursive() function with too many callback parameters -- -Exception: array_walk_recursive() expects at most 3 arguments, 4 given +ArgumentCountError: array_walk_recursive() expects at most 3 arguments, 4 given Done diff --git a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt index aafa158d6c73..ccd5f63f4e74 100644 --- a/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_recursive_variation8.phpt @@ -23,7 +23,7 @@ echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk_recursive($input, "echo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -35,5 +35,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- -array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name +TypeError: array_walk_recursive(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt index a4dae8a7e184..d3b3a556c149 100644 --- a/ext/standard/tests/array/array_walk/array_walk_variation8.phpt +++ b/ext/standard/tests/array/array_walk/array_walk_variation8.phpt @@ -23,7 +23,7 @@ echo "-- With 'echo' language construct --\n"; try { var_dump( array_walk($input, "echo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done" @@ -35,5 +35,5 @@ bool(true) -- With 'min' built-in function -- bool(true) -- With 'echo' language construct -- -array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name +TypeError: array_walk(): Argument #2 ($callback) must be a valid callback, function "echo" not found or invalid function name Done diff --git a/ext/standard/tests/array/array_walk/bug30266.phpt b/ext/standard/tests/array/array_walk/bug30266.phpt index 2579714ae70f..dd3f18ac455e 100644 --- a/ext/standard/tests/array/array_walk/bug30266.phpt +++ b/ext/standard/tests/array/array_walk/bug30266.phpt @@ -28,8 +28,8 @@ try } catch(Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Caught: Error +Exception: Error diff --git a/ext/standard/tests/array/array_walk/bug70713.phpt b/ext/standard/tests/array/array_walk/bug70713.phpt index fab1661e84e0..4c11dc644b5c 100644 --- a/ext/standard/tests/array/array_walk/bug70713.phpt +++ b/ext/standard/tests/array/array_walk/bug70713.phpt @@ -23,9 +23,9 @@ $arr = array('string' => new obj); try { array_walk_recursive($arr, 'settype'); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Iterated value is no longer an array or object +TypeError: Iterated value is no longer an array or object diff --git a/ext/standard/tests/array/array_walk/bug79839.phpt b/ext/standard/tests/array/array_walk/bug79839.phpt index 643604cb9b20..d717c311d8d8 100644 --- a/ext/standard/tests/array/array_walk/bug79839.phpt +++ b/ext/standard/tests/array/array_walk/bug79839.phpt @@ -13,13 +13,13 @@ try { $ref = []; // Should throw }); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test); ?> --EXPECT-- -Cannot assign array to reference held by property Test::$prop of type int +TypeError: Cannot assign array to reference held by property Test::$prop of type int object(Test)#1 (1) { ["prop"]=> int(42) diff --git a/ext/standard/tests/array/bug40191.phpt b/ext/standard/tests/array/bug40191.phpt index c1a0d6b6c367..3a7f146b533c 100644 --- a/ext/standard/tests/array/bug40191.phpt +++ b/ext/standard/tests/array/bug40191.phpt @@ -11,11 +11,11 @@ $arrObj->append('foo'); try { $arr = array_unique($arrObj); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -array_unique(): Argument #1 ($array) must be of type array, ArrayObject given +TypeError: array_unique(): Argument #1 ($array) must be of type array, ArrayObject given Done diff --git a/ext/standard/tests/array/bug42177.phpt b/ext/standard/tests/array/bug42177.phpt index dc5297b30204..e0671b51d4f4 100644 --- a/ext/standard/tests/array/bug42177.phpt +++ b/ext/standard/tests/array/bug42177.phpt @@ -21,7 +21,7 @@ $a1 = array_merge_recursive( $a1, $a2 ); try { $a1 = array_merge_recursive( $a1, $a2 ); } catch (\Error $e) { - echo $e->getMessage() . " on line " . $e->getLine() . "\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } unset( $a1, $a2 ); @@ -35,4 +35,4 @@ unset( $a1, $a2 ); ?> --EXPECT-- -Recursion detected on line 19 +Error: Recursion detected on line 19 diff --git a/ext/standard/tests/array/bug43495.phpt b/ext/standard/tests/array/bug43495.phpt index 37c4f6b604ba..9e2dc106d5f1 100644 --- a/ext/standard/tests/array/bug43495.phpt +++ b/ext/standard/tests/array/bug43495.phpt @@ -12,7 +12,7 @@ $b["key1"]["key2"]["key3"]=&$b; try { array_merge_recursive($a,$b); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Break recursion */ @@ -21,4 +21,4 @@ $b["key1"]["key2"]["key3"] = null; ?> --EXPECT-- -Recursion detected +Error: Recursion detected diff --git a/ext/standard/tests/array/bug61058.phpt b/ext/standard/tests/array/bug61058.phpt index 6e78b357117e..687b0b7e2d39 100644 --- a/ext/standard/tests/array/bug61058.phpt +++ b/ext/standard/tests/array/bug61058.phpt @@ -6,8 +6,8 @@ Bug #61058 (array_fill leaks if start index is PHP_INT_MAX) try { array_fill(PHP_INT_MAX, 2, '*'); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot add element to the array as the next element is already occupied +Error: Cannot add element to the array as the next element is already occupied diff --git a/ext/standard/tests/array/bug65251.phpt b/ext/standard/tests/array/bug65251.phpt index 6d9cded21c84..5a22ce8dc302 100644 --- a/ext/standard/tests/array/bug65251.phpt +++ b/ext/standard/tests/array/bug65251.phpt @@ -7,7 +7,7 @@ Bug #65251: array_merge_recursive() recursion detection broken try { array_merge_recursive($GLOBALS, $GLOBALS); } catch (\Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/array/bug68553.phpt b/ext/standard/tests/array/bug68553.phpt index d309171096c9..462285d49cfa 100644 --- a/ext/standard/tests/array/bug68553.phpt +++ b/ext/standard/tests/array/bug68553.phpt @@ -25,12 +25,12 @@ var_dump(array_column($a, null, 'a')); try { var_dump(array_column([['a' => new stdClass]], null, 'a')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(array_column([['a' => []]], null, 'a')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -83,5 +83,5 @@ array(8) { NULL } } -Cannot access offset of type stdClass on array -Cannot access offset of type array on array +TypeError: Cannot access offset of type stdClass on array +TypeError: Cannot access offset of type array on array diff --git a/ext/standard/tests/array/bug71220.phpt b/ext/standard/tests/array/bug71220.phpt index 5c5f43eeea89..ad2df75d830f 100644 --- a/ext/standard/tests/array/bug71220.phpt +++ b/ext/standard/tests/array/bug71220.phpt @@ -6,8 +6,8 @@ ob_start("compact"); try { ob_end_clean(); } catch (\Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Cannot call compact() dynamically +Error: Cannot call compact() dynamically diff --git a/ext/standard/tests/array/bug74345.phpt b/ext/standard/tests/array/bug74345.phpt index 64942f126e7b..fb8d8f41074f 100644 --- a/ext/standard/tests/array/bug74345.phpt +++ b/ext/standard/tests/array/bug74345.phpt @@ -16,12 +16,12 @@ array_map($cb, [], []); try { array_map($cb, null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map($cb, null, null); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } array_filter([], $cb); array_reduce([], $cb); @@ -34,13 +34,13 @@ usort($array, $cb); try { preg_replace_callback('/./', $cb, new stdClass); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ===DONE=== --EXPECT-- -array_map(): Argument #2 ($array) must be of type array, null given -array_map(): Argument #2 ($array) must be of type array, null given -preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given +TypeError: array_map(): Argument #2 ($array) must be of type array, null given +TypeError: preg_replace_callback(): Argument #3 ($subject) must be of type array|string, stdClass given ===DONE=== diff --git a/ext/standard/tests/array/bug77135.phpt b/ext/standard/tests/array/bug77135.phpt index 0b23d6276626..ba559103a900 100644 --- a/ext/standard/tests/array/bug77135.phpt +++ b/ext/standard/tests/array/bug77135.phpt @@ -37,7 +37,7 @@ class Extract echo " \$this = " . get_class($this) . "\n"; echo " \$v_this = " . (isset($x_this) ? $x_this : "NULL") . "\n"; } catch (\Throwable $e) { - echo " Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -47,8 +47,8 @@ class Extract ?> --EXPECT-- EXTR_OVERWRITE - Exception: Cannot re-assign $this - Exception: Cannot re-assign $this +Error: Cannot re-assign $this +Error: Cannot re-assign $this EXTR_SKIP extract() = 0 diff --git a/ext/standard/tests/array/bug77931.phpt b/ext/standard/tests/array/bug77931.phpt index d876d4b01c6a..abdd0690efc0 100644 --- a/ext/standard/tests/array/bug77931.phpt +++ b/ext/standard/tests/array/bug77931.phpt @@ -6,21 +6,21 @@ Bug #77931: Warning for array_map mentions wrong type try { array_map('trim', array(), 1); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), true); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { array_map('trim', array(), array(), array(), null); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -array_map(): Argument #3 must be of type array, int given -array_map(): Argument #4 must be of type array, true given -array_map(): Argument #5 must be of type array, null given +TypeError: array_map(): Argument #3 must be of type array, int given +TypeError: array_map(): Argument #4 must be of type array, true given +TypeError: array_map(): Argument #5 must be of type array, null given diff --git a/ext/standard/tests/array/compact_variation1.phpt b/ext/standard/tests/array/compact_variation1.phpt index afc290ed6246..6464219bdfaa 100644 --- a/ext/standard/tests/array/compact_variation1.phpt +++ b/ext/standard/tests/array/compact_variation1.phpt @@ -19,13 +19,13 @@ $arr3 = array(&$string); try { var_dump(compact($arr1)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(compact($arr2)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(compact($arr3)); @@ -33,8 +33,8 @@ var_dump(compact($arr3)); ?> --EXPECT-- *** Testing compact() : usage variations - arrays containing references *** -Recursion detected -Recursion detected +Error: Recursion detected +Error: Recursion detected array(1) { ["c"]=> int(3) diff --git a/ext/standard/tests/array/count_invalid.phpt b/ext/standard/tests/array/count_invalid.phpt index d05c6a1961ee..83420e5f4eff 100644 --- a/ext/standard/tests/array/count_invalid.phpt +++ b/ext/standard/tests/array/count_invalid.phpt @@ -7,49 +7,49 @@ try { $result = count(null); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count("string"); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(123); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(true); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count(false); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $result = count((object) []); var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -count(): Argument #1 ($value) must be of type Countable|array, null given -count(): Argument #1 ($value) must be of type Countable|array, string given -count(): Argument #1 ($value) must be of type Countable|array, int given -count(): Argument #1 ($value) must be of type Countable|array, true given -count(): Argument #1 ($value) must be of type Countable|array, false given -count(): Argument #1 ($value) must be of type Countable|array, stdClass given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, string given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, int given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, true given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, false given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, stdClass given diff --git a/ext/standard/tests/array/count_invalid_mode.phpt b/ext/standard/tests/array/count_invalid_mode.phpt index be39690e856b..2e71b4676f8d 100644 --- a/ext/standard/tests/array/count_invalid_mode.phpt +++ b/ext/standard/tests/array/count_invalid_mode.phpt @@ -18,7 +18,7 @@ foreach ($modes as $mode) { try { var_dump(count([], $mode)); } catch (\ValueError $error) { - echo $error->getMessage() . \PHP_EOL; + echo $error::class, ': ', $error->getMessage(), PHP_EOL; } } ?> @@ -27,7 +27,7 @@ int(0) int(0) int(0) int(0) -count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE -count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE +ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE +ValueError: count(): Argument #2 ($mode) must be either COUNT_NORMAL or COUNT_RECURSIVE int(0) int(0) diff --git a/ext/standard/tests/array/extract_error.phpt b/ext/standard/tests/array/extract_error.phpt index f2b0cfa69c7e..c0f14f0b2af4 100644 --- a/ext/standard/tests/array/extract_error.phpt +++ b/ext/standard/tests/array/extract_error.phpt @@ -12,25 +12,25 @@ $arr = array(1); try { var_dump( extract($arr, -1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( extract($arr, 7 , "wddr") ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Two Arguments, second as prefix but without prefix string as third argument */ try { var_dump( extract($arr,EXTR_PREFIX_IF_EXISTS) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing Error Conditions *** -extract(): Argument #2 ($flags) must be a valid extract type -extract(): Argument #2 ($flags) must be a valid extract type -extract(): Argument #3 ($prefix) is required when using this extract type +ValueError: extract(): Argument #2 ($flags) must be a valid extract type +ValueError: extract(): Argument #2 ($flags) must be a valid extract type +ValueError: extract(): Argument #3 ($prefix) is required when using this extract type diff --git a/ext/standard/tests/array/extract_error_variation1.phpt b/ext/standard/tests/array/extract_error_variation1.phpt index a8fe2fa85007..5dbd855f0b02 100644 --- a/ext/standard/tests/array/extract_error_variation1.phpt +++ b/ext/standard/tests/array/extract_error_variation1.phpt @@ -7,8 +7,8 @@ $a = ["1" => "one", "2" => "two", "3" => "three", "4" => "four", "5" => "five"]; try { extract($a, EXTR_PREFIX_ALL, '85bogus'); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -extract(): Argument #3 ($prefix) must be a valid identifier +ValueError: extract(): Argument #3 ($prefix) must be a valid identifier diff --git a/ext/standard/tests/array/extract_typed_ref.phpt b/ext/standard/tests/array/extract_typed_ref.phpt index 6d2a5a9272d7..450297454d80 100644 --- a/ext/standard/tests/array/extract_typed_ref.phpt +++ b/ext/standard/tests/array/extract_typed_ref.phpt @@ -13,11 +13,11 @@ $i =& $test->i; $s =& $test->s; try { extract(['i' => 'foo', 's' => 42]); -} catch (TypeError $e) { echo $e->getMessage(), "\n"; } +} catch (TypeError $e) { echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->i, $test->s); ?> --EXPECT-- -Cannot assign string to reference held by property Test::$i of type int +TypeError: Cannot assign string to reference held by property Test::$i of type int int(0) string(0) "" diff --git a/ext/standard/tests/array/gh14775.phpt b/ext/standard/tests/array/gh14775.phpt index df4db76031ec..d2ca5aa6de0b 100644 --- a/ext/standard/tests/array/gh14775.phpt +++ b/ext/standard/tests/array/gh14775.phpt @@ -6,7 +6,7 @@ $var = -PHP_INT_MAX - 1; try { range($var,1,$var); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } --EXPECTF-- -range(): Argument #3 ($step) must be greater than %s +ValueError: range(): Argument #3 ($step) must be greater than %s diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt index f5e538122f41..0cf665405429 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_add_elements.phpt @@ -15,8 +15,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt index 1874ddad8934..28d0e321b3cb 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_array_deallocated.phpt @@ -15,8 +15,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt index 8ad4133300ec..74bb0ad50455 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_complex_modification.phpt @@ -18,8 +18,8 @@ try { array_splice($arr, 1, 1, ["replacement"]); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt index 9e2c6cf8fc71..dcca8fe9c125 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_multiple_destructors.phpt @@ -24,10 +24,10 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Destructor 1 called Destructor 2 called -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt index dcfa8f2e759c..ececeb34e665 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_original_case.phpt @@ -22,9 +22,9 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: Returning a value from a destructor is deprecated in %s on line %d -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt index bd8f511b6253..2590e37260ce 100644 --- a/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_uaf_packed_to_hash.phpt @@ -16,8 +16,8 @@ try { array_splice($arr, 1, 2); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt index 8754a913a24e..a9071dfd25fd 100644 --- a/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt +++ b/ext/standard/tests/array/gh16649/array_splice_with_replacement.phpt @@ -16,8 +16,8 @@ try { array_splice($arr, 1, 1, $replacement); echo "ERROR: Should have thrown exception\n"; } catch (Error $e) { - echo "Exception caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Exception caught: Array was modified during array_splice operation +Error: Array was modified during array_splice operation diff --git a/ext/standard/tests/array/gh19300_2.phpt b/ext/standard/tests/array/gh19300_2.phpt index 41ae7e82bb79..942fc743c8a3 100644 --- a/ext/standard/tests/array/gh19300_2.phpt +++ b/ext/standard/tests/array/gh19300_2.phpt @@ -7,7 +7,7 @@ function error_handle($level, $message, $file = '', $line = 0){ try { array_multisort($a, SORT_ASC); // Trigger multisort abort } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } set_error_handler('error_handle'); @@ -22,10 +22,10 @@ var_dump(array_multisort($inputs, SORT_NUMERIC)); var_dump($inputs); ?> --EXPECT-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag bool(true) array(3) { [0]=> diff --git a/ext/standard/tests/array/gh20043.phpt b/ext/standard/tests/array/gh20043.phpt index d5c7e06417f1..f0010a297e50 100644 --- a/ext/standard/tests/array/gh20043.phpt +++ b/ext/standard/tests/array/gh20043.phpt @@ -5,8 +5,8 @@ GH-20043 (array_unique assertion failure with RC1 array causing an exception on try { array_unique([new stdClass, new stdClass], SORT_STRING | SORT_FLAG_CASE); } catch (Error $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/standard/tests/array/gh22678.phpt b/ext/standard/tests/array/gh22678.phpt index c1b71b592520..b09ef21d737c 100644 --- a/ext/standard/tests/array/gh22678.phpt +++ b/ext/standard/tests/array/gh22678.phpt @@ -39,7 +39,7 @@ $c = [new Boom(), new Boom()]; try { array_multisort($c, SORT_STRING); } catch (Exception $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/array/in_array/in_array_variation3.phpt b/ext/standard/tests/array/in_array/in_array_variation3.phpt index 95617e945f38..6b98d8ea0573 100644 --- a/ext/standard/tests/array/in_array/in_array_variation3.phpt +++ b/ext/standard/tests/array/in_array/in_array_variation3.phpt @@ -32,13 +32,13 @@ $in_array_obj = new in_array_check(); //creating new object try { var_dump( in_array("array_var", $in_array_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //error: as wrong datatype for second argument try { var_dump( in_array("foo", $in_array_obj) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } //element found as "one" exists in array $array_var var_dump( in_array("one", $in_array_obj->array_var) ); @@ -52,7 +52,7 @@ bool(true) bool(true) *** Testing objects with in_array() *** -in_array(): Argument #2 ($haystack) must be of type array, in_array_check given -in_array(): Argument #2 ($haystack) must be of type array, in_array_check given +TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given +TypeError: in_array(): Argument #2 ($haystack) must be of type array, in_array_check given bool(true) Done diff --git a/ext/standard/tests/array/max.phpt b/ext/standard/tests/array/max.phpt index 065461001690..bfca2ddc16f4 100644 --- a/ext/standard/tests/array/max.phpt +++ b/ext/standard/tests/array/max.phpt @@ -8,19 +8,19 @@ precision=14 try { var_dump(max(1)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(max(new stdclass)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(max(2,1,2)); @@ -33,9 +33,9 @@ var_dump(max(0, true, false, true)); ?> --EXPECT-- -max(): Argument #1 ($value) must be of type array, int given -max(): Argument #1 ($value) must contain at least one element -max(): Argument #1 ($value) must be of type array, stdClass given +TypeError: max(): Argument #1 ($value) must be of type array, int given +ValueError: max(): Argument #1 ($value) must contain at least one element +TypeError: max(): Argument #1 ($value) must be of type array, stdClass given int(2) float(2.11) string(1) "t" diff --git a/ext/standard/tests/array/min.phpt b/ext/standard/tests/array/min.phpt index 97be4ad6828e..47f4b4aac83d 100644 --- a/ext/standard/tests/array/min.phpt +++ b/ext/standard/tests/array/min.phpt @@ -8,19 +8,19 @@ precision=14 try { var_dump(min(1)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(array())); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(min(new stdclass)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(min(2,1,2)); @@ -33,9 +33,9 @@ var_dump(min(0, true, false, true)); ?> --EXPECT-- -min(): Argument #1 ($value) must be of type array, int given -min(): Argument #1 ($value) must contain at least one element -min(): Argument #1 ($value) must be of type array, stdClass given +TypeError: min(): Argument #1 ($value) must be of type array, int given +ValueError: min(): Argument #1 ($value) must contain at least one element +TypeError: min(): Argument #1 ($value) must be of type array, stdClass given int(1) float(2.09) string(0) "" diff --git a/ext/standard/tests/array/range/range_bug70239_0.phpt b/ext/standard/tests/array/range/range_bug70239_0.phpt index 52f046a7e473..9df7e5114abd 100644 --- a/ext/standard/tests/array/range/range_bug70239_0.phpt +++ b/ext/standard/tests/array/range/range_bug70239_0.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { range(0, pow(2.0, 100000000)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -range(): Argument #2 ($end) must be a finite number, INF provided +ValueError: range(): Argument #2 ($end) must be a finite number, INF provided diff --git a/ext/standard/tests/array/range/range_bug70239_1.phpt b/ext/standard/tests/array/range/range_bug70239_1.phpt index 681d594a74dc..6553a88eca09 100644 --- a/ext/standard/tests/array/range/range_bug70239_1.phpt +++ b/ext/standard/tests/array/range/range_bug70239_1.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { range(pow(2.0, 100000000), pow(2.0, 100000000) + 1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -range(): Argument #1 ($start) must be a finite number, INF provided +ValueError: range(): Argument #1 ($start) must be a finite number, INF provided diff --git a/ext/standard/tests/array/range/range_bug70239_2.phpt b/ext/standard/tests/array/range/range_bug70239_2.phpt index b20f360dba18..b0f4d13da7fa 100644 --- a/ext/standard/tests/array/range/range_bug70239_2.phpt +++ b/ext/standard/tests/array/range/range_bug70239_2.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { var_dump(range(0, PHP_INT_MAX)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %d elements: start=0, end=%d, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_bug70239_3.phpt b/ext/standard/tests/array/range/range_bug70239_3.phpt index 6307927438df..a9958f50b461 100644 --- a/ext/standard/tests/array/range/range_bug70239_3.phpt +++ b/ext/standard/tests/array/range/range_bug70239_3.phpt @@ -5,8 +5,8 @@ Bug #70239 Creating a huge array doesn't result in exhausted, but segfault, var try { var_dump(range(PHP_INT_MIN, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=0, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt index cbfd2e914413..08518c51529b 100644 --- a/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt +++ b/ext/standard/tests/array/range/range_inputs_float_NAN_values.phpt @@ -29,7 +29,7 @@ foreach ($fs as $s) { try { var_dump( range($s, $e) ); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -40,35 +40,35 @@ float(NAN) float(NAN) float(NAN) range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, NAN); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(NAN, 5.5); -range(): Argument #1 ($start) must be a finite number, NAN provided +ValueError: range(): Argument #1 ($start) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, NAN); -range(): Argument #2 ($end) must be a finite number, NAN provided +ValueError: range(): Argument #2 ($end) must be a finite number, NAN provided range(5.5, 5.5); array(1) { [0]=> diff --git a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt index 41ae4ef995bf..f81873df051d 100644 --- a/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt +++ b/ext/standard/tests/array/range/range_inputs_float_small_step_exhaustion.phpt @@ -5,14 +5,14 @@ Creating a range that exceeds the maximum array size try { var_dump(range(0, 100_000_000_000, 0.1)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(range(PHP_INT_MIN, PHP_INT_MAX, 1)); } catch (\ValueError $e) { - echo $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d -The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d. +ValueError: The supplied range exceeds the maximum array size by %f elements: start=0.0, end=%f, step=0.1. Max size: %d +ValueError: The supplied range exceeds the maximum array size by %d elements: start=-%d, end=%d, step=1. Calculated size: %d. Maximum size: %d. diff --git a/ext/standard/tests/array/range/range_step_errors.phpt b/ext/standard/tests/array/range/range_step_errors.phpt index e950c527863e..2dcc48353fb0 100644 --- a/ext/standard/tests/array/range/range_step_errors.phpt +++ b/ext/standard/tests/array/range/range_step_errors.phpt @@ -8,54 +8,54 @@ echo "Step cannot be 0\n"; try { var_dump( range(1.0, 7.0, 0.0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 0.0) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step cannot be INF\n"; try { var_dump( range(1.0, 7.0, 10.0**400) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, 10.0**400) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', 10.0**400) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step cannot be NAN\n"; try { var_dump( range(1.0, 7.0, fdiv(0, 0)) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range(1, 7, fdiv(0, 0)) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( range('A', 'H', fdiv(0, 0)) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step must be within the range of input parameters\n"; @@ -63,72 +63,72 @@ echo "-- Testing ( (low < high) && (high-low < step) ) --\n"; try { var_dump( range(1.0, 7.0, 6.5) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low > high) && (low-high < step) ) --\n"; try { var_dump( range(7.0, 1.0, 6.5) ); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low < high) && (high-low < step) ) for characters --\n"; try { var_dump(range('a', 'z', 100)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- Testing ( (low > high) && (low-high < step) ) for characters --\n"; try { var_dump(range('z', 'a', 100)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Step must not be negative for increasing ranges\n"; try { var_dump(range('a', 'c', -1)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1, 3, -1)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(range(1.5, 3.5, -1.5)); } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Step cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 -range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 +ValueError: range(): Argument #3 ($step) cannot be 0 Step cannot be INF -range(): Argument #3 ($step) must be a finite number, INF provided -range(): Argument #3 ($step) must be a finite number, INF provided -range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided +ValueError: range(): Argument #3 ($step) must be a finite number, INF provided Step cannot be NAN -range(): Argument #3 ($step) must be a finite number, NAN provided -range(): Argument #3 ($step) must be a finite number, NAN provided -range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided +ValueError: range(): Argument #3 ($step) must be a finite number, NAN provided Step must be within the range of input parameters -- Testing ( (low < high) && (high-low < step) ) -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low > high) && (low-high < step) ) -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low < high) && (high-low < step) ) for characters -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) -- Testing ( (low > high) && (low-high < step) ) for characters -- -range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) +ValueError: range(): Argument #3 ($step) must be less than the range spanned by argument #1 ($start) and argument #2 ($end) Step must not be negative for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges -range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges +ValueError: range(): Argument #3 ($step) must be greater than 0 for increasing ranges diff --git a/ext/standard/tests/array/sizeof_object2.phpt b/ext/standard/tests/array/sizeof_object2.phpt index 115283d66130..363a253bf9c4 100644 --- a/ext/standard/tests/array/sizeof_object2.phpt +++ b/ext/standard/tests/array/sizeof_object2.phpt @@ -77,21 +77,21 @@ for($i = 0; $i < count($objects); $i++) try { var_dump( sizeof($var) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "COUNT_NORMAL Mode: "; try { var_dump( sizeof($var, COUNT_NORMAL) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "COUNT_RECURSIVE Mode: "; try { var_dump( sizeof($var, COUNT_RECURSIVE) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $counter++; @@ -103,23 +103,23 @@ echo "Done"; *** Testing sizeof() : object functionality *** --- Testing sizeof() with objects which doesn't implement Countable interface --- -- Iteration 1 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test given -- Iteration 2 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test1 given -- Iteration 3 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, test2 given -- Iteration 4 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, child_test2 given -- Iteration 5 -- -Default Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given -COUNT_NORMAL Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given -COUNT_RECURSIVE Mode: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +Default Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +COUNT_NORMAL Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given +COUNT_RECURSIVE Mode: TypeError: sizeof(): Argument #1 ($value) must be of type Countable|array, concrete_class given Done diff --git a/ext/standard/tests/array/sort/array_multisort_error.phpt b/ext/standard/tests/array/sort/array_multisort_error.phpt index 4f2d979f71d2..33a7060e48c1 100644 --- a/ext/standard/tests/array/sort/array_multisort_error.phpt +++ b/ext/standard/tests/array/sort/array_multisort_error.phpt @@ -9,7 +9,7 @@ $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_ASC, SORT_ASC) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing array_multisort() function with repeated flags --\n"; @@ -17,7 +17,7 @@ $ar1 = array(1); try { var_dump( array_multisort($ar1, SORT_STRING, SORT_NUMERIC) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,7 +25,7 @@ try { *** Testing array_multisort() : error conditions *** -- Testing array_multisort() function with repeated flags -- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified -- Testing array_multisort() function with repeated flags -- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified diff --git a/ext/standard/tests/array/sort/array_multisort_variation1.phpt b/ext/standard/tests/array/sort/array_multisort_variation1.phpt index c6cb286231e4..e47127a071c4 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation1.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation1.phpt @@ -94,7 +94,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($value)); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,76 +103,76 @@ foreach($inputs as $key =>$value) { *** Testing array_multisort() : usage variation *** --int 0-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 1-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag that has not already been specified --int 12345-- -array_multisort(): Argument #1 ($array) must be a valid sort flag +ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag --int -12345-- -array_multisort(): Argument #1 ($array) must be a valid sort flag +ValueError: array_multisort(): Argument #1 ($array) must be a valid sort flag --float 10.5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --float .5-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase NULL-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --string DQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --string SQ-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --heredoc-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --undefined var-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag --unset var-- -array_multisort(): Argument #1 ($array) must be an array or a sort flag +TypeError: array_multisort(): Argument #1 ($array) must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/array_multisort_variation2.phpt b/ext/standard/tests/array/sort/array_multisort_variation2.phpt index b491b87bfda8..fe4a9bcbba5f 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation2.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation2.phpt @@ -102,7 +102,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($ar1, $value) ); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -117,82 +117,82 @@ bool(true) bool(true) --int 12345-- -array_multisort(): Argument #2 must be a valid sort flag +ValueError: array_multisort(): Argument #2 must be a valid sort flag --int -12345-- -array_multisort(): Argument #2 must be a valid sort flag +ValueError: array_multisort(): Argument #2 must be a valid sort flag --float 10.5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --float .5-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty array-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --int indexed array-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --associative array-- bool(true) --nested arrays-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent --uppercase NULL-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --string DQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --string SQ-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --heredoc-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --undefined var-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag --unset var-- -array_multisort(): Argument #2 must be an array or a sort flag +TypeError: array_multisort(): Argument #2 must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/array_multisort_variation3.phpt b/ext/standard/tests/array/sort/array_multisort_variation3.phpt index 71f837acd865..b06d445dfe8b 100644 --- a/ext/standard/tests/array/sort/array_multisort_variation3.phpt +++ b/ext/standard/tests/array/sort/array_multisort_variation3.phpt @@ -94,7 +94,7 @@ foreach($inputs as $key =>$value) { try { var_dump( array_multisort($ar1, SORT_REGULAR, $value) ); } catch (\ValueError | \TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -103,76 +103,76 @@ foreach($inputs as $key =>$value) { *** Testing array_multisort() : usage variation *** --int 0-- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified --int 1-- -array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified +TypeError: array_multisort(): Argument #3 must be an array or a sort flag that has not already been specified --int 12345-- -array_multisort(): Argument #3 must be a valid sort flag +ValueError: array_multisort(): Argument #3 must be a valid sort flag --int -12345-- -array_multisort(): Argument #3 must be a valid sort flag +ValueError: array_multisort(): Argument #3 must be a valid sort flag --float 10.5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float -10.5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float 12.3456789000e10-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float -12.3456789000e10-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --float .5-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase NULL-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase null-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase true-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --lowercase false-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase TRUE-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --uppercase FALSE-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --empty string DQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --empty string SQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --string DQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --string SQ-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --mixed case string-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --heredoc-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --instance of classWithToString-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --instance of classWithoutToString-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --undefined var-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag --unset var-- -array_multisort(): Argument #3 must be an array or a sort flag +TypeError: array_multisort(): Argument #3 must be an array or a sort flag diff --git a/ext/standard/tests/array/sort/asort_variation5.phpt b/ext/standard/tests/array/sort/asort_variation5.phpt index d5a8930f090c..766832a3a551 100644 --- a/ext/standard/tests/array/sort/asort_variation5.phpt +++ b/ext/standard/tests/array/sort/asort_variation5.phpt @@ -118,4 +118,4 @@ array(12) { string(2) "ww" ["x"]=> string(1) "x" -} \ No newline at end of file +} diff --git a/ext/standard/tests/array/sort/bug77395.phpt b/ext/standard/tests/array/sort/bug77395.phpt index a4a79f5e2f54..800af618d32e 100644 --- a/ext/standard/tests/array/sort/bug77395.phpt +++ b/ext/standard/tests/array/sort/bug77395.phpt @@ -14,8 +14,8 @@ $data = [['aa'=> 'bb',], ['aa'=> 'bb',],]; try { array_multisort(array_column($data, 'bb'),SORT_DESC, $data); // PHP Warning error } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Array sizes are inconsistent +ValueError: Array sizes are inconsistent diff --git a/ext/standard/tests/assert/assert_basic6.phpt b/ext/standard/tests/assert/assert_basic6.phpt index b531425912c2..417388c15139 100644 --- a/ext/standard/tests/assert/assert_basic6.phpt +++ b/ext/standard/tests/assert/assert_basic6.phpt @@ -16,7 +16,7 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); } catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n"; @@ -27,7 +27,7 @@ var_dump(assert_options(ASSERT_CALLBACK)); try { assert(false); } catch (AssertionError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -41,7 +41,7 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d string(2) "f1" foo -assert(false) +AssertionError: assert(false) Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options() is deprecated in %s on line %d @@ -52,4 +52,4 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d NULL -assert(false) +AssertionError: assert(false) diff --git a/ext/standard/tests/assert/assert_options_error.phpt b/ext/standard/tests/assert/assert_options_error.phpt index d3b055e65f9a..7d3f2469f925 100644 --- a/ext/standard/tests/assert/assert_options_error.phpt +++ b/ext/standard/tests/assert/assert_options_error.phpt @@ -6,9 +6,9 @@ assert_options() - unknown assert option. try { assert_options(1000); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d -assert_options(): Argument #1 ($option) must be an ASSERT_* constant +ValueError: assert_options(): Argument #1 ($option) must be an ASSERT_* constant diff --git a/ext/standard/tests/assert/assert_variation.phpt b/ext/standard/tests/assert/assert_variation.phpt index 6824f7246d5b..1e5c92e25a85 100644 --- a/ext/standard/tests/assert/assert_variation.phpt +++ b/ext/standard/tests/assert/assert_variation.phpt @@ -54,7 +54,7 @@ echo "ini.get(\"assert.callback\") => [".ini_get("assert.callback")."]\n"; try { var_dump($r2=assert(0 != 0)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n"; @@ -133,7 +133,7 @@ Deprecated: Constant ASSERT_CALLBACK is deprecated since 8.3, as assert_options( Deprecated: Function assert_options() is deprecated since 8.3 in %s on line %d assert_options(ASSERT_CALLBACK) => [c1] ini.get("assert.callback") => [f2] -Invalid callback c1, function "c1" not found or invalid function name +Error: Invalid callback c1, function "c1" not found or invalid function name Reset callback options to use a class method diff --git a/ext/standard/tests/assert/gh22290.phpt b/ext/standard/tests/assert/gh22290.phpt index e519a60f5572..4759f89dd21a 100644 --- a/ext/standard/tests/assert/gh22290.phpt +++ b/ext/standard/tests/assert/gh22290.phpt @@ -10,30 +10,30 @@ try { $string = "Foo\x00bar"; assert(!str_contains($string, "\x00")); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(["a\x00b" => 1] === []); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert("tab\there" === ""); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(str_contains("plain", "zzz")); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(!str_contains($string, "\000")) -assert(["a\000b" => 1] === []) -assert("tab\there" === '') -assert(str_contains('plain', 'zzz')) +AssertionError: assert(!str_contains($string, "\000")) +AssertionError: assert(["a\000b" => 1] === []) +AssertionError: assert("tab\there" === '') +AssertionError: assert(str_contains('plain', 'zzz')) diff --git a/ext/standard/tests/assert/gh22291.phpt b/ext/standard/tests/assert/gh22291.phpt index a50bd5861f05..b1883c6488ab 100644 --- a/ext/standard/tests/assert/gh22291.phpt +++ b/ext/standard/tests/assert/gh22291.phpt @@ -9,11 +9,11 @@ try { var_dump("{$foo}"); assert(!"{{$foo}}"); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- string(5) "{abc}" string(3) "abc" -assert(!"{{$foo}}") +AssertionError: assert(!"{{$foo}}") diff --git a/ext/standard/tests/assert/gh22292.phpt b/ext/standard/tests/assert/gh22292.phpt index e3aa72bf231a..44555d19b8a0 100644 --- a/ext/standard/tests/assert/gh22292.phpt +++ b/ext/standard/tests/assert/gh22292.phpt @@ -12,7 +12,7 @@ try { var_dump(${'---'}); assert(!${'---'}); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { @@ -20,12 +20,12 @@ try { var_dump($f->{'---'}); assert(!$f->{'---'}); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- string(3) "abc" -assert(!${'---'}) +AssertionError: assert(!${'---'}) string(3) "---" -assert(!$f->{'---'}) +AssertionError: assert(!$f->{'---'}) diff --git a/ext/standard/tests/assert/gh22373.phpt b/ext/standard/tests/assert/gh22373.phpt index 8c26f77f490b..4c35de7a6b9f 100644 --- a/ext/standard/tests/assert/gh22373.phpt +++ b/ext/standard/tests/assert/gh22373.phpt @@ -12,17 +12,17 @@ class Foo { try { assert(($this->f)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(($this?->f)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert((self::$sf)('abc') !== 'cba'); } catch (Error $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -31,6 +31,6 @@ new Foo(); ?> --EXPECT-- -assert(($this->f)('abc') !== 'cba') -assert(($this?->f)('abc') !== 'cba') -assert((self::$sf)('abc') !== 'cba') +AssertionError: assert(($this->f)('abc') !== 'cba') +AssertionError: assert(($this?->f)('abc') !== 'cba') +AssertionError: assert((self::$sf)('abc') !== 'cba') diff --git a/ext/standard/tests/assert/gh22387.phpt b/ext/standard/tests/assert/gh22387.phpt index 38c93921608a..abd0938a4b40 100644 --- a/ext/standard/tests/assert/gh22387.phpt +++ b/ext/standard/tests/assert/gh22387.phpt @@ -19,44 +19,44 @@ const baz = new stdClass(); try { assert(!$foo instanceof (bar)); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!new (bar)()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::m()); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::$p); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert(!(bar)::C); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { assert((baz)::class !== 'stdClass'); } catch (AssertionError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -assert(!$foo instanceof (bar)) -assert(!new (bar)()) -assert(!(bar)::m()) -assert(!(bar)::$p) -assert(!(bar)::C) -assert((baz)::class !== 'stdClass') +AssertionError: assert(!$foo instanceof (bar)) +AssertionError: assert(!new (bar)()) +AssertionError: assert(!(bar)::m()) +AssertionError: assert(!(bar)::$p) +AssertionError: assert(!(bar)::C) +AssertionError: assert((baz)::class !== 'stdClass') diff --git a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt index bee28f54422d..b7a52bb65249 100644 --- a/ext/standard/tests/class_object/get_class_methods_basic_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_basic_001.phpt @@ -28,7 +28,7 @@ echo "Argument is non existent class:\n"; try { var_dump( get_class_methods("NonExistent") ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done"; @@ -57,5 +57,5 @@ Argument is name of class which has no methods: array(0) { } Argument is non existent class: -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Done diff --git a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt index f7b86a2977ac..0026212f0878 100644 --- a/ext/standard/tests/class_object/get_class_methods_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_methods_variation_001.phpt @@ -73,7 +73,7 @@ foreach($values as $value) { try { var_dump( get_class_methods($value) ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } echo "Done"; @@ -84,89 +84,89 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 12345 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value -2345 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 10.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value -10.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 101234567000 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 1.07654321E-9 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 0.5 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value 1 -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value stdClass array(0) { } Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_class_methods(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Done diff --git a/ext/standard/tests/class_object/get_class_variation_001.phpt b/ext/standard/tests/class_object/get_class_variation_001.phpt index 09f995c21fb6..2c2854259802 100644 --- a/ext/standard/tests/class_object/get_class_variation_001.phpt +++ b/ext/standard/tests/class_object/get_class_variation_001.phpt @@ -65,7 +65,7 @@ foreach($values as $value) { try { var_dump( get_class($value) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } }; @@ -79,80 +79,80 @@ Warning: Undefined variable $undefined_var in %s on line %d Warning: Undefined variable $unset_var in %s on line %d Arg value: 0 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 1 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 12345 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: -2345 (type: integer) -get_class(): Argument #1 ($object) must be of type object, int given +TypeError: get_class(): Argument #1 ($object) must be of type object, int given Arg value: 10.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: -10.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 101234567000 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 1.07654321E-9 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: 0.5 (type: double) -get_class(): Argument #1 ($object) must be of type object, float given +TypeError: get_class(): Argument #1 ($object) must be of type object, float given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: Array (type: array) -get_class(): Argument #1 ($object) must be of type object, array given +TypeError: get_class(): Argument #1 ($object) must be of type object, array given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: 1 (type: boolean) -get_class(): Argument #1 ($object) must be of type object, true given +TypeError: get_class(): Argument #1 ($object) must be of type object, true given Arg value: (type: boolean) -get_class(): Argument #1 ($object) must be of type object, false given +TypeError: get_class(): Argument #1 ($object) must be of type object, false given Arg value: 1 (type: boolean) -get_class(): Argument #1 ($object) must be of type object, true given +TypeError: get_class(): Argument #1 ($object) must be of type object, true given Arg value: (type: boolean) -get_class(): Argument #1 ($object) must be of type object, false given +TypeError: get_class(): Argument #1 ($object) must be of type object, false given Arg value: (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: string (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: string (type: string) -get_class(): Argument #1 ($object) must be of type object, string given +TypeError: get_class(): Argument #1 ($object) must be of type object, string given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Arg value: (type: NULL) -get_class(): Argument #1 ($object) must be of type object, null given +TypeError: get_class(): Argument #1 ($object) must be of type object, null given Done diff --git a/ext/standard/tests/class_object/get_parent_class_variation_002.phpt b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt index 8faeff9dd8dc..bcfe4581f72c 100644 --- a/ext/standard/tests/class_object/get_parent_class_variation_002.phpt +++ b/ext/standard/tests/class_object/get_parent_class_variation_002.phpt @@ -75,7 +75,7 @@ foreach ($values as $value) { try { var_dump(get_parent_class($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -87,90 +87,90 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 12345 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value -2345 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, int given Arg value 10.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value -10.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 101234567000 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 1.07654321E-9 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Arg value 0.5 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, float given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Error: 2 - Array to string conversion Arg value Array -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, array given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value 1 -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, true given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, false given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value string In autoload(string) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value String In autoload(String) -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, string given Arg value stdClass bool(false) Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Arg value -get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given +TypeError: get_parent_class(): Argument #1 ($object_or_class) must be an object or a valid class name, null given Done diff --git a/ext/standard/tests/class_object/method_exists_variation_001.phpt b/ext/standard/tests/class_object/method_exists_variation_001.phpt index d45d2652d11c..ab445e8f73a8 100644 --- a/ext/standard/tests/class_object/method_exists_variation_001.phpt +++ b/ext/standard/tests/class_object/method_exists_variation_001.phpt @@ -75,7 +75,7 @@ foreach($values as $value) { try { var_dump( method_exists($value, $method) ); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } }; @@ -87,69 +87,69 @@ Error: 2 - Undefined variable $undefined_var Error: 2 - Undefined variable $unset_var Arg value 0 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 12345 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value -2345 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, int given Arg value 10.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value -10.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 101234567000 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 1.07654321E-9 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Arg value 0.5 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, float given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Error: 2 - Array to string conversion Arg value Array -method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, array given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given Arg value 1 -method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, true given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, false given Arg value bool(false) @@ -166,8 +166,8 @@ In autoload(String) bool(false) Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Arg value -method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given +TypeError: method_exists(): Argument #1 ($object_or_class) must be of type object|string, null given Done diff --git a/ext/standard/tests/class_object/property_exists_error.phpt b/ext/standard/tests/class_object/property_exists_error.phpt index 3d8927882c60..fd8c5cde0e6a 100644 --- a/ext/standard/tests/class_object/property_exists_error.phpt +++ b/ext/standard/tests/class_object/property_exists_error.phpt @@ -10,7 +10,7 @@ $property_name = 'string_val'; try { var_dump( property_exists(10, $property_name) ); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -18,4 +18,4 @@ try { *** Testing property_exists() : error conditions *** -- Testing property_exists() function with incorrect arguments -- -property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given +TypeError: property_exists(): Argument #1 ($object_or_class) must be of type object|string, int given diff --git a/ext/standard/tests/constant_with_typed_class_constant.phpt b/ext/standard/tests/constant_with_typed_class_constant.phpt index 87a1c006426d..298488c0fd33 100644 --- a/ext/standard/tests/constant_with_typed_class_constant.phpt +++ b/ext/standard/tests/constant_with_typed_class_constant.phpt @@ -15,11 +15,11 @@ var_dump(constant("FOO::CONST1")); try { constant("FOO::CONST2"); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- object(stdClass)#1 (0) { } -Cannot assign stdClass to class constant Foo::CONST2 of type array +TypeError: Cannot assign stdClass to class constant Foo::CONST2 of type array diff --git a/ext/standard/tests/dir/bug41693.phpt b/ext/standard/tests/dir/bug41693.phpt index 05722b9558d2..931d1a76a063 100644 --- a/ext/standard/tests/dir/bug41693.phpt +++ b/ext/standard/tests/dir/bug41693.phpt @@ -6,9 +6,9 @@ Bug #41693 (scandir() allows empty directory names) try { var_dump(scandir('')); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -scandir(): Argument #1 ($directory) must not be empty +ValueError: scandir(): Argument #1 ($directory) must not be empty diff --git a/ext/standard/tests/dir/closedir_variation2.phpt b/ext/standard/tests/dir/closedir_variation2.phpt index 7898c9ae0ff1..88d71d45cf9f 100644 --- a/ext/standard/tests/dir/closedir_variation2.phpt +++ b/ext/standard/tests/dir/closedir_variation2.phpt @@ -23,7 +23,7 @@ echo "\n-- Close directory handle second time: --\n"; try { var_dump(closedir($dh)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Directory Handle: "; var_dump($dh); @@ -41,5 +41,5 @@ NULL Directory Handle: resource(%d) of type (Unknown) -- Close directory handle second time: -- -closedir(): Argument #1 ($dir_handle) must be an open stream resource +TypeError: closedir(): Argument #1 ($dir_handle) must be an open stream resource Directory Handle: resource(%d) of type (Unknown) diff --git a/ext/standard/tests/dir/closedir_variation3.phpt b/ext/standard/tests/dir/closedir_variation3.phpt index 053c8a947eb7..70987a7007d2 100644 --- a/ext/standard/tests/dir/closedir_variation3.phpt +++ b/ext/standard/tests/dir/closedir_variation3.phpt @@ -15,7 +15,7 @@ echo "\n-- Try to close the file pointer using closedir() --\n"; try { var_dump(closedir($fp)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Check file pointer: --\n"; var_dump($fp); @@ -31,7 +31,7 @@ if(is_resource($fp)) { resource(%d) of type (stream) -- Try to close the file pointer using closedir() -- -closedir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: closedir(): Argument #1 ($dir_handle) must be a valid Directory resource -- Check file pointer: -- resource(%d) of type (stream) diff --git a/ext/standard/tests/dir/closedir_without_arg.phpt b/ext/standard/tests/dir/closedir_without_arg.phpt index f248764ed2a6..e3d39d714912 100644 --- a/ext/standard/tests/dir/closedir_without_arg.phpt +++ b/ext/standard/tests/dir/closedir_without_arg.phpt @@ -5,9 +5,9 @@ Calling closedir() without argument and without opening a directory beforehand try { closedir(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: closedir(): Passing null is deprecated, instead the last opened directory stream should be provided in %s on line %d -No resource supplied +TypeError: No resource supplied diff --git a/ext/standard/tests/dir/dir_basic.phpt b/ext/standard/tests/dir/dir_basic.phpt index 17a2b42bcdae..5d9b7c0f81c1 100644 --- a/ext/standard/tests/dir/dir_basic.phpt +++ b/ext/standard/tests/dir/dir_basic.phpt @@ -36,7 +36,7 @@ echo "\nTest read after closing the dir:\n"; try { var_dump( $d->read() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // delete temp files @@ -79,5 +79,5 @@ object(Directory)#%d (2) { } Test read after closing the dir: -Directory::read(): cannot use Directory resource after it has been closed +TypeError: Directory::read(): cannot use Directory resource after it has been closed Done diff --git a/ext/standard/tests/dir/readdir_variation7.phpt b/ext/standard/tests/dir/readdir_variation7.phpt index b3e3d88ccd59..5e299366fc2e 100644 --- a/ext/standard/tests/dir/readdir_variation7.phpt +++ b/ext/standard/tests/dir/readdir_variation7.phpt @@ -13,11 +13,11 @@ var_dump($fp = fopen(__FILE__, "r")); try { var_dump( readdir($fp) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- *** Testing readdir() : usage variations *** resource(%d) of type (stream) -readdir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: readdir(): Argument #1 ($dir_handle) must be a valid Directory resource diff --git a/ext/standard/tests/dir/rewinddir_variation2.phpt b/ext/standard/tests/dir/rewinddir_variation2.phpt index 7ce3c522352d..6779c563c1ac 100644 --- a/ext/standard/tests/dir/rewinddir_variation2.phpt +++ b/ext/standard/tests/dir/rewinddir_variation2.phpt @@ -20,7 +20,7 @@ echo "\n-- Call to rewinddir() --\n"; try { var_dump(rewinddir($dir_handle)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -36,4 +36,4 @@ resource(%d) of type (stream) string(%d) "%s" -- Call to rewinddir() -- -rewinddir(): Argument #1 ($dir_handle) must be an open stream resource +TypeError: rewinddir(): Argument #1 ($dir_handle) must be an open stream resource diff --git a/ext/standard/tests/dir/rewinddir_variation3.phpt b/ext/standard/tests/dir/rewinddir_variation3.phpt index 21bddca1036a..79b1c9a562c4 100644 --- a/ext/standard/tests/dir/rewinddir_variation3.phpt +++ b/ext/standard/tests/dir/rewinddir_variation3.phpt @@ -16,7 +16,7 @@ $result1 = fread($fp, 5); try { var_dump(rewinddir($fp)); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $result2 = fread($fp, 5); @@ -32,7 +32,7 @@ if ($result1 === $result2) { -- Open a file using fopen -- resource(%d) of type (stream) -rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource +TypeError: rewinddir(): Argument #1 ($dir_handle) must be a valid Directory resource -- Check if rewinddir() has repositioned the file pointer -- rewinddir() does not work on file pointers diff --git a/ext/standard/tests/dir/scandir_invalid_flag.phpt b/ext/standard/tests/dir/scandir_invalid_flag.phpt index 76838dc869b8..3cb6f142bea5 100644 --- a/ext/standard/tests/dir/scandir_invalid_flag.phpt +++ b/ext/standard/tests/dir/scandir_invalid_flag.phpt @@ -5,8 +5,8 @@ Provide wrong flags to scandir() try { scandir('something', -1); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants +ValueError: scandir(): Argument #2 ($sorting_order) must be one of the SCANDIR_SORT_ASCENDING, SCANDIR_SORT_DESCENDING, or SCANDIR_SORT_NONE constants diff --git a/ext/standard/tests/file/006_variation2.phpt b/ext/standard/tests/file/006_variation2.phpt index 6b32f2246f12..7f07918d00dd 100644 --- a/ext/standard/tests/file/006_variation2.phpt +++ b/ext/standard/tests/file/006_variation2.phpt @@ -55,7 +55,7 @@ foreach($perms_array as $permission) { echo "\n"; clearstatcache(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -64,7 +64,7 @@ foreach($perms_array as $permission) { echo "\n"; clearstatcache(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -137,15 +137,15 @@ bool(true) bool(true) 43567 -- Iteration 12 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 13 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 14 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given -- Iteration 15 -- -chmod(): Argument #2 ($permissions) must be of type int, string given -chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given +TypeError: chmod(): Argument #2 ($permissions) must be of type int, string given *** Done *** diff --git a/ext/standard/tests/file/007_basic.phpt b/ext/standard/tests/file/007_basic.phpt index 6a0c918ea39c..12a9cd7ff258 100644 --- a/ext/standard/tests/file/007_basic.phpt +++ b/ext/standard/tests/file/007_basic.phpt @@ -43,12 +43,12 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -78,12 +78,12 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( feof($handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( $handle ); @@ -102,8 +102,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'wb' -- resource(%d) of type (stream) @@ -111,8 +111,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'wt' -- resource(%d) of type (stream) @@ -120,8 +120,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+' -- resource(%d) of type (stream) @@ -129,8 +129,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+b' -- resource(%d) of type (stream) @@ -138,8 +138,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'w+t' -- resource(%d) of type (stream) @@ -147,8 +147,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r' -- resource(%d) of type (stream) @@ -156,8 +156,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'rb' -- resource(%d) of type (stream) @@ -165,8 +165,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'rt' -- resource(%d) of type (stream) @@ -174,8 +174,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+' -- resource(%d) of type (stream) @@ -183,8 +183,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+b' -- resource(%d) of type (stream) @@ -192,8 +192,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'r+t' -- resource(%d) of type (stream) @@ -201,8 +201,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a' -- resource(%d) of type (stream) @@ -210,8 +210,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'ab' -- resource(%d) of type (stream) @@ -219,8 +219,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'at' -- resource(%d) of type (stream) @@ -228,8 +228,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+' -- resource(%d) of type (stream) @@ -237,8 +237,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+t' -- resource(%d) of type (stream) @@ -246,8 +246,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'a+b' -- resource(%d) of type (stream) @@ -255,8 +255,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource -- Iteration with mode 'x' -- resource(%d) of type (stream) @@ -264,8 +264,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xb' -- @@ -274,8 +274,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'xt' -- @@ -284,8 +284,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+' -- @@ -294,8 +294,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+b' -- @@ -304,8 +304,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) -- Iteration with mode 'x+t' -- @@ -314,8 +314,8 @@ int(0) bool(false) bool(true) resource(%d) of type (Unknown) -ftell(): Argument #1 ($stream) must be an open stream resource -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource resource(%d) of type (Unknown) *** Done *** diff --git a/ext/standard/tests/file/bug71882.phpt b/ext/standard/tests/file/bug71882.phpt index 68f98f19b6a8..594d1eda4d86 100644 --- a/ext/standard/tests/file/bug71882.phpt +++ b/ext/standard/tests/file/bug71882.phpt @@ -6,8 +6,8 @@ $fd = fopen("php://memory", "w+"); try { var_dump(ftruncate($fd, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/chgrp.phpt b/ext/standard/tests/file/chgrp.phpt index 1e4899e46574..94ce4ecb1594 100644 --- a/ext/standard/tests/file/chgrp.phpt +++ b/ext/standard/tests/file/chgrp.phpt @@ -10,7 +10,7 @@ if(substr(PHP_OS, 0, 3) == "WIN") try { chgrp("sjhgfskhagkfdgskjfhgskfsdgfkdsajf", 0); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/file/disk_free_space_variation.phpt b/ext/standard/tests/file/disk_free_space_variation.phpt index aaeae022af4b..c4edf529e30a 100644 --- a/ext/standard/tests/file/disk_free_space_variation.phpt +++ b/ext/standard/tests/file/disk_free_space_variation.phpt @@ -44,12 +44,12 @@ foreach($dirs_arr as $dir1) { try { var_dump( disk_free_space( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( diskfreespace( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -103,19 +103,19 @@ float(%f) float(%f) -- Iteration 9 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 10 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 11 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes -- Iteration 12 -- -disk_free_space(): Argument #1 ($directory) must not contain any null bytes -diskfreespace(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_free_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: diskfreespace(): Argument #1 ($directory) must not contain any null bytes --- Done --- diff --git a/ext/standard/tests/file/disk_total_space_variation.phpt b/ext/standard/tests/file/disk_total_space_variation.phpt index 25d7e5a1c7df..899b5b9abd52 100644 --- a/ext/standard/tests/file/disk_total_space_variation.phpt +++ b/ext/standard/tests/file/disk_total_space_variation.phpt @@ -47,7 +47,7 @@ foreach($dirs_arr as $dir1) { try { var_dump( disk_total_space( $dir1 ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } @@ -95,16 +95,16 @@ float(%f) float(%f) -- Iteration 9 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 10 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 11 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes -- Iteration 12 -- -disk_total_space(): Argument #1 ($directory) must not contain any null bytes +ValueError: disk_total_space(): Argument #1 ($directory) must not contain any null bytes *** Testing with Binary Input *** float(%s) diff --git a/ext/standard/tests/file/fclose_variation1.phpt b/ext/standard/tests/file/fclose_variation1.phpt index 56a6d4bd4c1c..8ddb1f48c42d 100644 --- a/ext/standard/tests/file/fclose_variation1.phpt +++ b/ext/standard/tests/file/fclose_variation1.phpt @@ -10,11 +10,11 @@ fclose($s); try { echo fread($s2, strlen("getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nDone.\n"; ?> --EXPECT-- -fread(): Argument #1 ($stream) must be an open stream resource +TypeError: fread(): Argument #1 ($stream) must be an open stream resource Done. diff --git a/ext/standard/tests/file/feof_basic.phpt b/ext/standard/tests/file/feof_basic.phpt index 943af213e39a..d8aeb52b8876 100644 --- a/ext/standard/tests/file/feof_basic.phpt +++ b/ext/standard/tests/file/feof_basic.phpt @@ -61,7 +61,7 @@ fclose($h); try { feof($h); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unlink($tmpFile1); unlink($tmpFile2); @@ -94,5 +94,5 @@ bool(false) *** testing feof after a seek passed the end *** bool(false) *** closing file, testing eof *** -feof(): Argument #1 ($stream) must be an open stream resource +TypeError: feof(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fgetc_variation2.phpt b/ext/standard/tests/file/fgetc_variation2.phpt index 89161d088190..44a2e7abe730 100644 --- a/ext/standard/tests/file/fgetc_variation2.phpt +++ b/ext/standard/tests/file/fgetc_variation2.phpt @@ -22,7 +22,7 @@ fclose($file_handle); try { var_dump( fgetc($file_handle) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -30,5 +30,5 @@ echo "Done"; --EXPECT-- *** Testing fgetc() : usage variations *** -- Testing fgetc() with closed handle -- -fgetc(): Argument #1 ($stream) must be an open stream resource +TypeError: fgetc(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fgetcsv_error_conditions.phpt b/ext/standard/tests/file/fgetcsv_error_conditions.phpt index 3c1353cb3c20..4745eabbc6f5 100644 --- a/ext/standard/tests/file/fgetcsv_error_conditions.phpt +++ b/ext/standard/tests/file/fgetcsv_error_conditions.phpt @@ -14,48 +14,48 @@ echo 'fgetcsv() with negative length' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, -10, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( fgetcsv($file_handle, -10, $delimiter, $enclosure, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'fgetcsv() with delimiter as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, '', $enclosure, escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'fgetcsv() with enclosure as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, $delimiter, '', escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'fgetcsv() with delimiter & enclosure as empty string' . \PHP_EOL; try { var_dump( fgetcsv($file_handle, $length, '', '', escape: "\\") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- fgetcsv() with negative length -fgetcsv(): Argument #2 ($length) must be between 0 and %d -fgetcsv(): Argument #2 ($length) must be between 0 and %d -fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d +ValueError: fgetcsv(): Argument #2 ($length) must be between 0 and %d fgetcsv() with delimiter as empty string -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character fgetcsv() with enclosure as empty string -fgetcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fgetcsv(): Argument #4 ($enclosure) must be a single character fgetcsv() with delimiter & enclosure as empty string -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character diff --git a/ext/standard/tests/file/fgetcsv_variation12.phpt b/ext/standard/tests/file/fgetcsv_variation12.phpt index b2297668e7bf..e4f06abe6c63 100644 --- a/ext/standard/tests/file/fgetcsv_variation12.phpt +++ b/ext/standard/tests/file/fgetcsv_variation12.phpt @@ -72,7 +72,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fgetcsv($file_handle, 1024, $del, $enc) ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and if eof var_dump( ftell($file_handle) ); @@ -91,362 +91,362 @@ echo "Done\n"; *** Testing fgetcsv() : with two chars as enclosure & delimiter *** -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgetcsv_variation19.phpt b/ext/standard/tests/file/fgetcsv_variation19.phpt index 0451e21447fe..15cd403f70a9 100644 --- a/ext/standard/tests/file/fgetcsv_variation19.phpt +++ b/ext/standard/tests/file/fgetcsv_variation19.phpt @@ -70,7 +70,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fgetcsv($file_handle, 1024, $del, escape: "\\") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and if eof var_dump( ftell($file_handle) ); @@ -89,377 +89,377 @@ echo "Done\n"; *** Testing fgetcsv() : with default enclosure & delimiter of two chars *** -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rb mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using rt mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using r+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using a+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using w+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+ mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+b mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) -- Testing fgetcsv() with file opened using x+t mode -- -fgetcsv(): Argument #3 ($separator) must be a single character +ValueError: fgetcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) Done diff --git a/ext/standard/tests/file/fgets_error.phpt b/ext/standard/tests/file/fgets_error.phpt index fefbd723bc58..071b14812f76 100644 --- a/ext/standard/tests/file/fgets_error.phpt +++ b/ext/standard/tests/file/fgets_error.phpt @@ -12,14 +12,14 @@ $len = 0; try { var_dump( fgets($fp, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $len = -10; try { var_dump( fgets($fp, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $len = 1; var_dump( fgets($fp, $len) ); // return length - 1 always, expect false @@ -28,6 +28,6 @@ var_dump( fgets($fp, $len) ); // return length - 1 always, expect false --EXPECT-- *** Testing error conditions *** -- Testing fgets() with invalid length arguments -- -fgets(): Argument #2 ($length) must be greater than 0 -fgets(): Argument #2 ($length) must be greater than 0 +ValueError: fgets(): Argument #2 ($length) must be greater than 0 +ValueError: fgets(): Argument #2 ($length) must be greater than 0 bool(false) diff --git a/ext/standard/tests/file/fgets_variation2.phpt b/ext/standard/tests/file/fgets_variation2.phpt index 5d262cde295b..00d7fd2ea03b 100644 --- a/ext/standard/tests/file/fgets_variation2.phpt +++ b/ext/standard/tests/file/fgets_variation2.phpt @@ -22,12 +22,12 @@ fclose($file_handle); try { var_dump( fgets($file_handle) ); // default length } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( fgets($file_handle, 10) ); // with specific length } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -35,6 +35,6 @@ echo "Done"; --EXPECT-- *** Testing fgets() : usage variations *** -- Testing fgets() with closed handle -- -fgets(): Argument #1 ($stream) must be an open stream resource -fgets(): Argument #1 ($stream) must be an open stream resource +TypeError: fgets(): Argument #1 ($stream) must be an open stream resource +TypeError: fgets(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/file_error.phpt b/ext/standard/tests/file/file_error.phpt index fffad3c59b64..3760f93d6bb0 100644 --- a/ext/standard/tests/file/file_error.phpt +++ b/ext/standard/tests/file/file_error.phpt @@ -10,12 +10,12 @@ $filename = $file_path."/file.tmp"; try { var_dump( file($filename, 10, NULL) ); // Incorrect flag } catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( file($filename, FILE_APPEND) ); // Incorrect flag } catch(ValueError $e) { - echo "ValueError: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( file("temp.tmp") ); // non existing filename fclose($file_handle); diff --git a/ext/standard/tests/file/file_get_contents_error.phpt b/ext/standard/tests/file/file_get_contents_error.phpt index add7831ef390..3de6abf84a00 100644 --- a/ext/standard/tests/file/file_get_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_error.phpt @@ -20,7 +20,7 @@ echo "\n-- Testing for invalid negative maxlen values --\n"; try { file_get_contents($file_path."/file_get_contents_error1.tmp", FALSE, $file_handle, 0, -5); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } delete_files($file_path, 1, "file_get_contents_error", 1); @@ -48,6 +48,6 @@ Warning: file_get_contents(): Failed to open stream: No such file or directory i bool(false) -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_error002.phpt b/ext/standard/tests/file/file_get_contents_error002.phpt index d47efa26a1b9..9ec4108f706d 100644 --- a/ext/standard/tests/file/file_get_contents_error002.phpt +++ b/ext/standard/tests/file/file_get_contents_error002.phpt @@ -10,8 +10,8 @@ display_errors=false try { file_get_contents("http://checkip.dyndns.com",null,null,0,-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt index 7133ae766d68..c551af9ba48b 100644 --- a/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt +++ b/ext/standard/tests/file/file_get_contents_file_put_contents_error.phpt @@ -15,7 +15,7 @@ file_put_contents($file_path."/file_put_contents_error1.tmp", "Garbage data in t try { file_get_contents($file_path."/file_put_contents_error1.tmp", FALSE, NULL, 0, -5); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Done ***\n"; @@ -34,6 +34,6 @@ unlink($file_path."/file_put_contents_error1.tmp"); Warning: file_get_contents(): Failed to open stream: No such file or directory in %s on line %d -- Testing for invalid negative maxlen values -- -file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 +ValueError: file_get_contents(): Argument #5 ($length) must be greater than or equal to 0 *** Done *** diff --git a/ext/standard/tests/file/file_get_contents_variation8.phpt b/ext/standard/tests/file/file_get_contents_variation8.phpt index 94d3a31c775e..19dc2b13178d 100644 --- a/ext/standard/tests/file/file_get_contents_variation8.phpt +++ b/ext/standard/tests/file/file_get_contents_variation8.phpt @@ -35,7 +35,7 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt index 01ee940d9531..6e1cee41f4d3 100644 --- a/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt +++ b/ext/standard/tests/file/file_get_contents_with_custom_uri_parser.phpt @@ -11,7 +11,7 @@ try { ]); var_dump(file_get_contents("http://example.com", context: $context)); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $context = stream_context_create([ @@ -37,7 +37,7 @@ var_dump(file_get_contents("http://exa%23mple.org", context: $context)); // inva ?> --EXPECTF-- -file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option +ValueError: file_get_contents(): Provided stream context has invalid value for the "uri_parser_class" option Warning: file_get_contents(): Failed to open stream: operation failed in %s on line %d bool(false) diff --git a/ext/standard/tests/file/file_put_contents.phpt b/ext/standard/tests/file/file_put_contents.phpt index 97094e92d0ef..855f96ce3b72 100644 --- a/ext/standard/tests/file/file_put_contents.phpt +++ b/ext/standard/tests/file/file_put_contents.phpt @@ -14,7 +14,7 @@ $context = stream_context_create(); try { var_dump(file_put_contents($file, $context)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(file_put_contents($file, new stdClass)); var_dump(file_put_contents($file, new foo)); @@ -22,7 +22,7 @@ $fp = fopen($file, "r"); try { var_dump(file_put_contents($file, "string", 0, $fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -33,8 +33,8 @@ $file = __DIR__."/file_put_contents.txt"; unlink($file); ?> --EXPECT-- -file_put_contents(): supplied resource is not a valid stream resource +TypeError: file_put_contents(): supplied resource is not a valid stream resource bool(false) int(15) -file_put_contents(): supplied resource is not a valid Stream-Context resource +TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource Done diff --git a/ext/standard/tests/file/file_put_contents_variation8.phpt b/ext/standard/tests/file/file_put_contents_variation8.phpt index 12ae8379f699..545889985dff 100644 --- a/ext/standard/tests/file/file_put_contents_variation8.phpt +++ b/ext/standard/tests/file/file_put_contents_variation8.phpt @@ -45,7 +45,7 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/standard/tests/file/file_variation6.phpt b/ext/standard/tests/file/file_variation6.phpt index 9bd91cfd40de..6bbd27210dcc 100644 --- a/ext/standard/tests/file/file_variation6.phpt +++ b/ext/standard/tests/file/file_variation6.phpt @@ -12,7 +12,7 @@ for ($flags = 0; $flags <= 32; $flags++) { try { var_dump(file($filepath, $flags)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -95,14 +95,14 @@ array(3) { [2]=> string(6) "Line 3" } -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value array(3) { [0]=> string(7) "Line 1 @@ -175,12 +175,12 @@ array(3) { [2]=> string(6) "Line 3" } -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value -file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value +ValueError: file(): Argument #2 ($flags) must be a valid flag value diff --git a/ext/standard/tests/file/filegroup_variation3.phpt b/ext/standard/tests/file/filegroup_variation3.phpt index e844be077212..cbeaa337fbb9 100644 --- a/ext/standard/tests/file/filegroup_variation3.phpt +++ b/ext/standard/tests/file/filegroup_variation3.phpt @@ -39,7 +39,7 @@ foreach($files_arr as $file) { try { var_dump( filegroup( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileinode_variation3.phpt b/ext/standard/tests/file/fileinode_variation3.phpt index 92357a3619e8..8f1ae01e54cf 100644 --- a/ext/standard/tests/file/fileinode_variation3.phpt +++ b/ext/standard/tests/file/fileinode_variation3.phpt @@ -38,7 +38,7 @@ foreach($files_arr as $file) { try { var_dump( fileinode( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileowner_variation3.phpt b/ext/standard/tests/file/fileowner_variation3.phpt index 63ba6936aaa8..b6900e49c5ee 100644 --- a/ext/standard/tests/file/fileowner_variation3.phpt +++ b/ext/standard/tests/file/fileowner_variation3.phpt @@ -39,7 +39,7 @@ foreach($files_arr as $file) { try { var_dump( fileowner( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/fileperms_variation3.phpt b/ext/standard/tests/file/fileperms_variation3.phpt index 5e981e9b8632..4383aafef4a2 100644 --- a/ext/standard/tests/file/fileperms_variation3.phpt +++ b/ext/standard/tests/file/fileperms_variation3.phpt @@ -38,7 +38,7 @@ foreach($files_arr as $file) { try { var_dump( fileperms( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/filesize_variation3.phpt b/ext/standard/tests/file/filesize_variation3.phpt index bf27c893b6ee..af16c7bade9a 100644 --- a/ext/standard/tests/file/filesize_variation3.phpt +++ b/ext/standard/tests/file/filesize_variation3.phpt @@ -19,7 +19,7 @@ for($size = filesize($filename); $size>=-1200; $size-=1200) { try { var_dump( ftruncate($file_handle, $size) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } fclose($file_handle); var_dump( filesize($filename) ); @@ -57,5 +57,5 @@ bool(true) int(1200) bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) diff --git a/ext/standard/tests/file/flock.phpt b/ext/standard/tests/file/flock.phpt index 0e07114f9cd4..3ad16a08f222 100644 --- a/ext/standard/tests/file/flock.phpt +++ b/ext/standard/tests/file/flock.phpt @@ -11,7 +11,7 @@ fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* @@ -42,7 +42,7 @@ var_dump(flock($fp, -1)); try { var_dump(flock($fp, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -52,7 +52,7 @@ $file = __DIR__."/flock.dat"; unlink($file); ?> --EXPECT-- -flock(): Argument #1 ($stream) must be an open stream resource +TypeError: flock(): Argument #1 ($stream) must be an open stream resource bool(true) bool(true) bool(true) @@ -66,4 +66,4 @@ int(0) bool(true) int(0) bool(true) -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN diff --git a/ext/standard/tests/file/flock_error.phpt b/ext/standard/tests/file/flock_error.phpt index 2ca20c3436ab..f37d25b5c01b 100644 --- a/ext/standard/tests/file/flock_error.phpt +++ b/ext/standard/tests/file/flock_error.phpt @@ -32,7 +32,7 @@ foreach($operations as $operation) { try { var_dump(flock($fp, $operation)); } catch (\TypeError|\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $i++; } @@ -44,7 +44,7 @@ fclose($fp); try { var_dump(flock($fp, LOCK_SH|LOCK_NB)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -55,19 +55,19 @@ unlink($file); --EXPECT-- *** Testing error conditions *** --- Iteration 0 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 1 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 2 --- -flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN +ValueError: flock(): Argument #2 ($operation) must be one of LOCK_SH, LOCK_EX, or LOCK_UN --- Iteration 3 --- -flock(): Argument #2 ($operation) must be of type int, array given +TypeError: flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 4 --- -flock(): Argument #2 ($operation) must be of type int, array given +TypeError: flock(): Argument #2 ($operation) must be of type int, array given --- Iteration 5 --- -flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 6 --- -flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #2 ($operation) must be of type int, string given --- Iteration 7 --- -flock(): Argument #2 ($operation) must be of type int, string given -flock(): Argument #1 ($stream) must be an open stream resource +TypeError: flock(): Argument #2 ($operation) must be of type int, string given +TypeError: flock(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/file/fnmatch_variation.phpt b/ext/standard/tests/file/fnmatch_variation.phpt index 3413c3e6f76c..860868d91f4c 100644 --- a/ext/standard/tests/file/fnmatch_variation.phpt +++ b/ext/standard/tests/file/fnmatch_variation.phpt @@ -65,7 +65,7 @@ for( $i = 0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } unlink($file_name); @@ -81,7 +81,7 @@ function match_( $pattern, $string ) { try { var_dump( fnmatch($pattern[$i], $string[$j]) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -185,9 +185,9 @@ bool(false) -- Iteration 22 -- bool(false) -- Iteration 23 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 24 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 25 -- bool(false) -- Iteration 26 -- @@ -261,44 +261,44 @@ bool(true) --- With Strings --- -- Iteration 0 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) -- Iteration 1 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 2 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) -- Iteration 3 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 4 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) bool(false) -- Iteration 5 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) @@ -397,22 +397,22 @@ bool(true) --- With NULL --- -- Iteration 0 -- bool(true) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(false) -- Iteration 1 -- -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes -fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes +ValueError: fnmatch(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 2 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(true) bool(false) -- Iteration 3 -- bool(false) -fnmatch(): Argument #2 ($filename) must not contain any null bytes +ValueError: fnmatch(): Argument #2 ($filename) must not contain any null bytes bool(false) bool(true) diff --git a/ext/standard/tests/file/fputcsv_variation13.phpt b/ext/standard/tests/file/fputcsv_variation13.phpt index 2a2e1ef0470d..c20446c53cdf 100644 --- a/ext/standard/tests/file/fputcsv_variation13.phpt +++ b/ext/standard/tests/file/fputcsv_variation13.phpt @@ -54,7 +54,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fputcsv($file_handle, $csv_field, '+', '%%', escape: "\\") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and eof var_dump( ftell($file_handle) ); @@ -76,649 +76,649 @@ echo "Done\n"; *** Testing fputcsv() : with default enclosure & delimiter of two chars *** -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #4 ($enclosure) must be a single character +ValueError: fputcsv(): Argument #4 ($enclosure) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fputcsv_variation17.phpt b/ext/standard/tests/file/fputcsv_variation17.phpt index 786b06494679..f96fe0720c78 100644 --- a/ext/standard/tests/file/fputcsv_variation17.phpt +++ b/ext/standard/tests/file/fputcsv_variation17.phpt @@ -28,4 +28,4 @@ aaa,bbb,ccc,dddd 123,456,789 """aaa""","""bbb""" -aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb""" \ No newline at end of file +aaa,bbb,ccc,dddd%0123,456,789%0"""aaa""","""bbb""" diff --git a/ext/standard/tests/file/fputcsv_variation9.phpt b/ext/standard/tests/file/fputcsv_variation9.phpt index b2bc895cd870..a50713273ab0 100644 --- a/ext/standard/tests/file/fputcsv_variation9.phpt +++ b/ext/standard/tests/file/fputcsv_variation9.phpt @@ -53,7 +53,7 @@ foreach ($csv_lists as $csv_list) { try { var_dump( fputcsv($file_handle, $csv_field, '++', '%%') ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the file pointer position and eof var_dump( ftell($file_handle) ); @@ -75,649 +75,649 @@ echo "Done\n"; *** Testing fputcsv() : with two chars as enclosure & delimiter *** -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in r+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in a+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in w+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+ -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+b -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" -- file opened in x+t -- -fputcsv(): Argument #3 ($separator) must be a single character +ValueError: fputcsv(): Argument #3 ($separator) must be a single character int(0) bool(false) string(0) "" diff --git a/ext/standard/tests/file/fread_error.phpt b/ext/standard/tests/file/fread_error.phpt index b89369e288e9..f1128ce7485f 100644 --- a/ext/standard/tests/file/fread_error.phpt +++ b/ext/standard/tests/file/fread_error.phpt @@ -12,19 +12,19 @@ $len = 0; try { var_dump( fread($file_handle, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $len = -10; try { var_dump( fread($file_handle, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing error conditions *** -- Testing fread() with invalid length arguments -- -fread(): Argument #2 ($length) must be greater than 0 -fread(): Argument #2 ($length) must be greater than 0 +ValueError: fread(): Argument #2 ($length) must be greater than 0 +ValueError: fread(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/file/fscanf.phpt b/ext/standard/tests/file/fscanf.phpt index 4acadc6169b0..5a46d3434d99 100644 --- a/ext/standard/tests/file/fscanf.phpt +++ b/ext/standard/tests/file/fscanf.phpt @@ -21,7 +21,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "%s", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -33,7 +33,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -45,7 +45,7 @@ $fp = fopen($filename, "rt"); try { fscanf($fp, "%.a", $v, $v1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($v); var_dump($v1); @@ -65,7 +65,7 @@ $fp = fopen($filename, "rt"); try { var_dump(fscanf($fp, "%s%d", $v)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -80,15 +80,15 @@ int(0) NULL int(1) string(4) "data" -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers string(4) "data" NULL -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers array(0) { } array(0) { } -Bad scan conversion character "." +ValueError: Bad scan conversion character "." array(0) { } array(0) { @@ -96,5 +96,5 @@ array(0) { bool(false) array(0) { } -Different numbers of variable names and field specifiers +ValueError: Different numbers of variable names and field specifiers Done diff --git a/ext/standard/tests/file/fscanf_error.phpt b/ext/standard/tests/file/fscanf_error.phpt index da586555be06..eb64d70d0c63 100644 --- a/ext/standard/tests/file/fscanf_error.phpt +++ b/ext/standard/tests/file/fscanf_error.phpt @@ -16,7 +16,7 @@ fclose($file_handle); try { fscanf($file_handle, "%s"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // number of formats in format strings not matching the no of variables @@ -26,7 +26,7 @@ if ($file_handle == false) try { fscanf($file_handle, "%d%s%f", $int_var, $string_var); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose($file_handle); @@ -42,7 +42,7 @@ foreach($invalid_formats as $format) { try { var_dump(fscanf($file_handle, $format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose($file_handle); } @@ -57,13 +57,13 @@ unlink($filename); ?> --EXPECT-- *** Testing fscanf() for error conditions *** -fscanf(): supplied resource is not a valid File-Handle resource -Different numbers of variable names and field specifiers +TypeError: fscanf(): supplied resource is not a valid File-Handle resource +ValueError: Different numbers of variable names and field specifiers array(0) { } -Bad scan conversion character " -Bad scan conversion character " -Bad scan conversion character "." -Bad scan conversion character "m" +ValueError: Bad scan conversion character " +ValueError: Bad scan conversion character " +ValueError: Bad scan conversion character "." +ValueError: Bad scan conversion character "m" *** Done *** diff --git a/ext/standard/tests/file/fscanf_variation10.phpt b/ext/standard/tests/file/fscanf_variation10.phpt index 1de7d25ffd90..2eb6c35ef6a8 100644 --- a/ext/standard/tests/file/fscanf_variation10.phpt +++ b/ext/standard/tests/file/fscanf_variation10.phpt @@ -59,7 +59,7 @@ foreach($float_formats as $float_format) { try { var_dump( fscanf($file_handle,$float_format) ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,8 +147,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation11.phpt b/ext/standard/tests/file/fscanf_variation11.phpt index 40560cfb39d9..87675b338d6d 100644 --- a/ext/standard/tests/file/fscanf_variation11.phpt +++ b/ext/standard/tests/file/fscanf_variation11.phpt @@ -64,7 +64,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -388,18 +388,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation12.phpt b/ext/standard/tests/file/fscanf_variation12.phpt index 0969d05febce..57163980053d 100644 --- a/ext/standard/tests/file/fscanf_variation12.phpt +++ b/ext/standard/tests/file/fscanf_variation12.phpt @@ -65,7 +65,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation13.phpt b/ext/standard/tests/file/fscanf_variation13.phpt index 73806dc6e488..88d9def8d8fb 100644 --- a/ext/standard/tests/file/fscanf_variation13.phpt +++ b/ext/standard/tests/file/fscanf_variation13.phpt @@ -51,7 +51,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation14.phpt b/ext/standard/tests/file/fscanf_variation14.phpt index 97a07a98f2e1..e5b61697dad7 100644 --- a/ext/standard/tests/file/fscanf_variation14.phpt +++ b/ext/standard/tests/file/fscanf_variation14.phpt @@ -97,7 +97,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -565,30 +565,30 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation15.phpt b/ext/standard/tests/file/fscanf_variation15.phpt index b35bb1bebe25..4faeb9b771a9 100644 --- a/ext/standard/tests/file/fscanf_variation15.phpt +++ b/ext/standard/tests/file/fscanf_variation15.phpt @@ -67,7 +67,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -463,21 +463,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation16.phpt b/ext/standard/tests/file/fscanf_variation16.phpt index 199db82a026e..2d2125143383 100644 --- a/ext/standard/tests/file/fscanf_variation16.phpt +++ b/ext/standard/tests/file/fscanf_variation16.phpt @@ -58,7 +58,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -146,8 +146,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation17.phpt b/ext/standard/tests/file/fscanf_variation17.phpt index 64080a1a83b9..b5b27dea113b 100644 --- a/ext/standard/tests/file/fscanf_variation17.phpt +++ b/ext/standard/tests/file/fscanf_variation17.phpt @@ -63,7 +63,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -387,18 +387,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation18.phpt b/ext/standard/tests/file/fscanf_variation18.phpt index eef94173c583..9fdf349d3f2e 100644 --- a/ext/standard/tests/file/fscanf_variation18.phpt +++ b/ext/standard/tests/file/fscanf_variation18.phpt @@ -71,7 +71,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -539,24 +539,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation19.phpt b/ext/standard/tests/file/fscanf_variation19.phpt index f5bc3f19e386..2b8202ab9f97 100644 --- a/ext/standard/tests/file/fscanf_variation19.phpt +++ b/ext/standard/tests/file/fscanf_variation19.phpt @@ -55,7 +55,7 @@ foreach($string_formats as $string_format) { try { var_dump(fscanf($file_handle,$string_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -151,10 +151,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation2.phpt b/ext/standard/tests/file/fscanf_variation2.phpt index f2c5593c3ee6..289f3eb8a359 100644 --- a/ext/standard/tests/file/fscanf_variation2.phpt +++ b/ext/standard/tests/file/fscanf_variation2.phpt @@ -65,7 +65,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -533,24 +533,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation20.phpt b/ext/standard/tests/file/fscanf_variation20.phpt index 70b13dd55c90..f2b02c2d8a2b 100644 --- a/ext/standard/tests/file/fscanf_variation20.phpt +++ b/ext/standard/tests/file/fscanf_variation20.phpt @@ -69,7 +69,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -537,24 +537,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation21.phpt b/ext/standard/tests/file/fscanf_variation21.phpt index 86968ddd1177..1a6442f46e47 100644 --- a/ext/standard/tests/file/fscanf_variation21.phpt +++ b/ext/standard/tests/file/fscanf_variation21.phpt @@ -67,7 +67,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -463,21 +463,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation22.phpt b/ext/standard/tests/file/fscanf_variation22.phpt index 87a5fe21bc27..8d76ab8f9d56 100644 --- a/ext/standard/tests/file/fscanf_variation22.phpt +++ b/ext/standard/tests/file/fscanf_variation22.phpt @@ -58,7 +58,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -146,8 +146,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation23.phpt b/ext/standard/tests/file/fscanf_variation23.phpt index f7bb4ee55201..708bbb56315c 100644 --- a/ext/standard/tests/file/fscanf_variation23.phpt +++ b/ext/standard/tests/file/fscanf_variation23.phpt @@ -63,7 +63,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -387,18 +387,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation24.phpt b/ext/standard/tests/file/fscanf_variation24.phpt index 4c46cf58dad1..cf61e3303627 100644 --- a/ext/standard/tests/file/fscanf_variation24.phpt +++ b/ext/standard/tests/file/fscanf_variation24.phpt @@ -69,7 +69,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -531,24 +531,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation25.phpt b/ext/standard/tests/file/fscanf_variation25.phpt index dc9d9936022f..74878cbfb397 100644 --- a/ext/standard/tests/file/fscanf_variation25.phpt +++ b/ext/standard/tests/file/fscanf_variation25.phpt @@ -55,7 +55,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -181,10 +181,10 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation26.phpt b/ext/standard/tests/file/fscanf_variation26.phpt index 19db8f45abfd..8a0c26030aa3 100644 --- a/ext/standard/tests/file/fscanf_variation26.phpt +++ b/ext/standard/tests/file/fscanf_variation26.phpt @@ -50,7 +50,7 @@ foreach($char_formats as $char_format) { try { var_dump(fscanf($file_handle,$char_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -206,11 +206,11 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation27.phpt b/ext/standard/tests/file/fscanf_variation27.phpt index a9560e042505..7a454f9d79e1 100644 --- a/ext/standard/tests/file/fscanf_variation27.phpt +++ b/ext/standard/tests/file/fscanf_variation27.phpt @@ -70,7 +70,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -538,24 +538,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation28.phpt b/ext/standard/tests/file/fscanf_variation28.phpt index 18c9726f8536..e9454d3d53ef 100644 --- a/ext/standard/tests/file/fscanf_variation28.phpt +++ b/ext/standard/tests/file/fscanf_variation28.phpt @@ -68,7 +68,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -464,21 +464,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation29.phpt b/ext/standard/tests/file/fscanf_variation29.phpt index a35d782fcd45..558bd79404cf 100644 --- a/ext/standard/tests/file/fscanf_variation29.phpt +++ b/ext/standard/tests/file/fscanf_variation29.phpt @@ -59,7 +59,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,8 +147,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation30.phpt b/ext/standard/tests/file/fscanf_variation30.phpt index 9afde0f093ac..0a2d129bc49f 100644 --- a/ext/standard/tests/file/fscanf_variation30.phpt +++ b/ext/standard/tests/file/fscanf_variation30.phpt @@ -64,7 +64,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -388,18 +388,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation31.phpt b/ext/standard/tests/file/fscanf_variation31.phpt index a9e2c8b26865..0e1648064181 100644 --- a/ext/standard/tests/file/fscanf_variation31.phpt +++ b/ext/standard/tests/file/fscanf_variation31.phpt @@ -65,7 +65,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation32.phpt b/ext/standard/tests/file/fscanf_variation32.phpt index df393f9d8398..f7b581b95575 100644 --- a/ext/standard/tests/file/fscanf_variation32.phpt +++ b/ext/standard/tests/file/fscanf_variation32.phpt @@ -56,7 +56,7 @@ foreach($octal_formats as $octal_format) { try { var_dump(fscanf($file_handle,$octal_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -152,10 +152,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation35.phpt b/ext/standard/tests/file/fscanf_variation35.phpt index 61b939d32122..5ce8712f6b56 100644 --- a/ext/standard/tests/file/fscanf_variation35.phpt +++ b/ext/standard/tests/file/fscanf_variation35.phpt @@ -54,7 +54,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation36.phpt b/ext/standard/tests/file/fscanf_variation36.phpt index 61571f6c6cb0..a1dfbdbc8de9 100644 --- a/ext/standard/tests/file/fscanf_variation36.phpt +++ b/ext/standard/tests/file/fscanf_variation36.phpt @@ -59,7 +59,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation37.phpt b/ext/standard/tests/file/fscanf_variation37.phpt index d597ebe307c6..24794d13c3c3 100644 --- a/ext/standard/tests/file/fscanf_variation37.phpt +++ b/ext/standard/tests/file/fscanf_variation37.phpt @@ -65,7 +65,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation38.phpt b/ext/standard/tests/file/fscanf_variation38.phpt index 236d547f6b78..ec22c5ec78d1 100644 --- a/ext/standard/tests/file/fscanf_variation38.phpt +++ b/ext/standard/tests/file/fscanf_variation38.phpt @@ -51,7 +51,7 @@ foreach($hexa_formats as $hexa_format) { try { var_dump(fscanf($file_handle,$hexa_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation4.phpt b/ext/standard/tests/file/fscanf_variation4.phpt index 45a3b5702b1f..2f362b7123a9 100644 --- a/ext/standard/tests/file/fscanf_variation4.phpt +++ b/ext/standard/tests/file/fscanf_variation4.phpt @@ -55,7 +55,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -143,8 +143,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation41.phpt b/ext/standard/tests/file/fscanf_variation41.phpt index 4c993bbeec5a..ec4c67dc141e 100644 --- a/ext/standard/tests/file/fscanf_variation41.phpt +++ b/ext/standard/tests/file/fscanf_variation41.phpt @@ -54,7 +54,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation42.phpt b/ext/standard/tests/file/fscanf_variation42.phpt index 90436ff12490..2575fb6d65e1 100644 --- a/ext/standard/tests/file/fscanf_variation42.phpt +++ b/ext/standard/tests/file/fscanf_variation42.phpt @@ -59,7 +59,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation43.phpt b/ext/standard/tests/file/fscanf_variation43.phpt index 72afbba0c386..ed7a0d47b778 100644 --- a/ext/standard/tests/file/fscanf_variation43.phpt +++ b/ext/standard/tests/file/fscanf_variation43.phpt @@ -65,7 +65,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation44.phpt b/ext/standard/tests/file/fscanf_variation44.phpt index 3dfd5d6d7bda..41468629dd3d 100644 --- a/ext/standard/tests/file/fscanf_variation44.phpt +++ b/ext/standard/tests/file/fscanf_variation44.phpt @@ -51,7 +51,7 @@ foreach($unsigned_formats as $unsigned_format) { try { var_dump(fscanf($file_handle,$unsigned_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation45.phpt b/ext/standard/tests/file/fscanf_variation45.phpt index b694da0e555c..db51db68039b 100644 --- a/ext/standard/tests/file/fscanf_variation45.phpt +++ b/ext/standard/tests/file/fscanf_variation45.phpt @@ -65,7 +65,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -533,24 +533,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation46.phpt b/ext/standard/tests/file/fscanf_variation46.phpt index bc96af6dbe37..29e0d510f7e7 100644 --- a/ext/standard/tests/file/fscanf_variation46.phpt +++ b/ext/standard/tests/file/fscanf_variation46.phpt @@ -63,7 +63,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -459,21 +459,21 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation47.phpt b/ext/standard/tests/file/fscanf_variation47.phpt index 04b92b7e9f78..bd6509eb5e2f 100644 --- a/ext/standard/tests/file/fscanf_variation47.phpt +++ b/ext/standard/tests/file/fscanf_variation47.phpt @@ -54,7 +54,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -142,8 +142,8 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation48.phpt b/ext/standard/tests/file/fscanf_variation48.phpt index aa717bd83e0d..db771d2b409c 100644 --- a/ext/standard/tests/file/fscanf_variation48.phpt +++ b/ext/standard/tests/file/fscanf_variation48.phpt @@ -59,7 +59,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation49.phpt b/ext/standard/tests/file/fscanf_variation49.phpt index 43505fc24917..36b87f292ab0 100644 --- a/ext/standard/tests/file/fscanf_variation49.phpt +++ b/ext/standard/tests/file/fscanf_variation49.phpt @@ -65,7 +65,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation5.phpt b/ext/standard/tests/file/fscanf_variation5.phpt index 7ccdbf6402e4..885e91643e25 100644 --- a/ext/standard/tests/file/fscanf_variation5.phpt +++ b/ext/standard/tests/file/fscanf_variation5.phpt @@ -59,7 +59,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -383,18 +383,18 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation50.phpt b/ext/standard/tests/file/fscanf_variation50.phpt index 1e6ecb865e94..6761e22da10f 100644 --- a/ext/standard/tests/file/fscanf_variation50.phpt +++ b/ext/standard/tests/file/fscanf_variation50.phpt @@ -51,7 +51,7 @@ foreach($scientific_formats as $scientific_format) { try { var_dump(fscanf($file_handle,$scientific_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation6.phpt b/ext/standard/tests/file/fscanf_variation6.phpt index 577477e5de60..41069741bc3a 100644 --- a/ext/standard/tests/file/fscanf_variation6.phpt +++ b/ext/standard/tests/file/fscanf_variation6.phpt @@ -65,7 +65,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -497,24 +497,24 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation7.phpt b/ext/standard/tests/file/fscanf_variation7.phpt index 42e2455eea80..3e555a82bd4f 100644 --- a/ext/standard/tests/file/fscanf_variation7.phpt +++ b/ext/standard/tests/file/fscanf_variation7.phpt @@ -51,7 +51,7 @@ foreach($int_formats as $int_format) { try { var_dump(fscanf($file_handle,$int_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -147,10 +147,10 @@ NULL bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fscanf_variation8.phpt b/ext/standard/tests/file/fscanf_variation8.phpt index 2851d7c02773..83fd2e6c0609 100644 --- a/ext/standard/tests/file/fscanf_variation8.phpt +++ b/ext/standard/tests/file/fscanf_variation8.phpt @@ -83,7 +83,7 @@ foreach($float_formats as $float_format) { try { var_dump(fscanf($file_handle,$float_format)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } $counter++; @@ -839,36 +839,36 @@ array(1) { bool(false) -- iteration 7 -- -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " -Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " +ValueError: Bad scan conversion character " " bool(false) -- iteration 8 -- diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt index c38f7905399b..d37c27ad76a6 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error1.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(fseek($fp,10)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing fseek() : error conditions *** -- Testing fseek() with closed/unset file handle -- -fseek(): Argument #1 ($stream) must be an open stream resource +TypeError: fseek(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt index 58c3b5330d87..50a4f297c21a 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error2.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(ftell($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing ftell() : error conditions *** -- Testing ftell with closed/unset file handle -- -ftell(): Argument #1 ($stream) must be an open stream resource +TypeError: ftell(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt index ad50244edb3e..c7772fba82da 100644 --- a/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt +++ b/ext/standard/tests/file/fseek_ftell_rewind_error3.phpt @@ -12,7 +12,7 @@ fclose($fp); try { var_dump(rewind($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; --EXPECT-- *** Testing rewind() : error conditions *** -- Testing rewind() with closed/unset file handle -- -rewind(): Argument #1 ($stream) must be an open stream resource +TypeError: rewind(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/fstat.phpt b/ext/standard/tests/file/fstat.phpt index 86d1453f1b72..dd8f88a611c8 100644 --- a/ext/standard/tests/file/fstat.phpt +++ b/ext/standard/tests/file/fstat.phpt @@ -11,7 +11,7 @@ fclose($fp); try { var_dump(fstat($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @unlink($filename); @@ -72,5 +72,5 @@ array(26) { ["blocks"]=> int(%i) } -fstat(): Argument #1 ($stream) must be an open stream resource +TypeError: fstat(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/ftruncate.phpt b/ext/standard/tests/file/ftruncate.phpt index 2bdefefaaf1d..64bc9d82bc58 100644 --- a/ext/standard/tests/file/ftruncate.phpt +++ b/ext/standard/tests/file/ftruncate.phpt @@ -35,7 +35,7 @@ $fp = fopen($filename, "a"); try { var_dump(ftruncate($fp, -1000000000)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } fclose($fp); var_dump(file_get_contents($filename)); @@ -52,5 +52,5 @@ bool(true) string(10) "some test " bool(true) string(0) "" -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 string(21) "some test data inside" diff --git a/ext/standard/tests/file/ftruncate_error.phpt b/ext/standard/tests/file/ftruncate_error.phpt index 3397fc25f44a..a9adcbe48f90 100644 --- a/ext/standard/tests/file/ftruncate_error.phpt +++ b/ext/standard/tests/file/ftruncate_error.phpt @@ -18,7 +18,7 @@ fclose($file_handle); try { var_dump( ftruncate($file_handle,10) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // check the first size var_dump( filesize($filename) ); @@ -35,6 +35,6 @@ unlink( $filename ); Initial file size = 36 -- Testing ftruncate() with closed/unset file handle -- -ftruncate(): Argument #1 ($stream) must be an open stream resource +TypeError: ftruncate(): Argument #1 ($stream) must be an open stream resource int(36) Done diff --git a/ext/standard/tests/file/ftruncate_variation4.phpt b/ext/standard/tests/file/ftruncate_variation4.phpt index 865b6ff902a2..9a63b0e5becf 100644 --- a/ext/standard/tests/file/ftruncate_variation4.phpt +++ b/ext/standard/tests/file/ftruncate_variation4.phpt @@ -49,7 +49,7 @@ foreach($file_content_types as $file_content_type) { try { var_dump( ftruncate($file_handle, $new_size) ); // truncate it } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump( ftell($file_handle) ); var_dump( feof($file_handle) ); @@ -72,7 +72,7 @@ echo "Done\n"; -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -80,7 +80,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -88,7 +88,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -96,7 +96,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -104,7 +104,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -112,7 +112,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -120,7 +120,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -128,7 +128,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -136,7 +136,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -144,7 +144,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -152,7 +152,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -160,7 +160,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -168,7 +168,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -176,7 +176,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -184,7 +184,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -192,7 +192,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -200,7 +200,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -208,7 +208,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -216,7 +216,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -224,7 +224,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -232,7 +232,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -240,7 +240,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -248,7 +248,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -256,7 +256,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -266,7 +266,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -274,7 +274,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -282,7 +282,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -290,7 +290,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -298,7 +298,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -306,7 +306,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -314,7 +314,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -322,7 +322,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -330,7 +330,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -338,7 +338,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -346,7 +346,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -354,7 +354,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -362,7 +362,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -370,7 +370,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -378,7 +378,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -386,7 +386,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -394,7 +394,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -402,7 +402,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -410,7 +410,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -418,7 +418,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -426,7 +426,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -434,7 +434,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -442,7 +442,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) @@ -450,7 +450,7 @@ bool(true) -- Testing ftruncate(): try truncating file to a negative size -- bool(true) int(0) -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 int(0) bool(false) bool(true) diff --git a/ext/standard/tests/file/fwrite_error.phpt b/ext/standard/tests/file/fwrite_error.phpt index 62ec928a29df..1ba9ff112ca6 100644 --- a/ext/standard/tests/file/fwrite_error.phpt +++ b/ext/standard/tests/file/fwrite_error.phpt @@ -24,7 +24,7 @@ fclose($file_handle); try { var_dump(fwrite($file_handle,"data")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -40,5 +40,5 @@ unlink( $filename ); int(0) int(0) -- Testing fwrite() with closed/unset file handle -- -fwrite(): Argument #1 ($stream) must be an open stream resource +TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/gh18212.phpt b/ext/standard/tests/file/gh18212.phpt index 6e4d8ad9bd32..07f5780d66c6 100644 --- a/ext/standard/tests/file/gh18212.phpt +++ b/ext/standard/tests/file/gh18212.phpt @@ -10,4 +10,3 @@ fclose($fp); --EXPECT-- int(-1) int(-1) - diff --git a/ext/standard/tests/file/glob_variation.phpt b/ext/standard/tests/file/glob_variation.phpt index 4fc1c240b4d4..57e539a5f60a 100644 --- a/ext/standard/tests/file/glob_variation.phpt +++ b/ext/standard/tests/file/glob_variation.phpt @@ -52,7 +52,7 @@ foreach($patterns as $pattern) { var_dump( glob($pattern, GLOB_NOESCAPE) ); var_dump( glob($pattern, GLOB_ERR) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -78,7 +78,7 @@ foreach($patterns as $pattern) { try { var_dump( glob($pattern, GLOB_ONLYDIR) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -332,7 +332,7 @@ array(0) { } -- Iteration 8 -- -glob(): Argument #1 ($pattern) must not contain any null bytes +ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 9 -- array(0) { @@ -435,7 +435,7 @@ array(1) { array(0) { } -- Iteration 8 -- -glob(): Argument #1 ($pattern) must not contain any null bytes +ValueError: glob(): Argument #1 ($pattern) must not contain any null bytes -- Iteration 9 -- array(0) { } diff --git a/ext/standard/tests/file/is_dir_variation4.phpt b/ext/standard/tests/file/is_dir_variation4.phpt index d6e64efe211c..6e1961e23fe6 100644 --- a/ext/standard/tests/file/is_dir_variation4.phpt +++ b/ext/standard/tests/file/is_dir_variation4.phpt @@ -36,7 +36,7 @@ foreach($dirs_arr as $dir) { try { var_dump( is_dir($file_path."/".$dir ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count++; } diff --git a/ext/standard/tests/file/is_executable_variation1.phpt b/ext/standard/tests/file/is_executable_variation1.phpt index a85b9a2ef028..20fe4d1d862e 100644 --- a/ext/standard/tests/file/is_executable_variation1.phpt +++ b/ext/standard/tests/file/is_executable_variation1.phpt @@ -50,7 +50,7 @@ foreach($files_arr as $file) { try { var_dump( is_executable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/is_file_variation4.phpt b/ext/standard/tests/file/is_file_variation4.phpt index 1afc34dd03be..5d7285269b31 100644 --- a/ext/standard/tests/file/is_file_variation4.phpt +++ b/ext/standard/tests/file/is_file_variation4.phpt @@ -36,7 +36,7 @@ foreach($files_arr as $file) { try { var_dump( is_file( $file_path."/".$file ) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } clearstatcache(); $count++; diff --git a/ext/standard/tests/file/is_readable_variation1.phpt b/ext/standard/tests/file/is_readable_variation1.phpt index 9c25213f8abb..7fdbf5f6d48f 100644 --- a/ext/standard/tests/file/is_readable_variation1.phpt +++ b/ext/standard/tests/file/is_readable_variation1.phpt @@ -49,7 +49,7 @@ foreach($files_arr as $file) { try { var_dump( is_readable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/is_writable_variation1.phpt b/ext/standard/tests/file/is_writable_variation1.phpt index 80695d6d45a2..8b7963afbdac 100644 --- a/ext/standard/tests/file/is_writable_variation1.phpt +++ b/ext/standard/tests/file/is_writable_variation1.phpt @@ -48,12 +48,12 @@ foreach($files_arr as $file) { try { var_dump( is_writable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( is_writeable($file) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; clearstatcache(); diff --git a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt index 831cb0c95662..2b6a4248b16d 100644 --- a/ext/standard/tests/file/mkdir_rmdir_variation2.phpt +++ b/ext/standard/tests/file/mkdir_rmdir_variation2.phpt @@ -26,12 +26,12 @@ echo "\n*** Testing mkdir() and rmdir() for binary safe functionality ***\n"; try { var_dump( mkdir("$file_path/temp".chr(0)."/") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( rmdir("$file_path/temp".chr(0)."/") ); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n*** Testing mkdir() with miscellaneous input ***\n"; @@ -60,8 +60,8 @@ Warning: rmdir(): %s on line %d bool(false) *** Testing mkdir() and rmdir() for binary safe functionality *** -mkdir(): Argument #1 ($directory) must not contain any null bytes -rmdir(): Argument #1 ($directory) must not contain any null bytes +ValueError: mkdir(): Argument #1 ($directory) must not contain any null bytes +ValueError: rmdir(): Argument #1 ($directory) must not contain any null bytes *** Testing mkdir() with miscellaneous input *** bool(true) diff --git a/ext/standard/tests/file/pathinfo_variation3.phpt b/ext/standard/tests/file/pathinfo_variation3.phpt index 86f88677d813..e72ee472e0f1 100644 --- a/ext/standard/tests/file/pathinfo_variation3.phpt +++ b/ext/standard/tests/file/pathinfo_variation3.phpt @@ -19,32 +19,32 @@ var_dump(pathinfo($testfile, PATHINFO_DIRNAME)); try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_FILENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_EXTENSION|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_FILENAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_EXTENSION); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo($testfile, PATHINFO_DIRNAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -84,9 +84,9 @@ string(6) "inet.h" string(4) "inet" string(1) "h" string(17) "/usr/include/arpa" -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants diff --git a/ext/standard/tests/file/popen_pclose_error.phpt b/ext/standard/tests/file/popen_pclose_error.phpt index 6c92708dddb7..915c9ea7be8a 100644 --- a/ext/standard/tests/file/popen_pclose_error.phpt +++ b/ext/standard/tests/file/popen_pclose_error.phpt @@ -6,23 +6,23 @@ Test popen() and pclose function: error conditions try { popen("abc.txt", "x"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rw"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { popen("abc.txt", "rwb"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" -popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" +ValueError: popen(): Argument #2 ($mode) must be one of "r", "rb", "w", or "wb" diff --git a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt index f48c7b872003..80e8bbd1d4d4 100644 --- a/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt +++ b/ext/standard/tests/file/proc_open_with_wrong_resource_type.phpt @@ -7,8 +7,8 @@ proc_open does not leak memory when called with wrong resource type in descripto proc_open('not_a_real_command_but_I_dont_care', array(0 => $context), $pipes); echo "Not reached"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -proc_open(): supplied resource is not a valid stream resource +TypeError: proc_open(): supplied resource is not a valid stream resource diff --git a/ext/standard/tests/file/readfile_error.phpt b/ext/standard/tests/file/readfile_error.phpt index d21554296a15..63f3db84623a 100644 --- a/ext/standard/tests/file/readfile_error.phpt +++ b/ext/standard/tests/file/readfile_error.phpt @@ -11,12 +11,12 @@ echo "\n-- Testing readfile() with invalid arguments --\n"; try { var_dump( readfile('') ); // empty string as $filename } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump( readfile(false) ); // boolean false as $filename } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Testing readfile() with non-existent file --\n"; @@ -29,8 +29,8 @@ echo "Done\n"; *** Test readfile(): error conditions *** -- Testing readfile() with invalid arguments -- -Path must not be empty -Path must not be empty +ValueError: Path must not be empty +ValueError: Path must not be empty -- Testing readfile() with non-existent file -- diff --git a/ext/standard/tests/file/readfile_variation10.phpt b/ext/standard/tests/file/readfile_variation10.phpt index 3782f7384515..ae3fc04f9c3b 100644 --- a/ext/standard/tests/file/readfile_variation10.phpt +++ b/ext/standard/tests/file/readfile_variation10.phpt @@ -36,7 +36,7 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> diff --git a/ext/standard/tests/file/stream_rfc2397_006.phpt b/ext/standard/tests/file/stream_rfc2397_006.phpt index bde1d4e0cebe..3eb17f61118c 100644 --- a/ext/standard/tests/file/stream_rfc2397_006.phpt +++ b/ext/standard/tests/file/stream_rfc2397_006.phpt @@ -17,14 +17,14 @@ foreach($streams as $stream) try { var_dump(file_get_contents($stream)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- -file_get_contents(): Argument #1 ($filename) must not contain any null bytes -file_get_contents(): Argument #1 ($filename) must not contain any null bytes +ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes +ValueError: file_get_contents(): Argument #1 ($filename) must not contain any null bytes Warning: file_get_contents(): Failed to open stream: rfc2397: unable to decode in %sstream_rfc2397_006.php on line %d bool(false) diff --git a/ext/standard/tests/file/stream_supports_lock.phpt b/ext/standard/tests/file/stream_supports_lock.phpt index 76249e9106ee..2444e8a25365 100644 --- a/ext/standard/tests/file/stream_supports_lock.phpt +++ b/ext/standard/tests/file/stream_supports_lock.phpt @@ -29,7 +29,7 @@ var_dump($sock); try { var_dump(stream_supports_lock($sock)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -44,5 +44,5 @@ bool(false) resource(%d) of type (stream) bool(false) resource(%d) of type (stream-context) -stream_supports_lock(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_supports_lock(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt index c8420ea86fb2..e9b685a17c90 100644 --- a/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt +++ b/ext/standard/tests/file/symlink_link_linkinfo_is_link_error1.phpt @@ -30,7 +30,7 @@ echo "\n*** Testing linkinfo() for error conditions ***\n"; try { var_dump(linkinfo('')); // empty string as linkname } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -56,5 +56,5 @@ Warning: symlink(): %s in %s on line %d bool(false) *** Testing linkinfo() for error conditions *** -linkinfo(): Argument #1 ($path) must not be empty +ValueError: linkinfo(): Argument #1 ($path) must not be empty Done diff --git a/ext/standard/tests/file/tempnam_variation3.phpt b/ext/standard/tests/file/tempnam_variation3.phpt index 6f20ec140ef4..84f117072993 100644 --- a/ext/standard/tests/file/tempnam_variation3.phpt +++ b/ext/standard/tests/file/tempnam_variation3.phpt @@ -37,7 +37,7 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } @@ -97,9 +97,9 @@ File name is => %s/%s File permissions are => 100600 File created in => directory specified -- Iteration 5 -- -tempnam(): Argument #2 ($prefix) must not contain any null bytes +ValueError: tempnam(): Argument #2 ($prefix) must not contain any null bytes -- Iteration 6 -- -tempnam(): Argument #2 ($prefix) must be of type string, array given +TypeError: tempnam(): Argument #2 ($prefix) must be of type string, array given -- Iteration 7 -- File name is => %s/dir%s File permissions are => 100600 diff --git a/ext/standard/tests/file/tempnam_variation7.phpt b/ext/standard/tests/file/tempnam_variation7.phpt index 1928da4f8962..0d0a51167f89 100644 --- a/ext/standard/tests/file/tempnam_variation7.phpt +++ b/ext/standard/tests/file/tempnam_variation7.phpt @@ -35,7 +35,7 @@ for( $i=0; $igetMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } @@ -96,9 +96,9 @@ File name is => %s%etempnam_variation3.tmp%s File permissions are => 100600 File created in => temp dir -- Iteration 5 -- -tempnam(): Argument #1 ($directory) must not contain any null bytes +ValueError: tempnam(): Argument #1 ($directory) must not contain any null bytes -- Iteration 6 -- -tempnam(): Argument #1 ($directory) must be of type string, array given +TypeError: tempnam(): Argument #1 ($directory) must be of type string, array given -- Iteration 7 -- Notice: tempnam(): file created in the system's temporary directory in %stempnam_variation7.php on line %d diff --git a/ext/standard/tests/file/tempnam_variation9.phpt b/ext/standard/tests/file/tempnam_variation9.phpt index 61178a022ce3..c1c9f45debda 100644 --- a/ext/standard/tests/file/tempnam_variation9.phpt +++ b/ext/standard/tests/file/tempnam_variation9.phpt @@ -31,7 +31,7 @@ foreach($names_arr as $i=>$prefix) { try { $file_name = tempnam("$file_path", $prefix); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; continue; } diff --git a/ext/standard/tests/file/touch.phpt b/ext/standard/tests/file/touch.phpt index 9e3972631aa6..c2744bfcc1cc 100644 --- a/ext/standard/tests/file/touch.phpt +++ b/ext/standard/tests/file/touch.phpt @@ -38,7 +38,7 @@ var_dump(touch("/no/such/file/or/directory")); try { touch("/no/such/file/or/directory", null, 1599492068); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -57,5 +57,5 @@ int(100) Warning: touch(): Unable to create file /no/such/file/or/directory because %s in %s on line %d bool(false) -touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer +ValueError: touch(): Argument #2 ($mtime) cannot be null when argument #3 ($atime) is an integer Done diff --git a/ext/standard/tests/file/userstreams.phpt b/ext/standard/tests/file/userstreams.phpt index d159b9612dbe..2a56ec46bc03 100644 --- a/ext/standard/tests/file/userstreams.phpt +++ b/ext/standard/tests/file/userstreams.phpt @@ -161,7 +161,7 @@ try { stream_wrapper_register("bogus", "class_not_exist"); die("Registered a non-existent class!!!???"); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Not Registered\n"; @@ -319,7 +319,7 @@ echo $data . "\n"; ?> --EXPECT-- -stream_wrapper_register(): Argument #2 ($class) must be a valid class name, class_not_exist given +TypeError: stream_wrapper_register(): Argument #2 ($class) must be a valid class name, class_not_exist given Not Registered Registered Registered diff --git a/ext/standard/tests/file/userstreams_002.phpt b/ext/standard/tests/file/userstreams_002.phpt index ec16ed432079..e152151b5ced 100644 --- a/ext/standard/tests/file/userstreams_002.phpt +++ b/ext/standard/tests/file/userstreams_002.phpt @@ -26,7 +26,7 @@ function test($name, $fd, $return_value) { try { var_dump(stream_select($r, $w, $e, 0) !== false); } catch (TypeError|ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -56,26 +56,26 @@ bool(true) Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value is false: ------- Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value not a stream resource: ------- Warning: stream_select(): test_wrapper::stream_cast must return a stream resource in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value is stream itself: ------- Warning: stream_select(): test_wrapper::stream_cast must not return itself in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed ------ return value cannot be casted: ------- @@ -84,4 +84,4 @@ Warning: stream_select(): test_wrapper_base::stream_cast is not implemented! in Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s -No stream arrays were passed +ValueError: No stream arrays were passed diff --git a/ext/standard/tests/file/userstreams_005.phpt b/ext/standard/tests/file/userstreams_005.phpt index 11dc8d45b0cd..44d68dce1718 100644 --- a/ext/standard/tests/file/userstreams_005.phpt +++ b/ext/standard/tests/file/userstreams_005.phpt @@ -42,7 +42,7 @@ test("stream_truncate size 10", $fd, 10); try { test("stream_truncate negative size", $fd, -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } test("stream_truncate bad return", $fd3, 0); ?> @@ -61,7 +61,7 @@ bool(true) truncation with new_size=10 bool(true) ------ stream_truncate negative size: ------- -ftruncate(): Argument #2 ($size) must be greater than or equal to 0 +ValueError: ftruncate(): Argument #2 ($size) must be greater than or equal to 0 ------ stream_truncate bad return: ------- truncation with new_size=0 diff --git a/ext/standard/tests/filters/001.phpt b/ext/standard/tests/filters/001.phpt index 3f0d5f5eb44e..9007a937d4b1 100644 --- a/ext/standard/tests/filters/001.phpt +++ b/ext/standard/tests/filters/001.phpt @@ -5,19 +5,19 @@ stream_filter_register() and invalid arguments try { stream_filter_register("", ""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_filter_register("test", ""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_filter_register("", "test"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(stream_filter_register("------", "nonexistentclass")); @@ -25,8 +25,8 @@ var_dump(stream_filter_register("------", "nonexistentclass")); echo "Done\n"; ?> --EXPECT-- -stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string -stream_filter_register(): Argument #2 ($class) must be a non-empty string -stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string +ValueError: stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string +ValueError: stream_filter_register(): Argument #2 ($class) must be a non-empty string +ValueError: stream_filter_register(): Argument #1 ($filter_name) must be a non-empty string bool(true) Done diff --git a/ext/standard/tests/filters/bug54350.phpt b/ext/standard/tests/filters/bug54350.phpt index ec3cd857f1a0..190da056de12 100644 --- a/ext/standard/tests/filters/bug54350.phpt +++ b/ext/standard/tests/filters/bug54350.phpt @@ -10,7 +10,7 @@ class user_filter extends php_user_filter { try { fclose($this->stream); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } return 0; } @@ -23,4 +23,4 @@ fwrite($fd, "foo"); ?> --EXPECTF-- Warning: fclose(): cannot close the provided stream, as it must not be manually closed in %s on line %d -fclose(): Argument #1 ($stream) must be of type resource, null given +TypeError: fclose(): Argument #1 ($stream) must be of type resource, null given diff --git a/ext/standard/tests/filters/bug77231.phpt b/ext/standard/tests/filters/bug77231.phpt index 17967ee80fc5..b499e4b4eb60 100644 --- a/ext/standard/tests/filters/bug77231.phpt +++ b/ext/standard/tests/filters/bug77231.phpt @@ -8,4 +8,4 @@ var_dump(file(urldecode('php://filter/convert.quoted-printable-encode/resource=d array(1) { [0]=> string(74) "=BFAAAAAAAAFAAAAAAAAAAAAAA=FF=FF=FF=FF=FF=FF=FF=FFAAAAAAAAAAAAAAAAAAAAAAAA" -} \ No newline at end of file +} diff --git a/ext/standard/tests/filters/bug79468.phpt b/ext/standard/tests/filters/bug79468.phpt index 0373f317102e..3599d89a5aba 100644 --- a/ext/standard/tests/filters/bug79468.phpt +++ b/ext/standard/tests/filters/bug79468.phpt @@ -14,8 +14,8 @@ fclose($fp); try { stream_filter_remove($rot13_filter); } catch (\Throwable $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(79) "stream_filter_remove(): supplied resource is not a valid stream filter resource" +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource diff --git a/ext/standard/tests/filters/gh20370.phpt b/ext/standard/tests/filters/gh20370.phpt index abcf49bfc9f4..4a19c75dcffc 100644 --- a/ext/standard/tests/filters/gh20370.phpt +++ b/ext/standard/tests/filters/gh20370.phpt @@ -26,13 +26,13 @@ stream_filter_append($fp, "pass"); try { fwrite($fp, "data"); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { fclose($fp); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($fp); // prevent cleanup at shutdown diff --git a/ext/standard/tests/filters/object_init_failure.phpt b/ext/standard/tests/filters/object_init_failure.phpt index 3a88d87ccab0..c09a93dd77bd 100644 --- a/ext/standard/tests/filters/object_init_failure.phpt +++ b/ext/standard/tests/filters/object_init_failure.phpt @@ -9,11 +9,11 @@ stream_filter_register('sample.filter', SampleFilter::class); try { var_dump(file_get_contents('php://filter/read=sample.filter/resource='. __FILE__)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: file_get_contents(): Unable to create or locate filter "sample.filter" in %s on line %d Warning: file_get_contents(): Unable to create filter (sample.filter) in %s on line %d -Undefined constant "FOO" +Error: Undefined constant "FOO" diff --git a/ext/standard/tests/filters/object_init_failure_2.phpt b/ext/standard/tests/filters/object_init_failure_2.phpt index 32473bc83127..e648eca26b1d 100644 --- a/ext/standard/tests/filters/object_init_failure_2.phpt +++ b/ext/standard/tests/filters/object_init_failure_2.phpt @@ -9,11 +9,11 @@ stream_filter_register('sample.filter', SampleFilter::class); try { include 'php://filter/read=sample.filter/resource='. __FILE__; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: main(): Unable to create or locate filter "sample.filter" in %s on line %d Warning: main(): Unable to create filter (sample.filter) in %s on line %d -Undefined constant "FOO" +Error: Undefined constant "FOO" diff --git a/ext/standard/tests/filters/stream_filter_remove_error.phpt b/ext/standard/tests/filters/stream_filter_remove_error.phpt index c16614f59417..3b551a836393 100644 --- a/ext/standard/tests/filters/stream_filter_remove_error.phpt +++ b/ext/standard/tests/filters/stream_filter_remove_error.phpt @@ -18,7 +18,7 @@ echo "\n-- Testing stream_filter_remove() function with bad resource --\n"; try { stream_filter_remove($fp); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Testing stream_filter_remove() function with an already removed filter --\n"; @@ -27,7 +27,7 @@ var_dump(stream_filter_remove( $filter )); try { stream_filter_remove($filter); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } fclose( $fp ); @@ -42,8 +42,8 @@ $file = __DIR__ . DIRECTORY_SEPARATOR . 'streamfilterTestErrors.txt'; *** Testing stream_filter_remove() : error conditions *** -- Testing stream_filter_remove() function with bad resource -- -stream_filter_remove(): supplied resource is not a valid stream filter resource +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource -- Testing stream_filter_remove() function with an already removed filter -- bool(true) -stream_filter_remove(): supplied resource is not a valid stream filter resource +TypeError: stream_filter_remove(): supplied resource is not a valid stream filter resource diff --git a/ext/standard/tests/general_functions/010.phpt b/ext/standard/tests/general_functions/010.phpt index 08c941331f54..31d64eb5bd3e 100644 --- a/ext/standard/tests/general_functions/010.phpt +++ b/ext/standard/tests/general_functions/010.phpt @@ -14,11 +14,11 @@ class test { try { var_dump(register_shutdown_function(array("test","__call"))); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method test::__call() cannot be called statically Done diff --git a/ext/standard/tests/general_functions/bug25038.phpt b/ext/standard/tests/general_functions/bug25038.phpt index 58acf1c977c0..3d6e3bc545ad 100644 --- a/ext/standard/tests/general_functions/bug25038.phpt +++ b/ext/standard/tests/general_functions/bug25038.phpt @@ -13,7 +13,7 @@ try } catch (Exception $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -21,10 +21,10 @@ try } catch (Exception $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -This is an exception from bar(first try). -This is an exception from bar(second try). +Exception: This is an exception from bar(first try). +Exception: This is an exception from bar(second try). diff --git a/ext/standard/tests/general_functions/bug31190.phpt b/ext/standard/tests/general_functions/bug31190.phpt index 1a7917d47e4c..67516b8886e4 100644 --- a/ext/standard/tests/general_functions/bug31190.phpt +++ b/ext/standard/tests/general_functions/bug31190.phpt @@ -11,15 +11,16 @@ $array = array(new test(), 'throwException'); try { call_user_func($array, 1, 2); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { call_user_func_array($array, array(1, 2)); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Hello World! -Hello World! +Exception: Hello World! + +Exception: Hello World! diff --git a/ext/standard/tests/general_functions/bug32647.phpt b/ext/standard/tests/general_functions/bug32647.phpt index 2e388d474206..347000b5d994 100644 --- a/ext/standard/tests/general_functions/bug32647.phpt +++ b/ext/standard/tests/general_functions/bug32647.phpt @@ -19,37 +19,37 @@ unset($obj); try { register_shutdown_function(array($obj,"")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array($obj,"some string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array('bar','foo')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function(array(0,"some string")); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { register_shutdown_function('bar'); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } register_shutdown_function('foo'); @@ -57,7 +57,7 @@ register_shutdown_function('foo'); try { register_shutdown_function(array('bar','barfoo')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $obj = new bar; @@ -65,7 +65,7 @@ $obj = new bar; try { register_shutdown_function(array($obj,'foobar')); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } register_shutdown_function(array($obj,'barfoo')); @@ -73,15 +73,15 @@ register_shutdown_function(array($obj,'barfoo')); ?> --EXPECTF-- Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object Warning: Undefined variable $obj in %s on line %d -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically -register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar" +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foo" +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, function "bar" not found or invalid function name +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, non-static method bar::barfoo() cannot be called statically +TypeError: register_shutdown_function(): Argument #1 ($callback) must be a valid callback, class bar does not have a method "foobar" foo! bar! diff --git a/ext/standard/tests/general_functions/bug41037.phpt b/ext/standard/tests/general_functions/bug41037.phpt index 683b18ec2515..74162fc2a091 100644 --- a/ext/standard/tests/general_functions/bug41037.phpt +++ b/ext/standard/tests/general_functions/bug41037.phpt @@ -8,7 +8,7 @@ function a() { try { unregister_tick_function('a'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -20,7 +20,7 @@ declare (ticks=1) { ?> --EXPECT-- hello -Registered tick function cannot be unregistered while it is being executed +Error: Registered tick function cannot be unregistered while it is being executed Done hello -Registered tick function cannot be unregistered while it is being executed +Error: Registered tick function cannot be unregistered while it is being executed diff --git a/ext/standard/tests/general_functions/bug41970.phpt b/ext/standard/tests/general_functions/bug41970.phpt index 4d7826120858..c18ccd181d2a 100644 --- a/ext/standard/tests/general_functions/bug41970.phpt +++ b/ext/standard/tests/general_functions/bug41970.phpt @@ -9,13 +9,13 @@ var_dump(call_user_func_array("sort", array($a))); try { var_dump(call_user_func_array("strlen", array($a))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(call_user_func("sort", $a)); try { var_dump(call_user_func("strlen", $a)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -23,9 +23,9 @@ echo "Done\n"; --EXPECTF-- Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d bool(true) -strlen(): Argument #1 ($string) must be of type string, array given +TypeError: strlen(): Argument #1 ($string) must be of type string, array given Warning: sort(): Argument #1 ($array) must be passed by reference, value given in %s on line %d bool(true) -strlen(): Argument #1 ($string) must be of type string, array given +TypeError: strlen(): Argument #1 ($string) must be of type string, array given Done diff --git a/ext/standard/tests/general_functions/bug44295.phpt b/ext/standard/tests/general_functions/bug44295.phpt index 131f6496b7b4..2ad19d08db0f 100644 --- a/ext/standard/tests/general_functions/bug44295.phpt +++ b/ext/standard/tests/general_functions/bug44295.phpt @@ -18,12 +18,12 @@ try { print get_class($iter) . "\n"; print "after\n"; } catch (Exception $e) { - print "in catch: ".$e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ==DONE== --EXPECT-- before -in catch: DirectoryIterator::__construct(): Failed to open directory: No such file or directory +UnexpectedValueException: DirectoryIterator::__construct(): Failed to open directory: No such file or directory ==DONE== diff --git a/ext/standard/tests/general_functions/bug47857.phpt b/ext/standard/tests/general_functions/bug47857.phpt index 0d2b35b09f78..d9bdfa25ba82 100644 --- a/ext/standard/tests/general_functions/bug47857.phpt +++ b/ext/standard/tests/general_functions/bug47857.phpt @@ -11,17 +11,17 @@ var_dump(is_callable(array('foo','bar'))); try { foo::bar(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(is_callable(array('Exception','getMessage'))); try { Exception::getMessage(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(false) -Non-static method foo::bar() cannot be called statically +Error: Non-static method foo::bar() cannot be called statically bool(false) -Non-static method Exception::getMessage() cannot be called statically +Error: Non-static method Exception::getMessage() cannot be called statically diff --git a/ext/standard/tests/general_functions/bug72920.phpt b/ext/standard/tests/general_functions/bug72920.phpt index cee43561de91..d5fe5c9942ec 100644 --- a/ext/standard/tests/general_functions/bug72920.phpt +++ b/ext/standard/tests/general_functions/bug72920.phpt @@ -9,8 +9,8 @@ class Foo { try { var_dump(constant('Foo::C1')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access private constant Foo::C1 +Error: Cannot access private constant Foo::C1 diff --git a/ext/standard/tests/general_functions/callbacks_001.phpt b/ext/standard/tests/general_functions/callbacks_001.phpt index f173ca851613..63bed3c9793b 100644 --- a/ext/standard/tests/general_functions/callbacks_001.phpt +++ b/ext/standard/tests/general_functions/callbacks_001.phpt @@ -72,7 +72,7 @@ class P extends O { try { $this->call(array($this, 'B::who')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -120,4 +120,4 @@ $this|O::who Deprecated: Callables of the form ["P", "O::who"] are deprecated in %s on line %d O $this|B::who -call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class P is not a subclass of B diff --git a/ext/standard/tests/general_functions/callbacks_002.phpt b/ext/standard/tests/general_functions/callbacks_002.phpt index 11d8d9a690ed..93cbcf07bd5c 100644 --- a/ext/standard/tests/general_functions/callbacks_002.phpt +++ b/ext/standard/tests/general_functions/callbacks_002.phpt @@ -6,21 +6,21 @@ call_user_func(): Wrong parameters try { call_user_func(array('Foo', 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array(NULL, 'bar')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { call_user_func(array('stdclass', NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found -call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object -call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "Foo" not found +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, first array member is not a valid class name or object +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, second array member is not a valid method diff --git a/ext/standard/tests/general_functions/dl_null_bytes.phpt b/ext/standard/tests/general_functions/dl_null_bytes.phpt index 7f251393ba3b..104f653f3b56 100644 --- a/ext/standard/tests/general_functions/dl_null_bytes.phpt +++ b/ext/standard/tests/general_functions/dl_null_bytes.phpt @@ -6,9 +6,9 @@ dl() rejects null bytes in extension filename try { dl("foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -dl(): Argument #1 ($extension_filename) must not contain any null bytes +ValueError: dl(): Argument #1 ($extension_filename) must not contain any null bytes diff --git a/ext/standard/tests/general_functions/error_get_last.phpt b/ext/standard/tests/general_functions/error_get_last.phpt index 1e7516970ef0..6d5b7058739a 100644 --- a/ext/standard/tests/general_functions/error_get_last.phpt +++ b/ext/standard/tests/general_functions/error_get_last.phpt @@ -7,7 +7,7 @@ var_dump(error_get_last()); try { var_dump(error_get_last(true)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(error_get_last()); @@ -19,7 +19,7 @@ echo "Done\n"; ?> --EXPECTF-- NULL -error_get_last() expects exactly 0 arguments, 1 given +ArgumentCountError: error_get_last() expects exactly 0 arguments, 1 given NULL Warning: Undefined variable $b in %s on line %d diff --git a/ext/standard/tests/general_functions/gettype_settype_basic.phpt b/ext/standard/tests/general_functions/gettype_settype_basic.phpt index a5e1a0b5bf3c..3f3664903303 100644 --- a/ext/standard/tests/general_functions/gettype_settype_basic.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_basic.phpt @@ -97,7 +97,7 @@ foreach ($types as $type) { // check the new type var_dump( gettype($var) ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } @@ -537,33 +537,33 @@ string(7) "boolean" -- Setting type of data to resource -- -- Iteration 1 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 2 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 3 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 4 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 5 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 6 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 7 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 8 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 9 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 10 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 11 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 12 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 13 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Iteration 14 -- -Cannot convert to resource type +ValueError: Cannot convert to resource type -- Setting type of data to array -- -- Iteration 1 -- diff --git a/ext/standard/tests/general_functions/gettype_settype_error.phpt b/ext/standard/tests/general_functions/gettype_settype_error.phpt index a495ff6c2917..8c13d2d29fe3 100644 --- a/ext/standard/tests/general_functions/gettype_settype_error.phpt +++ b/ext/standard/tests/general_functions/gettype_settype_error.phpt @@ -12,7 +12,7 @@ echo "\n*** Testing settype(): error conditions ***\n"; try { settype( $var, "unknown" ); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -21,5 +21,5 @@ echo "Done\n"; **** Testing gettype() and settype() functions **** *** Testing settype(): error conditions *** -settype(): Argument #2 ($type) must be a valid type +ValueError: settype(): Argument #2 ($type) must be a valid type Done diff --git a/ext/standard/tests/general_functions/gh21058.phpt b/ext/standard/tests/general_functions/gh21058.phpt index 598625a2017e..04b4082d7b50 100644 --- a/ext/standard/tests/general_functions/gh21058.phpt +++ b/ext/standard/tests/general_functions/gh21058.phpt @@ -6,8 +6,8 @@ GH-21058 (error_log() crash with null destination and message type 3) try { error_log("test", 3, null); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Path must not be empty +ValueError: Path must not be empty diff --git a/ext/standard/tests/general_functions/gh9905.phpt b/ext/standard/tests/general_functions/gh9905.phpt index 33d2f4f73702..e5e0c4d99f6c 100644 --- a/ext/standard/tests/general_functions/gh9905.phpt +++ b/ext/standard/tests/general_functions/gh9905.phpt @@ -5,8 +5,8 @@ GH-9905 (constant() behaves inconsistent when class is undefined) try { \constant("\NonExistantClass::non_existant_constant"); } catch (\Throwable|\Error|\Exception $e) { - echo($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Class "NonExistantClass" not found +Error: Class "NonExistantClass" not found diff --git a/ext/standard/tests/general_functions/ini_set_types.phpt b/ext/standard/tests/general_functions/ini_set_types.phpt index 16def381db8c..ba7274d90a36 100644 --- a/ext/standard/tests/general_functions/ini_set_types.phpt +++ b/ext/standard/tests/general_functions/ini_set_types.phpt @@ -21,7 +21,7 @@ var_dump(ini_get('user_agent')); try { ini_set('foo', []); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -31,4 +31,4 @@ string(1) "1" string(0) "" string(1) "6" string(4) "3.14" -ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null +TypeError: ini_set(): Argument #2 ($value) must be of type string|int|float|bool|null diff --git a/ext/standard/tests/general_functions/is_countable_with_variables.phpt b/ext/standard/tests/general_functions/is_countable_with_variables.phpt index e2711a8c54d6..7089aede4cef 100644 --- a/ext/standard/tests/general_functions/is_countable_with_variables.phpt +++ b/ext/standard/tests/general_functions/is_countable_with_variables.phpt @@ -19,7 +19,7 @@ if (!is_countable($bar)) { try { count($bar); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> @@ -28,4 +28,4 @@ bool(true) bool(true) bool(false) int(2) -count(): Argument #1 ($value) must be of type Countable|array, null given +TypeError: count(): Argument #1 ($value) must be of type Countable|array, null given diff --git a/ext/standard/tests/general_functions/proc_open_array.phpt b/ext/standard/tests/general_functions/proc_open_array.phpt index a76f1111ef26..822719c7e414 100644 --- a/ext/standard/tests/general_functions/proc_open_array.phpt +++ b/ext/standard/tests/general_functions/proc_open_array.phpt @@ -14,28 +14,28 @@ echo "Empty command array:\n"; try { proc_open([], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nNul byte in program name:\n"; try { proc_open(["php\0oops"], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nNul byte in argument:\n"; try { proc_open(["php", "array\0oops"], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nEmpty program name:\n"; try { proc_open([""], $ds, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nBasic usage:\n"; @@ -76,16 +76,16 @@ proc_close($proc); ?> --EXPECT-- Empty command array: -proc_open(): Argument #1 ($command) must not be empty +ValueError: proc_open(): Argument #1 ($command) must not be empty Nul byte in program name: -Command array element 1 contains a null byte +ValueError: Command array element 1 contains a null byte Nul byte in argument: -Command array element 2 contains a null byte +ValueError: Command array element 2 contains a null byte Empty program name: -First element must contain a non-empty program name +ValueError: First element must contain a non-empty program name Basic usage: Hello World! diff --git a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt index faa86c824177..da6419edfc1c 100644 --- a/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt +++ b/ext/standard/tests/general_functions/proc_open_cwd_null_bytes.phpt @@ -10,9 +10,9 @@ if (!function_exists("proc_open")) echo "skip proc_open() is not available"; try { proc_open("does_not_matter", [], $pipes, "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -proc_open(): Argument #4 ($cwd) must not contain any null bytes +ValueError: proc_open(): Argument #4 ($cwd) must not contain any null bytes diff --git a/ext/standard/tests/general_functions/proc_open_pipes3.phpt b/ext/standard/tests/general_functions/proc_open_pipes3.phpt index 8f065401eb14..669b7127d164 100644 --- a/ext/standard/tests/general_functions/proc_open_pipes3.phpt +++ b/ext/standard/tests/general_functions/proc_open_pipes3.phpt @@ -18,7 +18,7 @@ $spec[$i] = 1; try { proc_open("$php -n $callee_escaped", $spec, $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $spec[$i] = array('pipe', "test"); @@ -33,7 +33,7 @@ echo "END\n"; ?> --EXPECTF-- Warning: proc_open(): pi is not a valid descriptor spec/mode in %s on line %d -proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams +ValueError: proc_open(): Argument #2 ($descriptor_spec) must only contain arrays and streams array(4) { [3]=> resource(%d) of type (Unknown) diff --git a/ext/standard/tests/general_functions/proc_open_redirect.phpt b/ext/standard/tests/general_functions/proc_open_redirect.phpt index 76940b715d8b..bb4a6284a567 100644 --- a/ext/standard/tests/general_functions/proc_open_redirect.phpt +++ b/ext/standard/tests/general_functions/proc_open_redirect.phpt @@ -7,19 +7,19 @@ $php = getenv('TEST_PHP_EXECUTABLE'); try { proc_open([$php], [['redirect']], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 'foo']], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { proc_open([$php], [['redirect', 42]], $pipes); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\nWith pipe:\n"; @@ -52,8 +52,8 @@ proc_close($proc); ?> --EXPECTF-- -Missing redirection target -Redirection target must be of type int, string given +ValueError: Missing redirection target +ValueError: Redirection target must be of type int, string given Warning: proc_open(): Redirection target 42 not found in %s diff --git a/ext/standard/tests/general_functions/putenv.phpt b/ext/standard/tests/general_functions/putenv.phpt index 40799b25790f..ff4d3572f24d 100644 --- a/ext/standard/tests/general_functions/putenv.phpt +++ b/ext/standard/tests/general_functions/putenv.phpt @@ -18,13 +18,13 @@ var_dump(getenv($var_name)); try { putenv("=123"); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { putenv(""); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -37,6 +37,6 @@ bool(true) string(0) "" bool(true) bool(false) -putenv(): Argument #1 ($assignment) must have a valid syntax -putenv(): Argument #1 ($assignment) must have a valid syntax +ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax +ValueError: putenv(): Argument #1 ($assignment) must have a valid syntax Done diff --git a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt index 28a346237338..e980ab366766 100644 --- a/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt +++ b/ext/standard/tests/general_functions/putenv_and_getenv_reject_null_bytes.phpt @@ -7,7 +7,7 @@ foreach ([false, true] as $local_only) { try { getenv("PHP_GETENV_NUL_TEST\0SUFFIX", $local_only); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -20,7 +20,7 @@ foreach ([ try { putenv($assignment); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -28,8 +28,8 @@ var_dump(getenv($var_name)); ?> --EXPECT-- -getenv(): Argument #1 ($name) must not contain any null bytes -getenv(): Argument #1 ($name) must not contain any null bytes -putenv(): Argument #1 ($assignment) must not contain any null bytes -putenv(): Argument #1 ($assignment) must not contain any null bytes +ValueError: getenv(): Argument #1 ($name) must not contain any null bytes +ValueError: getenv(): Argument #1 ($name) must not contain any null bytes +ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes +ValueError: putenv(): Argument #1 ($assignment) must not contain any null bytes bool(false) diff --git a/ext/standard/tests/general_functions/register_tick_function_error.phpt b/ext/standard/tests/general_functions/register_tick_function_error.phpt index 9eae12c5b692..5404015bfb6e 100644 --- a/ext/standard/tests/general_functions/register_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/register_tick_function_error.phpt @@ -7,8 +7,8 @@ declare(ticks=1); try { register_tick_function("a"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name +TypeError: register_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name diff --git a/ext/standard/tests/general_functions/settype_typed_property.phpt b/ext/standard/tests/general_functions/settype_typed_property.phpt index a206a4ba41b2..e2fce970f6fa 100644 --- a/ext/standard/tests/general_functions/settype_typed_property.phpt +++ b/ext/standard/tests/general_functions/settype_typed_property.phpt @@ -17,12 +17,12 @@ var_dump($test->x); try { settype($test->x, 'array'); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($test->x); ?> --EXPECT-- int(42) -Cannot assign array to reference held by property Test::$x of type int +TypeError: Cannot assign array to reference held by property Test::$x of type int int(42) diff --git a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt index 6f0a7b3fa9e8..abecb1578fb8 100644 --- a/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt +++ b/ext/standard/tests/general_functions/sleep_usleep_uint_overflow.phpt @@ -14,12 +14,12 @@ foreach (['sleep', 'usleep'] as $function) { try { $function(4294967296); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECTF-- int(0) usleep(0) ok -sleep(): Argument #1 ($seconds) must be between 0 and %d -usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295 +ValueError: sleep(): Argument #1 ($seconds) must be between 0 and %d +ValueError: usleep(): Argument #1 ($microseconds) must be between 0 and 4294967295 diff --git a/ext/standard/tests/general_functions/type.phpt b/ext/standard/tests/general_functions/type.phpt index a43640f09eba..9db37a2de0a4 100644 --- a/ext/standard/tests/general_functions/type.phpt +++ b/ext/standard/tests/general_functions/type.phpt @@ -50,7 +50,7 @@ foreach ($types as $type) { try { var_dump(settype($var, $type)); } catch (Error $e) { - echo "Error: ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($var); } @@ -160,7 +160,7 @@ bool(true) bool(true) bool(true) bool(true) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type array(3) { [0]=> int(1) @@ -169,9 +169,9 @@ array(3) { [2]=> int(3) } -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type string(14) "another string" -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type array(3) { [0]=> int(2) @@ -180,21 +180,21 @@ array(3) { [2]=> int(4) } -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type int(1) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type float(2) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type NULL -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type bool(false) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type string(11) "some string" -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type resource(%d) of type (Unknown) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type resource(%d) of type (stream) -Error: Cannot convert to resource type +ValueError: Cannot convert to resource type object(stdClass)#%d (0) { } bool(true) diff --git a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt index fd96a4658faa..291ae260b17b 100644 --- a/ext/standard/tests/general_functions/unregister_tick_function_error.phpt +++ b/ext/standard/tests/general_functions/unregister_tick_function_error.phpt @@ -7,8 +7,8 @@ declare(ticks=1); try { unregister_tick_function("a"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name +TypeError: unregister_tick_function(): Argument #1 ($callback) must be a valid callback, function "a" not found or invalid function name diff --git a/ext/standard/tests/general_functions/var_export_basic2.phpt b/ext/standard/tests/general_functions/var_export_basic2.phpt index b5895f805da3..f9387b5a6afb 100644 --- a/ext/standard/tests/general_functions/var_export_basic2.phpt +++ b/ext/standard/tests/general_functions/var_export_basic2.phpt @@ -65,4 +65,3 @@ string(5) "false" false false string(5) "false" - diff --git a/ext/standard/tests/general_functions/var_export_basic3.phpt b/ext/standard/tests/general_functions/var_export_basic3.phpt index 66e87f093ace..51a30a92171b 100644 --- a/ext/standard/tests/general_functions/var_export_basic3.phpt +++ b/ext/standard/tests/general_functions/var_export_basic3.phpt @@ -164,4 +164,3 @@ string(22) "5.0000000000000001E+42" 3.4000000000000001E-33 3.4000000000000001E-33 string(22) "3.4000000000000001E-33" - diff --git a/ext/standard/tests/general_functions/var_export_basic4.phpt b/ext/standard/tests/general_functions/var_export_basic4.phpt index 4d41d2f38d01..193e5ea10e6a 100644 --- a/ext/standard/tests/general_functions/var_export_basic4.phpt +++ b/ext/standard/tests/general_functions/var_export_basic4.phpt @@ -135,4 +135,3 @@ string(7) "'\\060'" '8' '8' string(3) "'8'" - diff --git a/ext/standard/tests/general_functions/var_export_basic5.phpt b/ext/standard/tests/general_functions/var_export_basic5.phpt index 4712ba37a904..5b1a137eea93 100644 --- a/ext/standard/tests/general_functions/var_export_basic5.phpt +++ b/ext/standard/tests/general_functions/var_export_basic5.phpt @@ -267,4 +267,3 @@ string(41) "array ( 0 => 'string', 1 => 'test', )" - diff --git a/ext/standard/tests/general_functions/var_export_basic7.phpt b/ext/standard/tests/general_functions/var_export_basic7.phpt index 01ffd5fbe535..8ae608441010 100644 --- a/ext/standard/tests/general_functions/var_export_basic7.phpt +++ b/ext/standard/tests/general_functions/var_export_basic7.phpt @@ -48,4 +48,3 @@ string(4) "NULL" NULL NULL string(4) "NULL" - diff --git a/ext/standard/tests/http/gh15650.phpt b/ext/standard/tests/http/gh15650.phpt index 69655ce407ea..9cea248b667e 100644 --- a/ext/standard/tests/http/gh15650.phpt +++ b/ext/standard/tests/http/gh15650.phpt @@ -20,13 +20,13 @@ echo http_build_query(['e1' => E1::C, 'e2' => E2::C]), "\n"; try { echo http_build_query(['e3' => E3::C]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { echo http_build_query(E1::C); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/http_build_query/gh20583.phpt b/ext/standard/tests/http/http_build_query/gh20583.phpt index 2d93d3b6f448..74b5efd1b080 100644 --- a/ext/standard/tests/http/http_build_query/gh20583.phpt +++ b/ext/standard/tests/http/http_build_query/gh20583.phpt @@ -20,7 +20,7 @@ for ($i = 0; $i < 3000; $i++) { try { http_build_query($a, 'p'); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- diff --git a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt index 980b44e94899..39e6bd291485 100644 --- a/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt +++ b/ext/standard/tests/http/request_parse_body/invalid_boundary.phpt @@ -11,7 +11,7 @@ empty try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt index 521de0805bf4..b22d57bccf9e 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_garbled.phpt @@ -18,7 +18,7 @@ post field data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt index 9c4fe6c3cd7b..0a6fec7e430c 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_files.phpt @@ -23,7 +23,7 @@ file data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt index 384344e6c176..4747a7da6917 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_input_vars.phpt @@ -21,7 +21,7 @@ post field data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt index 776741003037..96fb2a4470ed 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_max_parts.phpt @@ -22,7 +22,7 @@ file data try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt index 9656071c765b..70403fe66975 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_missing_boundary.phpt @@ -13,7 +13,7 @@ $stream = fopen('php://memory','r+'); try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt index acad79c9e338..a915da3de55b 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_key.phpt @@ -6,13 +6,13 @@ request_parse_body() invalid key try { request_parse_body(options: ['foo' => 1]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { request_parse_body(options: [42 => 1]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt index b1efa0dbc91a..6a081ae3def9 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_quantity.phpt @@ -8,7 +8,7 @@ try { 'upload_max_filesize' => '1GB', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt index b61416cdf13d..5ae4b8dc8560 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_invalid_value_type.phpt @@ -8,7 +8,7 @@ try { 'max_input_vars' => [], ]); } catch (Error $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt index ad0c2a906237..f8a0ab49b500 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_files.phpt @@ -25,7 +25,7 @@ try { 'max_file_uploads' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt index 990102abd853..d52cf1f4c304 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_input_vars.phpt @@ -23,7 +23,7 @@ try { 'max_input_vars' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt index e9d8d51b2428..8a2065e8f138 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_max_parts.phpt @@ -24,7 +24,7 @@ try { 'max_multipart_body_parts' => 1, ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt index 7a66faa7dba4..564277c7e37b 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_post_max_size.phpt @@ -23,7 +23,7 @@ try { 'post_max_size' => '302', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt index 981a1d6799d1..2e5cd9675663 100644 --- a/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt +++ b/ext/standard/tests/http/request_parse_body/multipart_options_upload_max_filesize.phpt @@ -19,7 +19,7 @@ try { 'upload_max_filesize' => '128', ]); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/http/request_parse_body/options_array_references.phpt b/ext/standard/tests/http/request_parse_body/options_array_references.phpt index 6c6c0c157651..19c0d91d9b06 100644 --- a/ext/standard/tests/http/request_parse_body/options_array_references.phpt +++ b/ext/standard/tests/http/request_parse_body/options_array_references.phpt @@ -7,8 +7,8 @@ foreach ($options as $k => &$v) {} try { request_parse_body($options); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Request does not provide a content type +RequestParseBodyException: Request does not provide a content type diff --git a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt index 087b11841cab..9eb4f739b03b 100644 --- a/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt +++ b/ext/standard/tests/http/request_parse_body/unsupported_content_type.phpt @@ -13,7 +13,7 @@ Content-Type: application/json try { [$_POST, $_FILES] = request_parse_body(); } catch (Throwable $e) { - echo get_class($e), ': ', $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($_POST, $_FILES); diff --git a/ext/standard/tests/mail/gh13415.phpt b/ext/standard/tests/mail/gh13415.phpt index f507259a8e26..6dac8c527b0b 100644 --- a/ext/standard/tests/mail/gh13415.phpt +++ b/ext/standard/tests/mail/gh13415.phpt @@ -8,28 +8,28 @@ echo "LF only:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \nCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "CR only:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \rCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "CRLF:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \r\nCc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "NULL:\n"; try { mail('to@example.com', 'Test Subject', 'A Message', ['Reply-To' => "foo@example.com \0Cc: hacker@example.com"]); } catch (Throwable $e) { - echo $e->getMessage()."\n\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -40,13 +40,10 @@ if (file_exists('gh13415.out')) { ?> --EXPECTF-- LF only: -Header "Reply-To" contains LF character that is not allowed in the header - +ValueError: Header "Reply-To" contains LF character that is not allowed in the header CR only: -Header "Reply-To" contains CR character that is not allowed in the header - +ValueError: Header "Reply-To" contains CR character that is not allowed in the header CRLF: -Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header - +ValueError: Header "Reply-To" contains CRLF characters that are used as a line separator and are not allowed in the header NULL: -Header "Reply-To" contains NULL character that is not allowed in the header +ValueError: Header "Reply-To" contains NULL character that is not allowed in the header diff --git a/ext/standard/tests/mail/gh7875.phpt b/ext/standard/tests/mail/gh7875.phpt index 1f8346a0715d..4fc431186717 100644 --- a/ext/standard/tests/mail/gh7875.phpt +++ b/ext/standard/tests/mail/gh7875.phpt @@ -35,7 +35,7 @@ try { mail('recipient@example.com', 'Subject', 'Body', []); echo 'Not Reached'; } catch (\Exception $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump(file_exists(__DIR__ . "/gh7875.mail.out")); } ?> @@ -46,5 +46,5 @@ try { @unlink(__DIR__ . "/gh7875.mail.out"); ?> --EXPECTF-- -mail(): Failed to open stream: Permission denied +ErrorException: mail(): Failed to open stream: Permission denied bool(false) diff --git a/ext/standard/tests/mail/mail_basic7.phpt b/ext/standard/tests/mail/mail_basic7.phpt index ffc3fd241f00..c5be7464f3bf 100644 --- a/ext/standard/tests/mail/mail_basic7.phpt +++ b/ext/standard/tests/mail/mail_basic7.phpt @@ -44,49 +44,49 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['orig-date' => array('foo1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['from' => array('foo2')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['sender' => array('foo3')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['reply-to' => array('foo4')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['to' => array('foo5')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['bcc' => array('foo6')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['message-id' => array('foo7')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['in-reply-to'=> array('foo8')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -99,43 +99,43 @@ $message = 'A Message'; try { mail($to, $subject, $message, ['foo1' => array('foo2'=>'bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo2' => array('foo2', array('foo3'))]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo3' => array(123)]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo4' => array(123.456)]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo5' => array(FALSE)]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo6' => array(NULL)]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo7' => array(new StdClass)]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n\n************* TEST ******************\n"; @@ -151,49 +151,49 @@ $outFile = "mailBasic7.out"; try { mail($to, $subject, $message, ['*:foo1' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo2:::' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo3()' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo4@' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ['foo5|' => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["\0foo6" => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["foo7\0" => array('bar1')]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { mail($to, $subject, $message, ["foo8" => array()]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(mail($to, $subject, $message, ["foo9" => '%&$#!'])); @@ -203,7 +203,7 @@ unlink($outFile); try { mail($to, $subject, $message, ["foo10" => "abc\0\tdef"]); } catch (TypeError|ValueError $exception) { - echo get_class($exception) . ": " . $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> diff --git a/ext/standard/tests/mail/mail_null_bytes.phpt b/ext/standard/tests/mail/mail_null_bytes.phpt index 2254b7b8fff3..b20874f0000d 100644 --- a/ext/standard/tests/mail/mail_null_bytes.phpt +++ b/ext/standard/tests/mail/mail_null_bytes.phpt @@ -6,33 +6,33 @@ mail() with null bytes in arguments try { mail("foo\0bar", "x", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "foo\0bar", "y"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { mail("x", "y", "z", "q", "foo\0bar"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -mail(): Argument #1 ($to) must not contain any null bytes -mail(): Argument #2 ($subject) must not contain any null bytes -mail(): Argument #3 ($message) must not contain any null bytes -mail(): Argument #4 ($additional_headers) must not contain any null bytes -mail(): Argument #5 ($additional_params) must not contain any null bytes +ValueError: mail(): Argument #1 ($to) must not contain any null bytes +ValueError: mail(): Argument #2 ($subject) must not contain any null bytes +ValueError: mail(): Argument #3 ($message) must not contain any null bytes +ValueError: mail(): Argument #4 ($additional_headers) must not contain any null bytes +ValueError: mail(): Argument #5 ($additional_params) must not contain any null bytes diff --git a/ext/standard/tests/math/abs_variation.phpt b/ext/standard/tests/math/abs_variation.phpt index d7f878bc01bb..b74f9a9d2053 100644 --- a/ext/standard/tests/math/abs_variation.phpt +++ b/ext/standard/tests/math/abs_variation.phpt @@ -71,7 +71,7 @@ foreach($inputs as $input) { try { var_dump(abs($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -104,25 +104,25 @@ int(1) int(0) -- Iteration 7 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -abs(): Argument #1 ($num) must be of type int|float, array given +TypeError: abs(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -abs(): Argument #1 ($num) must be of type int|float, string given +TypeError: abs(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -abs(): Argument #1 ($num) must be of type int|float, classA given +TypeError: abs(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -135,4 +135,4 @@ Deprecated: abs(): Passing null to parameter #1 ($num) of type int|float is depr int(0) -- Iteration 16 -- -abs(): Argument #1 ($num) must be of type int|float, resource given +TypeError: abs(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/base_convert_error.phpt b/ext/standard/tests/math/base_convert_error.phpt index 3d253606e034..7acce904e018 100644 --- a/ext/standard/tests/math/base_convert_error.phpt +++ b/ext/standard/tests/math/base_convert_error.phpt @@ -12,23 +12,23 @@ class classA try { base_convert(1234, 1, 10); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(1234, 10, 37); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { base_convert(new classA(), 8, 10); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing base_convert() : error conditions *** -base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive) -base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive) -base_convert(): Argument #1 ($num) must be of type string, classA given +ValueError: base_convert(): Argument #2 ($from_base) must be between 2 and 36 (inclusive) +ValueError: base_convert(): Argument #3 ($to_base) must be between 2 and 36 (inclusive) +TypeError: base_convert(): Argument #1 ($num) must be of type string, classA given diff --git a/ext/standard/tests/math/base_convert_variation1.phpt b/ext/standard/tests/math/base_convert_variation1.phpt index fd06465ab574..5093059fc91d 100644 --- a/ext/standard/tests/math/base_convert_variation1.phpt +++ b/ext/standard/tests/math/base_convert_variation1.phpt @@ -55,7 +55,7 @@ foreach($inputs as $input) { try { var_dump(base_convert($input, 10, 8)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; } @@ -125,7 +125,7 @@ string(1) "0" string(1) "0" -- Iteration 17 -- -base_convert(): Argument #1 ($num) must be of type string, array given +TypeError: base_convert(): Argument #1 ($num) must be of type string, array given -- Iteration 18 -- @@ -143,4 +143,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been string(1) "0" -- Iteration 21 -- -base_convert(): Argument #1 ($num) must be of type string, resource given +TypeError: base_convert(): Argument #1 ($num) must be of type string, resource given diff --git a/ext/standard/tests/math/bindec_variation1_64bit.phpt b/ext/standard/tests/math/bindec_variation1_64bit.phpt index 56bbbd35649b..c5a48f79ea41 100644 --- a/ext/standard/tests/math/bindec_variation1_64bit.phpt +++ b/ext/standard/tests/math/bindec_variation1_64bit.phpt @@ -58,7 +58,7 @@ foreach($inputs as $input) { try { var_dump(bindec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -127,7 +127,7 @@ int(0) int(0) -- Iteration 16 -- -bindec(): Argument #1 ($binary_string) must be of type string, array given +TypeError: bindec(): Argument #1 ($binary_string) must be of type string, array given -- Iteration 17 -- @@ -145,4 +145,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(0) -- Iteration 20 -- -bindec(): Argument #1 ($binary_string) must be of type string, resource given +TypeError: bindec(): Argument #1 ($binary_string) must be of type string, resource given diff --git a/ext/standard/tests/math/ceil_variation1.phpt b/ext/standard/tests/math/ceil_variation1.phpt index 7751946ea954..dcf201bfc00c 100644 --- a/ext/standard/tests/math/ceil_variation1.phpt +++ b/ext/standard/tests/math/ceil_variation1.phpt @@ -65,7 +65,7 @@ foreach($inputs as $input) { try { var_dump(ceil($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -97,25 +97,25 @@ float(1) float(0) -- Iteration 7 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -ceil(): Argument #1 ($num) must be of type int|float, array given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -ceil(): Argument #1 ($num) must be of type int|float, string given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -ceil(): Argument #1 ($num) must be of type int|float, classA given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -128,4 +128,4 @@ Deprecated: ceil(): Passing null to parameter #1 ($num) of type int|float is dep float(0) -- Iteration 16 -- -ceil(): Argument #1 ($num) must be of type int|float, resource given +TypeError: ceil(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/clamp.phpt b/ext/standard/tests/math/clamp.phpt index beb4c8d53148..225650a00e20 100644 --- a/ext/standard/tests/math/clamp.phpt +++ b/ext/standard/tests/math/clamp.phpt @@ -23,13 +23,13 @@ function check_clamp_exception($value, $min, $max) { try { var_dump(clamp($value, $min, $max)); } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { var_dump(make_clamp_fcc()($value, $min, $max)); } catch (ValueError $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } } @@ -92,13 +92,13 @@ int(10) InvalidArgumentException RuntimeException LogicException -clamp(): Argument #2 ($min) must not be NAN -clamp(): Argument #2 ($min) must not be NAN -clamp(): Argument #3 ($max) must not be NAN -clamp(): Argument #3 ($max) must not be NAN -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) -clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must not be NAN +ValueError: clamp(): Argument #2 ($min) must not be NAN +ValueError: clamp(): Argument #3 ($max) must not be NAN +ValueError: clamp(): Argument #3 ($max) must not be NAN +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) +ValueError: clamp(): Argument #2 ($min) must be smaller than or equal to argument #3 ($max) diff --git a/ext/standard/tests/math/decbin_basic.phpt b/ext/standard/tests/math/decbin_basic.phpt index aaeb58e000ad..6985b43b8d2e 100644 --- a/ext/standard/tests/math/decbin_basic.phpt +++ b/ext/standard/tests/math/decbin_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(decbin($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(12) "111101101110" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(12) "111101101110" string(6) "100111" -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/decbin_basiclong_64bit.phpt b/ext/standard/tests/math/decbin_basiclong_64bit.phpt index 16fd6b97b803..08e4c5a4427d 100644 --- a/ext/standard/tests/math/decbin_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decbin_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(decbin($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(32) "11111111111111111111111111111101" --- testing: 9223372036854775806 --- string(63) "111111111111111111111111111111111111111111111111111111111111110" --- testing: 9.2233720368548E+18 --- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(64) "1000000000000000000000000000000000000000000000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decbin_variation1_64bit.phpt b/ext/standard/tests/math/decbin_variation1_64bit.phpt index 0d4e18307eab..c158c04f08d7 100644 --- a/ext/standard/tests/math/decbin_variation1_64bit.phpt +++ b/ext/standard/tests/math/decbin_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(decbin($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(14) "11000000111001" string(64) "1111111111111111111111111111111111111111111111111111011011010111" -- Iteration 5 -- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decbin(): Argument #1 ($num) must be of type int, float given +TypeError: decbin(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(37) "1110010111110100110010001101000001000" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -decbin(): Argument #1 ($num) must be of type int, string given +TypeError: decbin(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/dechex_basic.phpt b/ext/standard/tests/math/dechex_basic.phpt index 04c1d393e700..11fee0bd0d65 100644 --- a/ext/standard/tests/math/dechex_basic.phpt +++ b/ext/standard/tests/math/dechex_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(dechex($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(3) "f6e" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(3) "f6e" string(2) "27" -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/dechex_basiclong_64bit.phpt b/ext/standard/tests/math/dechex_basiclong_64bit.phpt index 85051ea4567b..49474abab6ef 100644 --- a/ext/standard/tests/math/dechex_basiclong_64bit.phpt +++ b/ext/standard/tests/math/dechex_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(dechex($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(8) "fffffffd" --- testing: 9223372036854775806 --- string(16) "7ffffffffffffffe" --- testing: 9.2233720368548E+18 --- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(16) "8000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/dechex_variation1_64bit.phpt b/ext/standard/tests/math/dechex_variation1_64bit.phpt index bd597b2f996a..755a85d1369f 100644 --- a/ext/standard/tests/math/dechex_variation1_64bit.phpt +++ b/ext/standard/tests/math/dechex_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(dechex($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(4) "3039" string(16) "fffffffffffff6d7" -- Iteration 5 -- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -dechex(): Argument #1 ($num) must be of type int, float given +TypeError: dechex(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(10) "1cbe991a08" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -dechex(): Argument #1 ($num) must be of type int, string given +TypeError: dechex(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/decoct_basic.phpt b/ext/standard/tests/math/decoct_basic.phpt index 30d6712bb47c..6ac5f5cebb25 100644 --- a/ext/standard/tests/math/decoct_basic.phpt +++ b/ext/standard/tests/math/decoct_basic.phpt @@ -20,7 +20,7 @@ foreach ($values as $value) { try { var_dump(decoct($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -43,6 +43,6 @@ string(4) "7556" Deprecated: Implicit conversion from float-string "3.9505e3" to int loses precision in %s on line %d string(4) "7556" string(2) "47" -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given string(1) "1" string(1) "0" diff --git a/ext/standard/tests/math/decoct_basiclong_64bit.phpt b/ext/standard/tests/math/decoct_basiclong_64bit.phpt index a4e951176cd0..36e73eee5c34 100644 --- a/ext/standard/tests/math/decoct_basiclong_64bit.phpt +++ b/ext/standard/tests/math/decoct_basiclong_64bit.phpt @@ -24,7 +24,7 @@ foreach ($longVals as $longVal) { try { var_dump(decoct($longVal)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -55,7 +55,7 @@ string(11) "37777777775" --- testing: 9223372036854775806 --- string(21) "777777777777777777776" --- testing: 9.2233720368548E+18 --- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given --- testing: -9223372036854775807 --- string(22) "1000000000000000000001" --- testing: -9.2233720368548E+18 --- diff --git a/ext/standard/tests/math/decoct_variation1_64bit.phpt b/ext/standard/tests/math/decoct_variation1_64bit.phpt index cc4b69f07560..03ca88a035ff 100644 --- a/ext/standard/tests/math/decoct_variation1_64bit.phpt +++ b/ext/standard/tests/math/decoct_variation1_64bit.phpt @@ -40,7 +40,7 @@ foreach ($inputs as $i => $input) { try { var_dump(decoct($input)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -61,10 +61,10 @@ string(5) "30071" string(22) "1777777777777777773327" -- Iteration 5 -- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 6 -- -decoct(): Argument #1 ($num) must be of type int, float given +TypeError: decoct(): Argument #1 ($num) must be of type int, float given -- Iteration 7 -- string(13) "1627646215010" @@ -82,7 +82,7 @@ string(1) "1" string(1) "0" -- Iteration 12 -- -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given -- Iteration 13 -- -decoct(): Argument #1 ($num) must be of type int, string given +TypeError: decoct(): Argument #1 ($num) must be of type int, string given diff --git a/ext/standard/tests/math/floor_variation1.phpt b/ext/standard/tests/math/floor_variation1.phpt index c9ec5e710c51..b883e9e79cf9 100644 --- a/ext/standard/tests/math/floor_variation1.phpt +++ b/ext/standard/tests/math/floor_variation1.phpt @@ -65,7 +65,7 @@ foreach($inputs as $input) { try { var_dump(floor($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -97,25 +97,25 @@ float(1) float(0) -- Iteration 7 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 8 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 9 -- -floor(): Argument #1 ($num) must be of type int|float, array given +TypeError: floor(): Argument #1 ($num) must be of type int|float, array given -- Iteration 10 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 11 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 12 -- -floor(): Argument #1 ($num) must be of type int|float, string given +TypeError: floor(): Argument #1 ($num) must be of type int|float, string given -- Iteration 13 -- -floor(): Argument #1 ($num) must be of type int|float, classA given +TypeError: floor(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 14 -- @@ -128,4 +128,4 @@ Deprecated: floor(): Passing null to parameter #1 ($num) of type int|float is de float(0) -- Iteration 16 -- -floor(): Argument #1 ($num) must be of type int|float, resource given +TypeError: floor(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/math/gh17384.phpt b/ext/standard/tests/math/gh17384.phpt index eff207a906a6..f19bf2756fb5 100644 --- a/ext/standard/tests/math/gh17384.phpt +++ b/ext/standard/tests/math/gh17384.phpt @@ -12,14 +12,14 @@ foreach ([1.23456, 1] as $number) { try { number_format($number, $decimals); } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } ?> --EXPECT-- -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 -number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 +ValueError: number_format(): Argument #2 ($decimals) must be between -2147483648 and 2147483647 diff --git a/ext/standard/tests/math/hexdec_variation1_64bit.phpt b/ext/standard/tests/math/hexdec_variation1_64bit.phpt index c892b8049fc9..504d7ec0dbd4 100644 --- a/ext/standard/tests/math/hexdec_variation1_64bit.phpt +++ b/ext/standard/tests/math/hexdec_variation1_64bit.phpt @@ -62,7 +62,7 @@ foreach($inputs as $input) { try { var_dump(hexdec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -133,7 +133,7 @@ int(0) int(0) -- Iteration 18 -- -hexdec(): Argument #1 ($hex_string) must be of type string, array given +TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, array given -- Iteration 19 -- @@ -151,4 +151,4 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(2748) -- Iteration 22 -- -hexdec(): Argument #1 ($hex_string) must be of type string, resource given +TypeError: hexdec(): Argument #1 ($hex_string) must be of type string, resource given diff --git a/ext/standard/tests/math/intdiv.phpt b/ext/standard/tests/math/intdiv.phpt index b441cb0a8680..4bc58c573ab7 100644 --- a/ext/standard/tests/math/intdiv.phpt +++ b/ext/standard/tests/math/intdiv.phpt @@ -11,12 +11,12 @@ var_dump(intdiv(PHP_INT_MIN, PHP_INT_MIN)); try { var_dump(intdiv(PHP_INT_MIN, -1)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(intdiv(1, 0)); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -27,5 +27,5 @@ int(-1) int(1) int(1) int(1) -Exception: Division of PHP_INT_MIN by -1 is not an integer -Exception: Division by zero +ArithmeticError: Division of PHP_INT_MIN by -1 is not an integer +DivisionByZeroError: Division by zero diff --git a/ext/standard/tests/math/log_error.phpt b/ext/standard/tests/math/log_error.phpt index 4c90c20a2052..7d766f7ee574 100644 --- a/ext/standard/tests/math/log_error.phpt +++ b/ext/standard/tests/math/log_error.phpt @@ -7,8 +7,8 @@ precision=14 try { log(36, -4); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -log(): Argument #2 ($base) must be greater than 0 +ValueError: log(): Argument #2 ($base) must be greater than 0 diff --git a/ext/standard/tests/math/octdec_variation1.phpt b/ext/standard/tests/math/octdec_variation1.phpt index c24d2e8e6bea..9884385ac3b8 100644 --- a/ext/standard/tests/math/octdec_variation1.phpt +++ b/ext/standard/tests/math/octdec_variation1.phpt @@ -58,7 +58,7 @@ foreach($inputs as $input) { try { var_dump(octdec($input)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -136,7 +136,7 @@ int(0) int(0) -- Iteration 18 -- -octdec(): Argument #1 ($octal_string) must be of type string, array given +TypeError: octdec(): Argument #1 ($octal_string) must be of type string, array given -- Iteration 19 -- @@ -154,5 +154,5 @@ Deprecated: Invalid characters passed for attempted conversion, these have been int(0) -- Iteration 22 -- -octdec(): Argument #1 ($octal_string) must be of type string, resource given +TypeError: octdec(): Argument #1 ($octal_string) must be of type string, resource given ---Done--- diff --git a/ext/standard/tests/math/pow_basic_64bit.phpt b/ext/standard/tests/math/pow_basic_64bit.phpt index 7496c2d1b52a..83cd9670f34b 100644 --- a/ext/standard/tests/math/pow_basic_64bit.phpt +++ b/ext/standard/tests/math/pow_basic_64bit.phpt @@ -276,4 +276,3 @@ Base = -9223372036854775808 ..... Exponent = -500 Result = 0 ..... Exponent = 2147483647 Result = -INF ..... Exponent = -2147483648 Result = 0 - diff --git a/ext/standard/tests/math/pow_variation1_64bit.phpt b/ext/standard/tests/math/pow_variation1_64bit.phpt index debc8b16d2b0..7f5d473b094f 100644 --- a/ext/standard/tests/math/pow_variation1_64bit.phpt +++ b/ext/standard/tests/math/pow_variation1_64bit.phpt @@ -59,7 +59,7 @@ foreach ($inputs as $input) { try { var_dump(pow($input, 3)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($fp); @@ -78,11 +78,11 @@ float(0.125) int(0) int(1) int(0) -Unsupported operand types: string ** int -Unsupported operand types: array ** int -Unsupported operand types: string ** int +TypeError: Unsupported operand types: string ** int +TypeError: Unsupported operand types: array ** int +TypeError: Unsupported operand types: string ** int float(1157.625) int(8) float(0.000250047) -Unsupported operand types: classA ** int -Unsupported operand types: resource ** int +TypeError: Unsupported operand types: classA ** int +TypeError: Unsupported operand types: resource ** int diff --git a/ext/standard/tests/math/pow_variation2.phpt b/ext/standard/tests/math/pow_variation2.phpt index 47a4845faade..4ebc36ddb96a 100644 --- a/ext/standard/tests/math/pow_variation2.phpt +++ b/ext/standard/tests/math/pow_variation2.phpt @@ -55,7 +55,7 @@ foreach ($inputs as $input) { try { var_dump(pow(20.3, $input)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($fp); @@ -74,11 +74,11 @@ float(4.5055521304275) float(1) float(20.3) float(1) -Unsupported operand types: float ** string -Unsupported operand types: float ** array -Unsupported operand types: float ** string +TypeError: Unsupported operand types: float ** string +TypeError: Unsupported operand types: float ** array +TypeError: Unsupported operand types: float ** string float(15532029.564086) float(412.09) float(1.2088495422866) -Unsupported operand types: float ** classA -Unsupported operand types: float ** resource +TypeError: Unsupported operand types: float ** classA +TypeError: Unsupported operand types: float ** resource diff --git a/ext/standard/tests/math/round_valid_rounding_mode.phpt b/ext/standard/tests/math/round_valid_rounding_mode.phpt index d7e4655a2985..b6b6797946f4 100644 --- a/ext/standard/tests/math/round_valid_rounding_mode.phpt +++ b/ext/standard/tests/math/round_valid_rounding_mode.phpt @@ -5,8 +5,8 @@ round() rejects invalid rounding modes. try { var_dump(round(1.5, mode: 1234)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) +ValueError: round(): Argument #3 ($mode) must be a valid rounding mode (RoundingMode::*) diff --git a/ext/standard/tests/math/round_variation1.phpt b/ext/standard/tests/math/round_variation1.phpt index 2a2adf27cae0..cda59ae980ca 100644 --- a/ext/standard/tests/math/round_variation1.phpt +++ b/ext/standard/tests/math/round_variation1.phpt @@ -79,7 +79,7 @@ foreach($inputs as $input) { try { var_dump(round($input, 14)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $iterator++; }; @@ -141,25 +141,25 @@ float(1) float(0) -- Iteration 17 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 18 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 19 -- -round(): Argument #1 ($num) must be of type int|float, array given +TypeError: round(): Argument #1 ($num) must be of type int|float, array given -- Iteration 20 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 21 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 22 -- -round(): Argument #1 ($num) must be of type int|float, string given +TypeError: round(): Argument #1 ($num) must be of type int|float, string given -- Iteration 23 -- -round(): Argument #1 ($num) must be of type int|float, classA given +TypeError: round(): Argument #1 ($num) must be of type int|float, classA given -- Iteration 24 -- @@ -172,4 +172,4 @@ Deprecated: round(): Passing null to parameter #1 ($num) of type int|float is de float(0) -- Iteration 26 -- -round(): Argument #1 ($num) must be of type int|float, resource given +TypeError: round(): Argument #1 ($num) must be of type int|float, resource given diff --git a/ext/standard/tests/misc/exec_basic1.phpt b/ext/standard/tests/misc/exec_basic1.phpt index e08d6a938991..a8a6291c1f92 100644 --- a/ext/standard/tests/misc/exec_basic1.phpt +++ b/ext/standard/tests/misc/exec_basic1.phpt @@ -11,20 +11,20 @@ $cmd = "echo abc\n\0command"; try { var_dump(exec($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(system($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(passthru($cmd, $output)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -exec(): Argument #1 ($command) must not contain any null bytes -system(): Argument #1 ($command) must not contain any null bytes -passthru(): Argument #1 ($command) must not contain any null bytes +ValueError: exec(): Argument #1 ($command) must not contain any null bytes +ValueError: system(): Argument #1 ($command) must not contain any null bytes +ValueError: passthru(): Argument #1 ($command) must not contain any null bytes diff --git a/ext/standard/tests/misc/gh14774.phpt b/ext/standard/tests/misc/gh14774.phpt index 1f9cd921e03a..9e2899cc6345 100644 --- a/ext/standard/tests/misc/gh14774.phpt +++ b/ext/standard/tests/misc/gh14774.phpt @@ -10,14 +10,14 @@ foreach([INF, -INF, 10e300, -10e300, NAN, -NAN] as $var) { try { time_sleep_until($var); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECTF-- -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d -time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d +ValueError: time_sleep_until(): Argument #1 ($timestamp) must be between 0 and %d diff --git a/ext/standard/tests/network/bug69523.phpt b/ext/standard/tests/network/bug69523.phpt index 5552ca2afdf8..c06eca2630c5 100644 --- a/ext/standard/tests/network/bug69523.phpt +++ b/ext/standard/tests/network/bug69523.phpt @@ -5,8 +5,8 @@ setcookie() allows empty cookie name try { setcookie('', 'foo'); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -setcookie(): Argument #1 ($name) must not be empty +ValueError: setcookie(): Argument #1 ($name) must not be empty diff --git a/ext/standard/tests/network/bug69948.phpt b/ext/standard/tests/network/bug69948.phpt index c2a72aac8720..e2608dd53456 100644 --- a/ext/standard/tests/network/bug69948.phpt +++ b/ext/standard/tests/network/bug69948.phpt @@ -5,18 +5,18 @@ Bug #69948 (path/domain are not sanitized for special characters in setcookie) try { var_dump(setcookie('foo', 'bar', 0, 'asdf;asdf')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setcookie('foo', 'bar', 0, '/', 'foobar; secure')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> ===DONE=== --EXPECTHEADERS-- --EXPECT-- -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" ===DONE=== diff --git a/ext/standard/tests/network/bug79405.phpt b/ext/standard/tests/network/bug79405.phpt index ca1f7b0f3f28..1243a9452bf8 100644 --- a/ext/standard/tests/network/bug79405.phpt +++ b/ext/standard/tests/network/bug79405.phpt @@ -6,14 +6,14 @@ $host = "localhost\0.example.com"; try { var_dump(gethostbyname($host)); } catch(Error $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(gethostbynamel($host)); } catch(Error $e) { - print $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -gethostbyname(): Argument #1 ($hostname) must not contain any null bytes -gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes \ No newline at end of file +ValueError: gethostbyname(): Argument #1 ($hostname) must not contain any null bytes +ValueError: gethostbynamel(): Argument #1 ($hostname) must not contain any null bytes diff --git a/ext/standard/tests/network/dns_check_record_error_conditions.phpt b/ext/standard/tests/network/dns_check_record_error_conditions.phpt index de33d74bce63..755301c3a959 100644 --- a/ext/standard/tests/network/dns_check_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_check_record_error_conditions.phpt @@ -5,15 +5,15 @@ dns_check_record() error conditions try { dns_check_record(''); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode dns_check_record('php.net', 15263480); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -dns_check_record(): Argument #1 ($hostname) must not be empty -dns_check_record(): Argument #2 ($type) must be a valid DNS record type +ValueError: dns_check_record(): Argument #1 ($hostname) must not be empty +ValueError: dns_check_record(): Argument #2 ($type) must be a valid DNS record type diff --git a/ext/standard/tests/network/dns_get_record_error_conditions.phpt b/ext/standard/tests/network/dns_get_record_error_conditions.phpt index 6506aca4108e..abd2356daf05 100644 --- a/ext/standard/tests/network/dns_get_record_error_conditions.phpt +++ b/ext/standard/tests/network/dns_get_record_error_conditions.phpt @@ -6,7 +6,7 @@ try { // A random DNS Mode dns_get_record('php.net', 15263480); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // DNS Mode 0 @@ -14,7 +14,7 @@ try { $additional = []; dns_get_record('php.net', 0, $auth, $additional, true); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { // A random DNS Mode @@ -22,10 +22,10 @@ try { $additional = []; dns_get_record('php.net', 15263480, $auth, $additional, true); } catch (\ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -dns_get_record(): Argument #2 ($type) must be a DNS_* constant -dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true -dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true +ValueError: dns_get_record(): Argument #2 ($type) must be a DNS_* constant +ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true +ValueError: dns_get_record(): Argument #2 ($type) must be between 1 and 65535 when argument #5 ($raw) is true diff --git a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt index 3d082c8e9522..c11bd4fc712d 100644 --- a/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt +++ b/ext/standard/tests/network/ghsa-www2-q4fc-65wf.phpt @@ -7,56 +7,56 @@ This is a ZPP test but *keep* this as it is security-sensitive! try { dns_check_record("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_mx("\0", $out); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { dns_get_record("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getprotobyname("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("\0", "tcp"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyname("x", "tcp\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { getservbyport(0, "tcp\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { inet_pton("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { ip2long("\0"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -dns_check_record(): Argument #1 ($hostname) must not contain any null bytes -dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes -dns_get_record(): Argument #1 ($hostname) must not contain any null bytes -getprotobyname(): Argument #1 ($protocol) must not contain any null bytes -getservbyname(): Argument #1 ($service) must not contain any null bytes -getservbyname(): Argument #2 ($protocol) must not contain any null bytes -getservbyport(): Argument #2 ($protocol) must not contain any null bytes -inet_pton(): Argument #1 ($ip) must not contain any null bytes -ip2long(): Argument #1 ($ip) must not contain any null bytes +ValueError: dns_check_record(): Argument #1 ($hostname) must not contain any null bytes +ValueError: dns_get_mx(): Argument #1 ($hostname) must not contain any null bytes +ValueError: dns_get_record(): Argument #1 ($hostname) must not contain any null bytes +ValueError: getprotobyname(): Argument #1 ($protocol) must not contain any null bytes +ValueError: getservbyname(): Argument #1 ($service) must not contain any null bytes +ValueError: getservbyname(): Argument #2 ($protocol) must not contain any null bytes +ValueError: getservbyport(): Argument #2 ($protocol) must not contain any null bytes +ValueError: inet_pton(): Argument #1 ($ip) must not contain any null bytes +ValueError: ip2long(): Argument #1 ($ip) must not contain any null bytes diff --git a/ext/standard/tests/network/openlog_null_bytes.phpt b/ext/standard/tests/network/openlog_null_bytes.phpt index 6d3274227815..5bf64fd55c35 100644 --- a/ext/standard/tests/network/openlog_null_bytes.phpt +++ b/ext/standard/tests/network/openlog_null_bytes.phpt @@ -9,8 +9,8 @@ if (!function_exists("openlog")) die("skip openlog() is not available"); try { openlog("foo\0bar", LOG_NDELAY, LOG_USER); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -openlog(): Argument #1 ($prefix) must not contain any null bytes +ValueError: openlog(): Argument #1 ($prefix) must not contain any null bytes diff --git a/ext/standard/tests/network/setcookie_array_option_error.phpt b/ext/standard/tests/network/setcookie_array_option_error.phpt index 0fb2ae011c31..12be0c5225c1 100644 --- a/ext/standard/tests/network/setcookie_array_option_error.phpt +++ b/ext/standard/tests/network/setcookie_array_option_error.phpt @@ -11,44 +11,44 @@ ob_start(); try { setcookie('name', 'value', ['unknown_key' => 'only']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Numeric key and no valid keys try { setcookie('name2', 'value2', [0 => 'numeric_key']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Unrecognized key try { setcookie('name3', 'value3', ['path' => '/path/', 'foo' => 'bar']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid path key content try { setcookie('name', 'value', ['path' => '/;/']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Invalid domain key content try { setcookie('name', 'value', ['path' => '/path/', 'domain' => 'ba;r']); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Partitioned without secure try { setcookie('name', 'value', ['partitioned' => true]); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Arguments after options array (will not be set) try { setcookie('name4', 'value4', [], "path", "domain.tld", true, true); } catch (\ArgumentCountError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -67,13 +67,13 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setcookie(): option "unknown_key" is invalid -setcookie(): option array cannot have numeric keys -setcookie(): option "foo" is invalid -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "partitioned" option cannot be used without "secure" option -setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array +ValueError: setcookie(): option "unknown_key" is invalid +ValueError: setcookie(): option array cannot have numeric keys +ValueError: setcookie(): option "foo" is invalid +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "partitioned" option cannot be used without "secure" option +ArgumentCountError: setcookie(): Expects exactly 3 arguments when argument #3 ($expires_or_options) is an array bool(true) array(1) { [0]=> diff --git a/ext/standard/tests/network/setcookie_error.phpt b/ext/standard/tests/network/setcookie_error.phpt index 90177c714e58..1543dbc7db87 100644 --- a/ext/standard/tests/network/setcookie_error.phpt +++ b/ext/standard/tests/network/setcookie_error.phpt @@ -10,27 +10,27 @@ ob_start(); try { setcookie(''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('invalid='); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('name', 'value', 100, 'path', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -50,10 +50,10 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setcookie(): Argument #1 ($name) must not be empty -setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): Argument #1 ($name) must not be empty +ValueError: setcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" bool(true) array(2) { [0]=> diff --git a/ext/standard/tests/network/setrawcookie_error.phpt b/ext/standard/tests/network/setrawcookie_error.phpt index 9aae95673df0..a4fc3b3abd79 100644 --- a/ext/standard/tests/network/setrawcookie_error.phpt +++ b/ext/standard/tests/network/setrawcookie_error.phpt @@ -10,27 +10,27 @@ ob_start(); try { setrawcookie(''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('invalid='); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('name', 'value', 100, 'path', 'invalid;'); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } if (PHP_INT_SIZE == 8) { @@ -50,11 +50,11 @@ var_dump(headers_list()); --EXPECTHEADERS-- --EXPECTF-- -setrawcookie(): Argument #1 ($name) must not be empty -setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" -setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): Argument #1 ($name) must not be empty +ValueError: setrawcookie(): Argument #1 ($name) cannot contain "=", ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): Argument #2 ($value) cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): "path" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" +ValueError: setrawcookie(): "domain" option cannot contain ",", ";", " ", "\t", "\r", "\n", "\013", or "\014" bool(true) array(1) { [0]=> diff --git a/ext/standard/tests/password/password_bcrypt_errors.phpt b/ext/standard/tests/password/password_bcrypt_errors.phpt index 5d823cba0217..15d30eb91f07 100644 --- a/ext/standard/tests/password/password_bcrypt_errors.phpt +++ b/ext/standard/tests/password/password_bcrypt_errors.phpt @@ -6,22 +6,22 @@ Test error operation of password_hash() with bcrypt hashing try { password_hash("foo", PASSWORD_BCRYPT, array("cost" => 3)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, array("cost" => 32))); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("null\0password", PASSWORD_BCRYPT)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid bcrypt cost parameter specified: 3 -Invalid bcrypt cost parameter specified: 32 -Bcrypt password must not contain null character +ValueError: Invalid bcrypt cost parameter specified: 3 +ValueError: Invalid bcrypt cost parameter specified: 32 +ValueError: Bcrypt password must not contain null character diff --git a/ext/standard/tests/password/password_hash_error.phpt b/ext/standard/tests/password/password_hash_error.phpt index a9e26f091675..684e9d4afb25 100644 --- a/ext/standard/tests/password/password_hash_error.phpt +++ b/ext/standard/tests/password/password_hash_error.phpt @@ -7,37 +7,37 @@ Test error operation of password_hash() try { var_dump(password_hash("foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { password_hash("foo", array()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(password_hash("foo", 19, new StdClass)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash("foo", PASSWORD_BCRYPT, "baz")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_hash(array(), PASSWORD_BCRYPT)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -password_hash() expects at least 2 arguments, 1 given -password_hash(): Argument #2 ($algo) must be of type string|int|null, array given -password_hash(): Argument #3 ($options) must be of type array, stdClass given -password_hash(): Argument #3 ($options) must be of type array, string given -password_hash(): Argument #1 ($password) must be of type string, array given +ArgumentCountError: password_hash() expects at least 2 arguments, 1 given +TypeError: password_hash(): Argument #2 ($algo) must be of type string|int|null, array given +TypeError: password_hash(): Argument #3 ($options) must be of type array, stdClass given +TypeError: password_hash(): Argument #3 ($options) must be of type array, string given +TypeError: password_hash(): Argument #1 ($password) must be of type string, array given diff --git a/ext/standard/tests/password/password_needs_rehash_error.phpt b/ext/standard/tests/password/password_needs_rehash_error.phpt index 283a6b5387e0..af38d571cf26 100644 --- a/ext/standard/tests/password/password_needs_rehash_error.phpt +++ b/ext/standard/tests/password/password_needs_rehash_error.phpt @@ -6,32 +6,32 @@ Test error operation of password_needs_rehash() try { var_dump(password_needs_rehash('')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash('', [])); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash(array(), PASSWORD_BCRYPT)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(password_needs_rehash("", PASSWORD_BCRYPT, "foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "OK!"; ?> --EXPECT-- -password_needs_rehash() expects at least 2 arguments, 1 given -password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given -password_needs_rehash(): Argument #1 ($hash) must be of type string, array given -password_needs_rehash(): Argument #3 ($options) must be of type array, string given +ArgumentCountError: password_needs_rehash() expects at least 2 arguments, 1 given +TypeError: password_needs_rehash(): Argument #2 ($algo) must be of type string|int|null, array given +TypeError: password_needs_rehash(): Argument #1 ($hash) must be of type string, array given +TypeError: password_needs_rehash(): Argument #3 ($options) must be of type array, string given OK! diff --git a/ext/standard/tests/password/password_verify_error.phpt b/ext/standard/tests/password/password_verify_error.phpt index 76c4f6dcb65e..5d0763d1a357 100644 --- a/ext/standard/tests/password/password_verify_error.phpt +++ b/ext/standard/tests/password/password_verify_error.phpt @@ -7,9 +7,9 @@ Test error operation of password_verify() try { var_dump(password_verify("foo")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -password_verify() expects exactly 2 arguments, 1 given +ArgumentCountError: password_verify() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/poll/gh22759.phpt b/ext/standard/tests/poll/gh22759.phpt index 3df68c4f1314..671e52c78631 100644 --- a/ext/standard/tests/poll/gh22759.phpt +++ b/ext/standard/tests/poll/gh22759.phpt @@ -26,7 +26,7 @@ var_dump($second->isActive()); try { $second->remove(); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; @@ -34,5 +34,5 @@ echo "done\n"; --EXPECT-- NULL bool(false) -Cannot remove inactive watcher -done +Io\Poll\InactiveWatcherException: Cannot remove inactive watcher +done diff --git a/ext/standard/tests/poll/poll_clone_not_allowed.phpt b/ext/standard/tests/poll/poll_clone_not_allowed.phpt index f31c4c2ecd7f..b32a57e848a3 100644 --- a/ext/standard/tests/poll/poll_clone_not_allowed.phpt +++ b/ext/standard/tests/poll/poll_clone_not_allowed.phpt @@ -13,14 +13,14 @@ foreach ([$ctx, $handle, $watcher] as $obj) { try { clone $obj; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "done\n"; ?> --EXPECT-- -Trying to clone an uncloneable object of class Io\Poll\Context -Trying to clone an uncloneable object of class StreamPollHandle -Trying to clone an uncloneable object of class Io\Poll\Watcher +Error: Trying to clone an uncloneable object of class Io\Poll\Context +Error: Trying to clone an uncloneable object of class StreamPollHandle +Error: Trying to clone an uncloneable object of class Io\Poll\Watcher done diff --git a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt index 89f4f3eea10a..bcefd2e05d0b 100644 --- a/ext/standard/tests/poll/poll_ctx_backend_unix.phpt +++ b/ext/standard/tests/poll/poll_ctx_backend_unix.phpt @@ -19,10 +19,10 @@ var_dump($backend->name); try { new Io\Poll\Context(Io\Poll\Backend::WSAPoll); } catch (\Io\Poll\BackendUnavailableException $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- enum(Io\Poll\Backend::%s) string(4) "Poll" -string(29) "Backend WSAPoll not available" +Io\Poll\BackendUnavailableException: Backend WSAPoll not available diff --git a/ext/standard/tests/poll/poll_double_construct.phpt b/ext/standard/tests/poll/poll_double_construct.phpt index 1fa5b65db38d..43729b9c4c39 100644 --- a/ext/standard/tests/poll/poll_double_construct.phpt +++ b/ext/standard/tests/poll/poll_double_construct.phpt @@ -10,19 +10,19 @@ $handle = new StreamPollHandle($r); try { $handle->__construct($r); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $ctx = pt_new_stream_poll(); try { $ctx->__construct(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- -StreamPollHandle object is already constructed -Io\Poll\Context object is already constructed +Error: StreamPollHandle object is already constructed +Error: Io\Poll\Context object is already constructed done diff --git a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt index 8753cad7eb8e..4ab36d47dd06 100644 --- a/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt +++ b/ext/standard/tests/poll/poll_stream_add_error_duplicate.phpt @@ -12,8 +12,8 @@ pt_stream_poll_add($poll_ctx, $socket1w, [Io\Poll\Event::Write], "socket2_data") try { pt_stream_poll_add($poll_ctx, $socket1w, [Io\Poll\Event::Write], "socket2_data"); } catch (Io\Poll\HandleAlreadyWatchedException $e) { - echo "ERROR: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -ERROR: Handle already added +Io\Poll\HandleAlreadyWatchedException: Handle already added diff --git a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt index 2c058d5b8966..9a76612be852 100644 --- a/ext/standard/tests/poll/poll_watcher_outlives_context.phpt +++ b/ext/standard/tests/poll/poll_watcher_outlives_context.phpt @@ -17,19 +17,19 @@ var_dump($watcher->isActive()); try { $watcher->remove(); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $watcher->modifyEvents([Io\Poll\Event::Write]); } catch (Io\Poll\InactiveWatcherException $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "done\n"; ?> --EXPECT-- bool(false) -Cannot remove inactive watcher -Cannot modify inactive watcher +Io\Poll\InactiveWatcherException: Cannot remove inactive watcher +Io\Poll\InactiveWatcherException: Cannot modify inactive watcher done diff --git a/ext/standard/tests/serialize/__serialize_002.phpt b/ext/standard/tests/serialize/__serialize_002.phpt index 72851eed4bc9..4184e1c595c5 100644 --- a/ext/standard/tests/serialize/__serialize_002.phpt +++ b/ext/standard/tests/serialize/__serialize_002.phpt @@ -12,9 +12,9 @@ class Test { try { serialize(new Test); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Test::__serialize() must return an array +TypeError: Test::__serialize() must return an array diff --git a/ext/standard/tests/serialize/__serialize_007.phpt b/ext/standard/tests/serialize/__serialize_007.phpt index 32cad44dba9e..fac825849469 100644 --- a/ext/standard/tests/serialize/__serialize_007.phpt +++ b/ext/standard/tests/serialize/__serialize_007.phpt @@ -7,9 +7,9 @@ $payload = 'O:13:"ArrayIterator":2:{i:0;i:0;s:1:"x";R:2;}'; try { var_dump(unserialize($payload)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Incomplete or ill-typed serialization data +UnexpectedValueException: Incomplete or ill-typed serialization data diff --git a/ext/standard/tests/serialize/bug64354_1.phpt b/ext/standard/tests/serialize/bug64354_1.phpt index 499b66466f03..f1024537c517 100644 --- a/ext/standard/tests/serialize/bug64354_1.phpt +++ b/ext/standard/tests/serialize/bug64354_1.phpt @@ -11,15 +11,15 @@ spl_autoload_register( try { var_dump(unserialize('O:1:"A":0:{}')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"A":0:{}}')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(6) "Failed" -string(6) "Failed" +Exception: Failed +Exception: Failed diff --git a/ext/standard/tests/serialize/bug64354_2.phpt b/ext/standard/tests/serialize/bug64354_2.phpt index 675305132157..6828b9df0798 100644 --- a/ext/standard/tests/serialize/bug64354_2.phpt +++ b/ext/standard/tests/serialize/bug64354_2.phpt @@ -17,8 +17,8 @@ spl_autoload_register( try { var_dump(unserialize('a:2:{i:0;O:1:"A":0:{}i:1;O:1:"B":0:{}}')); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -string(6) "Failed" +Exception: Failed diff --git a/ext/standard/tests/serialize/bug64354_3.phpt b/ext/standard/tests/serialize/bug64354_3.phpt index e3832e653bbf..3a6d21697f23 100644 --- a/ext/standard/tests/serialize/bug64354_3.phpt +++ b/ext/standard/tests/serialize/bug64354_3.phpt @@ -22,9 +22,9 @@ $data = array(new A, new B); try { serialize($data); } catch (Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d -string(6) "Failed" +Exception: Failed diff --git a/ext/standard/tests/serialize/bug73341.phpt b/ext/standard/tests/serialize/bug73341.phpt index 460575c0a065..474494721ce5 100644 --- a/ext/standard/tests/serialize/bug73341.phpt +++ b/ext/standard/tests/serialize/bug73341.phpt @@ -6,14 +6,14 @@ try { $token = 'a:2:{i:0;O:1:"0":2:{s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}'; $obj = unserialize($token); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token = 'a:2:{i:0;O:1:"0":2:0s:1:"0";i:0;s:1:"0";a:1:{i:0;C:11:"ArrayObject":7:{x:i:0;r}'; $obj = unserialize($token); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -21,13 +21,13 @@ $inner = 'x:i:1;O:8:"stdClass":1:{};m:a:0:{}'; $exploit = 'C:11:"ArrayObject":'.strlen($inner).':{'.$inner.'}'; unserialize($exploit); } catch(Exception $e) { - echo $e->getMessage()."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Error at offset 6 of 7 bytes +UnexpectedValueException: Error at offset 6 of 7 bytes Warning: unserialize(): Error at offset 19 of 79 bytes in %s on line %d Warning: ArrayObject::unserialize(): Unexpected end of serialized data in %sbug73341.php on line %d -Error at offset 24 of 34 bytes +UnexpectedValueException: Error at offset 24 of 34 bytes diff --git a/ext/standard/tests/serialize/bug81111.phpt b/ext/standard/tests/serialize/bug81111.phpt index aa5002eaf704..20271e227d35 100644 --- a/ext/standard/tests/serialize/bug81111.phpt +++ b/ext/standard/tests/serialize/bug81111.phpt @@ -11,7 +11,7 @@ class MySplFileInfo extends SplFileInfo { try { serialize(new MySplFileInfo(__FILE__)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $anon = new class () { @@ -22,32 +22,32 @@ $anon = new class () { try { serialize($anon); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("O:13:\"MySplFileInfo\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize("C:13:\"MySplFileInfo\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $name = $anon::class; try { unserialize("O:" . strlen($name) . ":\"" . $name . "\":0:{}"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Serialization of 'MySplFileInfo' is not allowed -Serialization of 'class@anonymous' is not allowed -Unserialization of 'MySplFileInfo' is not allowed -Unserialization of 'MySplFileInfo' is not allowed +Exception: Serialization of 'MySplFileInfo' is not allowed +Exception: Serialization of 'class@anonymous' is not allowed +Exception: Unserialization of 'MySplFileInfo' is not allowed +Exception: Unserialization of 'MySplFileInfo' is not allowed Warning: unserialize(): Error at offset 0 of %d bytes in %s on line %d diff --git a/ext/standard/tests/serialize/gh15169.phpt b/ext/standard/tests/serialize/gh15169.phpt index 19c1415b05c8..916ec8c2f7c2 100644 --- a/ext/standard/tests/serialize/gh15169.phpt +++ b/ext/standard/tests/serialize/gh15169.phpt @@ -28,7 +28,7 @@ for ($i = 0; $i < 30000; $i++) { try { serialize($firstNode); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } while ($next = $firstNode->next) { @@ -37,4 +37,4 @@ while ($next = $firstNode->next) { ?> --EXPECTF-- -Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? +Error: Maximum call stack size of %d bytes (zend.max_allowed_stack_size - zend.reserved_stack_size) reached. Infinite recursion? diff --git a/ext/standard/tests/serialize/incomplete_class.phpt b/ext/standard/tests/serialize/incomplete_class.phpt index 2ead760508cf..a2564d0e0720 100644 --- a/ext/standard/tests/serialize/incomplete_class.phpt +++ b/ext/standard/tests/serialize/incomplete_class.phpt @@ -10,7 +10,7 @@ var_dump($o); try { $o->test = "a"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o->test); var_dump($o->test2); @@ -20,7 +20,7 @@ echo "Done\n"; --EXPECTF-- object(__PHP_Incomplete_Class)#%d (0) { } -The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "unknown" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL diff --git a/ext/standard/tests/serialize/max_depth.phpt b/ext/standard/tests/serialize/max_depth.phpt index 09418e5c61da..2a48ab40a551 100644 --- a/ext/standard/tests/serialize/max_depth.phpt +++ b/ext/standard/tests/serialize/max_depth.phpt @@ -15,13 +15,13 @@ echo "Invalid max_depth:\n"; try { unserialize('i:0;', ['max_depth' => 'foo']); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize('i:0;', ['max_depth' => -1]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Array:\n"; @@ -108,8 +108,8 @@ var_dump(is_array(unserialize( ?> --EXPECTF-- Invalid max_depth: -unserialize(): Option "max_depth" must be of type int, string given -unserialize(): Option "max_depth" must be greater than or equal to 0 +TypeError: unserialize(): Option "max_depth" must be of type int, string given +ValueError: unserialize(): Option "max_depth" must be greater than or equal to 0 Array: bool(true) diff --git a/ext/standard/tests/serialize/serialization_objects_005.phpt b/ext/standard/tests/serialize/serialization_objects_005.phpt index e38ead00695c..ee8f95f86f8d 100644 --- a/ext/standard/tests/serialize/serialization_objects_005.phpt +++ b/ext/standard/tests/serialize/serialization_objects_005.phpt @@ -38,7 +38,7 @@ try { $ref2 = "ref1.original"; $incomplete->p = &$ref2; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->p); $ref2 = "ref1.changed"; @@ -46,7 +46,7 @@ var_dump($incomplete->p); try { $incomplete->p = "p.changed"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($ref1); @@ -54,20 +54,20 @@ var_dump(isset($incomplete->x)); try { $incomplete->x = "x.new"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(isset($incomplete->x)); try { unset($incomplete->x); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($incomplete->x); try { $incomplete->f(); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -101,25 +101,25 @@ bool(true) Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition string(9) "p.changed" Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d bool(false) -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d bool(false) -The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to modify a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Warning: main(): The script tried to access a property on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition in %s on line %d NULL -The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition +Error: The script tried to call a method on an incomplete object. Please ensure that the class definition "C" of the object you are trying to operate on was loaded _before_ unserialize() gets called or provide an autoloader to load the class definition Done diff --git a/ext/standard/tests/serialize/serialization_objects_008.phpt b/ext/standard/tests/serialize/serialization_objects_008.phpt index 650ba56330d4..85a5ef433058 100644 --- a/ext/standard/tests/serialize/serialization_objects_008.phpt +++ b/ext/standard/tests/serialize/serialization_objects_008.phpt @@ -6,8 +6,8 @@ ini_set('unserialize_callback_func','Nonexistent'); try { unserialize('O:3:"FOO":0:{}'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name +Error: Invalid callback Nonexistent, function "Nonexistent" not found or invalid function name diff --git a/ext/standard/tests/serialize/serialization_objects_010.phpt b/ext/standard/tests/serialize/serialization_objects_010.phpt index bf980325945e..e316f32c56b9 100644 --- a/ext/standard/tests/serialize/serialization_objects_010.phpt +++ b/ext/standard/tests/serialize/serialization_objects_010.phpt @@ -14,12 +14,12 @@ Class C implements Serializable { try { var_dump(serialize(new C)); } catch (Exception $e) { - echo $e->getMessage(). "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; ?> --EXPECTF-- Deprecated: %s implements the Serializable interface, which is deprecated. Implement __serialize() and __unserialize() instead (or in addition, if support for old PHP versions is necessary) in %s on line %d -C::serialize() must return a string or NULL +Exception: C::serialize() must return a string or NULL Done diff --git a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt index ef2f575d5814..e791d0a0ae11 100644 --- a/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt +++ b/ext/standard/tests/serialize/splobjectstorage_negative_count.phpt @@ -9,9 +9,9 @@ $str = 'C:16:"SplObjectStorage":25:{x:i:-9223372036854775808;}'; try { var_dump(unserialize($str)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Error at offset 24 of 25 bytes +UnexpectedValueException: Error at offset 24 of 25 bytes diff --git a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt index 0e41ee82a5f5..23677cce8adf 100644 --- a/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt +++ b/ext/standard/tests/serialize/typed_property_ref_assignment_failure.phpt @@ -13,7 +13,7 @@ STR; try { var_dump(unserialize($s)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $s = <<<'STR' @@ -23,7 +23,7 @@ var_dump(unserialize($s)); ?> --EXPECTF-- -Cannot assign stdClass to property Test::$prop of type int +TypeError: Cannot assign stdClass to property Test::$prop of type int Warning: unserialize(): Error at offset 38 of 38 bytes in %s on line %d bool(false) diff --git a/ext/standard/tests/serialize/typed_property_refs.phpt b/ext/standard/tests/serialize/typed_property_refs.phpt index 9c71d460c2cc..70481aa74fff 100644 --- a/ext/standard/tests/serialize/typed_property_refs.phpt +++ b/ext/standard/tests/serialize/typed_property_refs.phpt @@ -35,27 +35,27 @@ var_dump(unserialize('O:1:"E":2:{s:1:"a";i:1;s:1:"b";R:2;}')); try { var_dump(unserialize('O:1:"A":2:{s:1:"a";N;s:1:"b";R:2;}')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"B":2:{s:1:"a";N;s:1:"b";R:2;}')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"C":2:{s:1:"a";i:1;s:1:"b";R:2;}')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"C":2:{s:1:"b";s:1:"x";s:1:"a";R:2;}')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(unserialize('O:1:"D":2:{s:1:"a";i:1;s:1:"b";R:2;}')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -78,8 +78,8 @@ object(E)#1 (2) { ["b"]=> &int(1) } -Cannot assign null to property A::$a of type int -Cannot assign null to property B::$b of type int -Cannot assign int to property C::$b of type string -Cannot assign string to property C::$a of type int -Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float +TypeError: Cannot assign null to property A::$a of type int +TypeError: Cannot assign null to property B::$b of type int +TypeError: Cannot assign int to property C::$b of type string +TypeError: Cannot assign string to property C::$a of type int +TypeError: Reference with value of type int held by property D::$a of type int is not compatible with property D::$b of type float diff --git a/ext/standard/tests/serialize/unserialize_abstract_class.phpt b/ext/standard/tests/serialize/unserialize_abstract_class.phpt index e835e5046693..ab7fc26b026c 100644 --- a/ext/standard/tests/serialize/unserialize_abstract_class.phpt +++ b/ext/standard/tests/serialize/unserialize_abstract_class.phpt @@ -7,9 +7,9 @@ $payload = 'O:23:"RecursiveFilterIterator":0:{}'; try { var_dump(unserialize($payload)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot instantiate abstract class RecursiveFilterIterator +Error: Cannot instantiate abstract class RecursiveFilterIterator diff --git a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt index f390c36a78fe..ba7a9f31b938 100644 --- a/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt +++ b/ext/standard/tests/serialize/unserialize_allowed_classes_option_invalid_value.phpt @@ -11,24 +11,24 @@ $s = serialize($z); try { unserialize($s, ["allowed_classes" => null]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 0]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { unserialize($s, ["allowed_classes" => 1]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -unserialize(): Option "allowed_classes" must be of type array|bool, null given -unserialize(): Option "allowed_classes" must be of type array|bool, int given -unserialize(): Option "allowed_classes" must be of type array|bool, int given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, null given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given +TypeError: unserialize(): Option "allowed_classes" must be of type array|bool, int given diff --git a/ext/standard/tests/serialize/unserialize_leak.phpt b/ext/standard/tests/serialize/unserialize_leak.phpt index bbc4bb6facae..be2f176df103 100644 --- a/ext/standard/tests/serialize/unserialize_leak.phpt +++ b/ext/standard/tests/serialize/unserialize_leak.phpt @@ -7,10 +7,10 @@ $payload = 'C:16:"SplObjectStorage":113:{x:i:2;O:8:"stdClass":1:{},a:2:{s:4:"pre try { var_dump(unserialize($payload)); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- Warning: SplObjectStorage::unserialize(): Unexpected end of serialized data in %s on line %d -Error at offset 24 of 113 bytes +UnexpectedValueException: Error at offset 24 of 113 bytes diff --git a/ext/standard/tests/setcookie_samesite_validation.phpt b/ext/standard/tests/setcookie_samesite_validation.phpt index 3827f04fe8d4..ceebc93b4eed 100644 --- a/ext/standard/tests/setcookie_samesite_validation.phpt +++ b/ext/standard/tests/setcookie_samesite_validation.phpt @@ -22,19 +22,19 @@ var_dump(setrawcookie('test', 'value', ['samesite' => 'Lax'])); try { setcookie('test', 'value', ['samesite' => 'Invalid']); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setcookie('test', 'value', ['samesite' => "Strict\r\nX-Injected: evil"]); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setrawcookie('test', 'value', ['samesite' => 'Invalid']); } catch (ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -47,6 +47,6 @@ bool(true) bool(true) bool(true) bool(true) -setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" -setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" -setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setcookie(): "samesite" option must be "Strict", "Lax", "None", or "" +ValueError: setrawcookie(): "samesite" option must be "Strict", "Lax", "None", or "" diff --git a/ext/standard/tests/streams/bug44712.phpt b/ext/standard/tests/streams/bug44712.phpt index 04b7e5ce4092..6493ec7eaf8b 100644 --- a/ext/standard/tests/streams/bug44712.phpt +++ b/ext/standard/tests/streams/bug44712.phpt @@ -6,8 +6,8 @@ $ctx = stream_context_get_default(); try { stream_context_set_params($ctx, array("options" => 1)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Invalid stream/context parameter +TypeError: Invalid stream/context parameter diff --git a/ext/standard/tests/streams/bug54623.phpt b/ext/standard/tests/streams/bug54623.phpt index d7383fcc8f7e..f811db0221d1 100644 --- a/ext/standard/tests/streams/bug54623.phpt +++ b/ext/standard/tests/streams/bug54623.phpt @@ -12,10 +12,10 @@ fclose($sock2); try { fwrite($sock, "3"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- int(%d) int(%d) -fwrite(): Argument #1 ($stream) must be an open stream resource +TypeError: fwrite(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/streams/bug61115.phpt b/ext/standard/tests/streams/bug61115.phpt index 9dfc27a9438d..cf1dc6be2e17 100644 --- a/ext/standard/tests/streams/bug61115.phpt +++ b/ext/standard/tests/streams/bug61115.phpt @@ -10,8 +10,8 @@ stream_context_set_params($resourceFileTemp, array()); try { preg_replace('', function() {}, $resourceFileTemp); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given +TypeError: preg_replace(): Argument #2 ($replacement) must be of type array|string, Closure given diff --git a/ext/standard/tests/streams/bug67626.phpt b/ext/standard/tests/streams/bug67626.phpt index 54be1b51130e..cbffdd7a12b2 100644 --- a/ext/standard/tests/streams/bug67626.phpt +++ b/ext/standard/tests/streams/bug67626.phpt @@ -33,15 +33,15 @@ $fp = fopen('my://foobar', 'r+'); try { fread($fp, 42); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo "\n"; + try { fwrite($fp, 'foobar'); } catch (Exception $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -stream_read_exception -stream_write_exception +Exception: stream_read_exception +Exception: stream_write_exception diff --git a/ext/standard/tests/streams/bug71884.phpt b/ext/standard/tests/streams/bug71884.phpt index 3c5f841b3d3d..91c349a3ed76 100644 --- a/ext/standard/tests/streams/bug71884.phpt +++ b/ext/standard/tests/streams/bug71884.phpt @@ -7,8 +7,8 @@ $arr[0]['A']=0; try { stream_context_get_default($arr); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Options should have the form ["wrappername"]["optionname"] = $value +ValueError: Options should have the form ["wrappername"]["optionname"] = $value diff --git a/ext/standard/tests/streams/bug74951.phpt b/ext/standard/tests/streams/bug74951.phpt index 2668f541fb3c..35eb85d84431 100644 --- a/ext/standard/tests/streams/bug74951.phpt +++ b/ext/standard/tests/streams/bug74951.phpt @@ -10,7 +10,7 @@ trait Stream00ploiter{ try { stream_wrapper_register('e0ploit','Stream00ploiter'); } catch (\Throwable $e) { - echo $e::class, ': ', $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/standard/tests/streams/bug76857.phpt b/ext/standard/tests/streams/bug76857.phpt index efc549e683a9..6f4e10515b12 100644 --- a/ext/standard/tests/streams/bug76857.phpt +++ b/ext/standard/tests/streams/bug76857.phpt @@ -17,4 +17,4 @@ string(9) "test data" --CLEAN-- \ No newline at end of file +?> diff --git a/ext/standard/tests/streams/gh14506.phpt b/ext/standard/tests/streams/gh14506.phpt index 3d82350221d5..93ffb77a6cb3 100644 --- a/ext/standard/tests/streams/gh14506.phpt +++ b/ext/standard/tests/streams/gh14506.phpt @@ -65,13 +65,13 @@ $empty = []; try { stream_select($streams, $streams,$empty, 0); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } fflush($readStream); try { fclose($readStream); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -91,5 +91,5 @@ Warning: fclose(): cannot close the provided stream, as it must not be manually Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d Warning: stream_select(): Cannot represent a stream of type user-space as a select()able descriptor in %s on line %d -No stream arrays were passed -fclose(): Argument #1 ($stream) must be an open stream resource +ValueError: No stream arrays were passed +TypeError: fclose(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/standard/tests/streams/gh14780.phpt b/ext/standard/tests/streams/gh14780.phpt index 064e496b1753..3459caa6c26b 100644 --- a/ext/standard/tests/streams/gh14780.phpt +++ b/ext/standard/tests/streams/gh14780.phpt @@ -11,28 +11,28 @@ $err = null; try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MAX/100000)+1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, (PHP_INT_MIN/100000)-1); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(pfsockopen('udp://127.0.0.1', '63844', $code, $err, -1)); try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, NAN); } catch (\ValueError $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pfsockopen('udp://127.0.0.1', '63844', $code, $err, INF); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -pfsockopen(): Argument #6 must be -1 or between 0 and %s -pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s resource(%d) of type (persistent stream) -pfsockopen(): Argument #6 must be -1 or between 0 and %s -pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s +ValueError: pfsockopen(): Argument #6 must be -1 or between 0 and %s diff --git a/ext/standard/tests/streams/gh15908.phpt b/ext/standard/tests/streams/gh15908.phpt index 31714b20530a..fa5c7dda7f54 100644 --- a/ext/standard/tests/streams/gh15908.phpt +++ b/ext/standard/tests/streams/gh15908.phpt @@ -27,7 +27,7 @@ $f = fopen("test://", "r"); try { file_put_contents(__DIR__."/gh15908.tmp", $f, FILE_USE_INCLUDE_PATH, $f); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --CLEAN-- @@ -35,4 +35,4 @@ try { @unlink(__DIR__."/gh15908.tmp"); ?> --EXPECT-- -file_put_contents(): supplied resource is not a valid Stream-Context resource +TypeError: file_put_contents(): supplied resource is not a valid Stream-Context resource diff --git a/ext/standard/tests/streams/non_finite_values.phpt b/ext/standard/tests/streams/non_finite_values.phpt index 5dba0d3b4826..f965df30983f 100644 --- a/ext/standard/tests/streams/non_finite_values.phpt +++ b/ext/standard/tests/streams/non_finite_values.phpt @@ -7,7 +7,7 @@ foreach ([NAN, -NAN, INF, -INF] as $value) { try { stream_socket_accept($socket, $value); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } fclose($socket); @@ -16,16 +16,16 @@ foreach ([NAN, -NAN, INF, -INF] as $value) { try { stream_socket_client("tcp://0.0.0.0:14781", timeout: $value); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_accept(): Argument #2 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value -stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_accept(): Argument #2 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value +ValueError: stream_socket_client(): Argument #4 ($timeout) must be a finite value diff --git a/ext/standard/tests/streams/stream_context_create_error.phpt b/ext/standard/tests/streams/stream_context_create_error.phpt index 0789fa34869b..8e9d3c9590f4 100644 --- a/ext/standard/tests/streams/stream_context_create_error.phpt +++ b/ext/standard/tests/streams/stream_context_create_error.phpt @@ -5,22 +5,22 @@ Test the error cases of stream_context_create() try { stream_context_create(['ssl' => "abc"]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => ['ssl' => "abc"]]); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_context_create(['ssl' => ['verify_peer'=> false]], ["options" => false]); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Options should have the form ["wrappername"]["optionname"] = $value -Options should have the form ["wrappername"]["optionname"] = $value -Invalid stream/context parameter +ValueError: Options should have the form ["wrappername"]["optionname"] = $value +ValueError: Options should have the form ["wrappername"]["optionname"] = $value +TypeError: Invalid stream/context parameter diff --git a/ext/standard/tests/streams/stream_context_set_option_error.phpt b/ext/standard/tests/streams/stream_context_set_option_error.phpt index e52bb882f662..edd2437be108 100644 --- a/ext/standard/tests/streams/stream_context_set_option_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_option_error.phpt @@ -7,29 +7,29 @@ $ctx = stream_context_create(); try { stream_context_set_option($ctx, [], "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, [], null, "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { stream_context_set_option($ctx, "x", "y"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array -stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array +ValueError: stream_context_set_option(): Argument #3 ($option_name) must be null when argument #2 ($wrapper_or_options) is an array +ValueError: stream_context_set_option(): Argument #4 ($value) cannot be provided when argument #2 ($wrapper_or_options) is an array Deprecated: Calling stream_context_set_option() with 2 arguments is deprecated, use stream_context_set_options() instead in %s on line %d -stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string -stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string +ValueError: stream_context_set_option(): Argument #3 ($option_name) cannot be null when argument #2 ($wrapper_or_options) is a string +ValueError: stream_context_set_option(): Argument #4 ($value) must be provided when argument #2 ($wrapper_or_options) is a string diff --git a/ext/standard/tests/streams/stream_context_set_options_error.phpt b/ext/standard/tests/streams/stream_context_set_options_error.phpt index b047e14f1336..7b09373948dc 100644 --- a/ext/standard/tests/streams/stream_context_set_options_error.phpt +++ b/ext/standard/tests/streams/stream_context_set_options_error.phpt @@ -14,8 +14,8 @@ $process = proc_open('nothing', $description, $pipes); try { stream_context_set_options($process, []); } catch (TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -stream_context_set_options(): Argument #1 ($context) must be a valid stream/context +TypeError: stream_context_set_options(): Argument #1 ($context) must be a valid stream/context diff --git a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt index e20e294180cc..d25223b34db2 100644 --- a/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt +++ b/ext/standard/tests/streams/stream_context_tcp_nodelay_server.phpt @@ -37,4 +37,3 @@ ServerClientTestCase::getInstance()->run($clientCode, $serverCode); ?> --EXPECTF-- server-delay:conn-nodelay - diff --git a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt index 6f470c61d1a1..8192aa07b495 100644 --- a/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt +++ b/ext/standard/tests/streams/stream_errors_exception_mode_terminal.phpt @@ -12,7 +12,7 @@ $context = stream_context_create([ try { $stream = fopen('php://nonexistent', 'r', false, $context); } catch (StreamException $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; echo "Code: " . $e->getCode() . "\n"; $errors = $e->getErrors(); @@ -25,7 +25,7 @@ try { ?> --EXPECTF-- -Caught: Failed to open stream: operation failed +StreamException: Failed to open stream: operation failed Code: 21 Wrapper: PHP Error code name: OpenFailed diff --git a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt index 49c18616dad3..99dda7655fdf 100644 --- a/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt +++ b/ext/standard/tests/streams/stream_errors_mix_modes_storage.phpt @@ -41,7 +41,7 @@ function stream_test_errors($title, $contextOptions) { $except = NULL; stream_select($read, $write, $except, 0, 0, $context); } catch (StreamException $e) { - echo 'EXCEPTION: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $errors = stream_last_errors(); @@ -130,7 +130,7 @@ Error details: [1] CastNotSupported: Cannot represent a stream of type user-space as a select()able descriptor AUTO EXCEPTION -EXCEPTION: TestStream::stream_cast is not implemented! +StreamException: TestStream::stream_cast is not implemented! Error details: - Message: TestStream::stream_read - read 10 bytes more data than requested (8202 read, 8192 max) - excess data will be lost - Code: UserspaceInvalidReturn diff --git a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt index 46fc0f7fd34b..0cceb880331c 100644 --- a/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt +++ b/ext/standard/tests/streams/stream_errors_set_default_context_error.phpt @@ -10,9 +10,9 @@ try { ] ]); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Stream error handling options cannot be set on the default context +ValueError: Stream error handling options cannot be set on the default context diff --git a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt index a12b98422c30..53b5f3d8edfb 100644 --- a/ext/standard/tests/streams/stream_get_contents_negative_length.phpt +++ b/ext/standard/tests/streams/stream_get_contents_negative_length.phpt @@ -10,10 +10,10 @@ var_dump(stream_get_contents($tmp, 2, 1)); try { stream_get_contents($tmp, -2); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- string(2) "bc" -stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1 +ValueError: stream_get_contents(): Argument #2 ($length) must be greater than or equal to -1 diff --git a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt index 55bdd1860a47..7f013fbe4482 100644 --- a/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt +++ b/ext/standard/tests/streams/stream_get_meta_data_file_error.phpt @@ -10,7 +10,7 @@ fclose($fp); try { var_dump(stream_get_meta_data($fp)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -19,5 +19,5 @@ echo "Done"; *** Testing stream_get_meta_data() : error conditions *** -- Testing stream_get_meta_data() function with closed stream resource -- -stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_get_meta_data(): Argument #1 ($stream) must be an open stream resource Done diff --git a/ext/standard/tests/streams/stream_read_object_return.phpt b/ext/standard/tests/streams/stream_read_object_return.phpt index 08555bcc3a98..7674f29f6fb2 100644 --- a/ext/standard/tests/streams/stream_read_object_return.phpt +++ b/ext/standard/tests/streams/stream_read_object_return.phpt @@ -18,8 +18,8 @@ stream_wrapper_register('mystream', MyStream::class); try { var_dump(file_get_contents('mystream://')); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string diff --git a/ext/standard/tests/streams/stream_set_chunk_size.phpt b/ext/standard/tests/streams/stream_set_chunk_size.phpt index 8bb5b46b7f94..ca4997196a87 100644 --- a/ext/standard/tests/streams/stream_set_chunk_size.phpt +++ b/ext/standard/tests/streams/stream_set_chunk_size.phpt @@ -53,12 +53,12 @@ echo "\nerror conditions\n"; try { stream_set_chunk_size($f, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stream_set_chunk_size($f, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- @@ -90,5 +90,5 @@ write with size: 50 int(3) error conditions -stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 -stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 +ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 +ValueError: stream_set_chunk_size(): Argument #2 ($size) must be greater than 0 diff --git a/ext/standard/tests/streams/stream_set_timeout_error.phpt b/ext/standard/tests/streams/stream_set_timeout_error.phpt index 5567cb159914..ac446d4b1828 100644 --- a/ext/standard/tests/streams/stream_set_timeout_error.phpt +++ b/ext/standard/tests/streams/stream_set_timeout_error.phpt @@ -23,7 +23,7 @@ fclose($client); try { var_dump( stream_set_timeout($client, $seconds) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing stream_set_timeout() function with a stream that does not support timeouts --\n"; @@ -39,7 +39,7 @@ echo "Done"; *** Testing stream_set_timeout() : error conditions *** -- Testing stream_set_timeout() function with a closed socket -- -stream_set_timeout(): Argument #1 ($stream) must be an open stream resource +TypeError: stream_set_timeout(): Argument #1 ($stream) must be an open stream resource -- Testing stream_set_timeout() function with a stream that does not support timeouts -- bool(false) diff --git a/ext/standard/tests/strings/bug33605.phpt b/ext/standard/tests/strings/bug33605.phpt index 94b57b20dcd0..18ec991eda85 100644 --- a/ext/standard/tests/strings/bug33605.phpt +++ b/ext/standard/tests/strings/bug33605.phpt @@ -5,9 +5,9 @@ Bug #33605 (substr_compare crashes) try { substr_compare("aa", "a", -99999999, -1, 0); } catch (\ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -substr_compare(): Argument #4 ($length) must be greater than or equal to 0 +ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/bug36944.phpt b/ext/standard/tests/strings/bug36944.phpt index d77561249857..a9618489f1d1 100644 --- a/ext/standard/tests/strings/bug36944.phpt +++ b/ext/standard/tests/strings/bug36944.phpt @@ -6,7 +6,7 @@ Bug #36944 (strncmp & strncasecmp do not return false on negative string length) try { var_dump(strncmp("test ", "e", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(strncmp("test ", "e", 10)); var_dump(strncmp("test ", "e", 0)); @@ -14,16 +14,16 @@ var_dump(strncmp("test ", "e", 0)); try { var_dump(strncasecmp("test ", "E", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(strncasecmp("test ", "E", 10)); var_dump(strncasecmp("test ", "E", 0)); ?> --EXPECTF-- -strncmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0 int(%d) int(0) -strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 int(%d) int(0) diff --git a/ext/standard/tests/strings/bug40754.phpt b/ext/standard/tests/strings/bug40754.phpt index 41032a9405f1..b1623852750c 100644 --- a/ext/standard/tests/strings/bug40754.phpt +++ b/ext/standard/tests/strings/bug40754.phpt @@ -13,61 +13,61 @@ var_dump(strcspn("abcde", "abc", $v, $v)); try { var_dump(substr_count("abcde", "abc", $v, $v)); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_compare("abcde", "abc", $v, $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", $v, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { substr_count("abcde", "abc", 1, $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { stripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos("abcde", "abc", $v); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(strncmp("abcde", "abc", $v)); @@ -80,16 +80,16 @@ string(4) "bcde" string(6) "abcdex" int(0) int(0) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_compare(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(1) string(8) "abcdeabc" string(0) "" diff --git a/ext/standard/tests/strings/bug54322.phpt b/ext/standard/tests/strings/bug54322.phpt index 8f12cd80f7f8..6515b89ea9bf 100644 --- a/ext/standard/tests/strings/bug54322.phpt +++ b/ext/standard/tests/strings/bug54322.phpt @@ -5,8 +5,8 @@ Bug #54322: Null pointer deref in get_html_translation_table due to information try { var_dump(get_html_translation_table(NAN, 0, "UTF-8") > 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -get_html_translation_table(): Argument #1 ($table) must be of type int, float given +TypeError: get_html_translation_table(): Argument #1 ($table) must be of type int, float given diff --git a/ext/standard/tests/strings/bug67249.phpt b/ext/standard/tests/strings/bug67249.phpt index a0e0843f4b19..244ce29abcc9 100644 --- a/ext/standard/tests/strings/bug67249.phpt +++ b/ext/standard/tests/strings/bug67249.phpt @@ -5,8 +5,8 @@ Bug #67249 (printf out-of-bounds read) try { var_dump(sprintf("%'", "foo")); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Missing padding character +ValueError: Missing padding character diff --git a/ext/standard/tests/strings/bug69751.phpt b/ext/standard/tests/strings/bug69751.phpt index f75af897e0e5..631204268d77 100644 --- a/ext/standard/tests/strings/bug69751.phpt +++ b/ext/standard/tests/strings/bug69751.phpt @@ -6,23 +6,23 @@ Bug #69751: Change Error message of sprintf/printf for missing/typo position spe try { sprintf('%$s, %2$s %1$s', "a", "b"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%3$s, %2$s %1$s', "a", "b"); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { sprintf('%2147483648$s, %2$s %1$s', "a", "b"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -Argument number specifier must be greater than zero and less than %d -4 arguments are required, 3 given -Argument number specifier must be greater than zero and less than %d +ValueError: Argument number specifier must be greater than zero and less than %d +ArgumentCountError: 4 arguments are required, 3 given +ValueError: Argument number specifier must be greater than zero and less than %d diff --git a/ext/standard/tests/strings/bug78833.phpt b/ext/standard/tests/strings/bug78833.phpt index 7712e133face..a4d638c4e93e 100644 --- a/ext/standard/tests/strings/bug78833.phpt +++ b/ext/standard/tests/strings/bug78833.phpt @@ -5,8 +5,8 @@ Bug #78833 (Integer overflow in pack causes out-of-bound access) try { var_dump(pack("E2E2147483647H*", 0x0, 0x0, 0x0)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Type E: too few arguments +ValueError: Type E: too few arguments diff --git a/ext/standard/tests/strings/chr_error.phpt b/ext/standard/tests/strings/chr_error.phpt index aee28604d5b8..0b94bfc7a79d 100644 --- a/ext/standard/tests/strings/chr_error.phpt +++ b/ext/standard/tests/strings/chr_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing chr() function with no arguments --\n"; try { var_dump( chr() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing chr() function with more than expected no. of arguments --\n"; @@ -17,7 +17,7 @@ $extra_arg = 10; try { var_dump( chr(72, $extra_arg) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -25,7 +25,7 @@ try { *** Testing chr() : error conditions *** -- Testing chr() function with no arguments -- -chr() expects exactly 1 argument, 0 given +ArgumentCountError: chr() expects exactly 1 argument, 0 given -- Testing chr() function with more than expected no. of arguments -- -chr() expects exactly 1 argument, 2 given +ArgumentCountError: chr() expects exactly 1 argument, 2 given diff --git a/ext/standard/tests/strings/chunk_split_variation5.phpt b/ext/standard/tests/strings/chunk_split_variation5.phpt index 8f51c001eecf..d4ada8ba14f9 100644 --- a/ext/standard/tests/strings/chunk_split_variation5.phpt +++ b/ext/standard/tests/strings/chunk_split_variation5.phpt @@ -35,9 +35,9 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( chunk_split($str, $values[$count], $ending) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -45,12 +45,12 @@ for($count = 0; $count < count($values); $count++) { --EXPECTF-- *** Testing chunk_split() : different integer values for 'chunklen' *** -- Iteration 0 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 1 -- string(213) "T||h||i||s|| ||c||o||n||t||a||i||n||s|| ||a||n||d|| ||s||p||e||c||i||a||l|| ||c||h||a||r|| ||&|| ||n||u||m||b||e||r||s|| ||1||2||3||.|| ||I||t|| ||a||l||s||o|| ||c||h||e||c||k||s|| ||f||o||r|| ||%0|| ||c||h||a||r||" -- Iteration 2 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 3 -- string(73) "This contains and special char & numbers 123. It also checks for %0 char||" @@ -61,6 +61,6 @@ It als||o checks for %0 char||" string(73) "This contains and special char & numbers 123. It also checks for %0 char||" -- Iteration 6 -- -chunk_split(): Argument #2 ($length) must be of type int, float given +TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given -- Iteration 7 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/chunk_split_variation8.phpt b/ext/standard/tests/strings/chunk_split_variation8.phpt index b0c889494e40..00d58c6b87e5 100644 --- a/ext/standard/tests/strings/chunk_split_variation8.phpt +++ b/ext/standard/tests/strings/chunk_split_variation8.phpt @@ -43,9 +43,9 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( chunk_split($heredoc_str, $values[$count], $ending) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } @@ -53,14 +53,14 @@ for($count = 0; $count < count($values); $count++) { --EXPECT-- *** Testing chunk_split() : different 'chunklen' with heredoc 'str' *** -- Iteration 1 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- string(504) "T:::h:::i:::s:::':::s::: :::h:::e:::r:::e:::d:::o:::c::: :::s:::t:::r:::i:::n:::g::: :::w:::i:::t:::h::: ::: ::: :::a:::n:::d::: ::: ::: :::w:::h:::i:::t:::e::: :::s:::p:::a:::c:::e::: :::c:::h:::a:::r:::.::: :::I:::t::: :::h:::a:::s::: :::_:::s:::p:::e:::c:::i:::@:::l::: :::c:::h:::@:::r:::$::: :::2:::2:::2:::2::: :::!:::!:::!:::N:::o:::w::: :::\:::k::: :::a:::s::: :::e:::s:::c:::a:::p:::e::: :::c:::h:::a:::r::: :::t:::o::: :::t:::e:::s:::t::: :::c:::h:::u:::n:::k:::_:::s:::p:::l:::i:::t:::(:::):::" -- Iteration 3 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- string(129) "This's heredoc string with and white space char. @@ -77,6 +77,6 @@ string(129) "This's heredoc string with and It has _speci@l ch@r$ 2222 !!!Now \k as escape char to test chunk_split():::" -- Iteration 7 -- -chunk_split(): Argument #2 ($length) must be of type int, float given +TypeError: chunk_split(): Argument #2 ($length) must be of type int, float given -- Iteration 8 -- -chunk_split(): Argument #2 ($length) must be greater than 0 +ValueError: chunk_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/count_chars_basic.phpt b/ext/standard/tests/strings/count_chars_basic.phpt index ccf8cd47ac04..ab5f5c6a30af 100644 --- a/ext/standard/tests/strings/count_chars_basic.phpt +++ b/ext/standard/tests/strings/count_chars_basic.phpt @@ -17,7 +17,7 @@ var_dump(bin2hex(count_chars($string, 4))); try { count_chars($string, 5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -1569,4 +1569,4 @@ array(238) { } string(18) " Rabcdefghimnorstu" string(476) "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f2122232425262728292a2b2c2d2e2f303132333435363738393a3b3c3d3e3f404142434445464748494a4b4c4d4e4f5051535455565758595a5b5c5d5e5f606a6b6c7071767778797a7b7c7d7e7f808182838485868788898a8b8c8d8e8f909192939495969798999a9b9c9d9e9fa0a1a2a3a4a5a6a7a8a9aaabacadaeafb0b1b2b3b4b5b6b7b8b9babbbcbdbebfc0c1c2c3c4c5c6c7c8c9cacbcccdcecfd0d1d2d3d4d5d6d7d8d9dadbdcdddedfe0e1e2e3e4e5e6e7e8e9eaebecedeeeff0f1f2f3f4f5f6f7f8f9fafbfcfdfeff" -count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive) +ValueError: count_chars(): Argument #2 ($mode) must be between 0 and 4 (inclusive) diff --git a/ext/standard/tests/strings/crypt.phpt b/ext/standard/tests/strings/crypt.phpt index 1d2365655533..c9c5837cc111 100644 --- a/ext/standard/tests/strings/crypt.phpt +++ b/ext/standard/tests/strings/crypt.phpt @@ -21,7 +21,7 @@ echo (CRYPT_BLOWFISH) ? ((crypt($str, $salt4) === $res_4) ? 'BLO' : 'BLO - ERROR try { var_dump(crypt($str)); } catch (ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -30,4 +30,4 @@ STD EXT MD5 BLO -crypt() expects exactly 2 arguments, 1 given +ArgumentCountError: crypt() expects exactly 2 arguments, 1 given diff --git a/ext/standard/tests/strings/dirname_error.phpt b/ext/standard/tests/strings/dirname_error.phpt index 16b0e94939d3..550c487964bc 100644 --- a/ext/standard/tests/strings/dirname_error.phpt +++ b/ext/standard/tests/strings/dirname_error.phpt @@ -8,10 +8,10 @@ echo "*** Testing error conditions ***\n"; try { dirname("/var/tmp/bar.gz", 0); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- *** Testing error conditions *** -dirname(): Argument #2 ($levels) must be greater than or equal to 1 +ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1 diff --git a/ext/standard/tests/strings/dirname_multi.phpt b/ext/standard/tests/strings/dirname_multi.phpt index 1c7875ad1569..081668487978 100644 --- a/ext/standard/tests/strings/dirname_multi.phpt +++ b/ext/standard/tests/strings/dirname_multi.phpt @@ -11,13 +11,13 @@ for ($i=0 ; $i<5 ; $i++) { try { var_dump(dirname("/foo/bar/baz", $i)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } var_dump(dirname("/foo/bar/baz", PHP_INT_MAX)); ?> --EXPECT-- -dirname(): Argument #2 ($levels) must be greater than or equal to 1 +ValueError: dirname(): Argument #2 ($levels) must be greater than or equal to 1 string(8) "/foo/bar" string(4) "/foo" string(1) "/" diff --git a/ext/standard/tests/strings/explode.phpt b/ext/standard/tests/strings/explode.phpt index 248fade7605c..3d41319100f1 100644 --- a/ext/standard/tests/strings/explode.phpt +++ b/ext/standard/tests/strings/explode.phpt @@ -17,17 +17,17 @@ echo "\n"; try { var_dump(explode("", "")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode("", NULL)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(explode(NULL, "")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(explode("a", "")); @@ -36,7 +36,7 @@ var_dump(explode("a", NULL)); try { var_dump(explode(NULL, "a")); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(explode("abc", "acb")); var_dump(explode("somestring", "otherstring")); @@ -62,9 +62,9 @@ array ( 4 => 'd', ) d6bee42a771449205344c0938ad4f035 -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters array(1) { [0]=> string(0) "" @@ -79,7 +79,7 @@ array(1) { [0]=> string(0) "" } -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters array(1) { [0]=> string(3) "acb" diff --git a/ext/standard/tests/strings/explode1.phpt b/ext/standard/tests/strings/explode1.phpt index 022654a57643..90fe352d16ed 100644 --- a/ext/standard/tests/strings/explode1.phpt +++ b/ext/standard/tests/strings/explode1.phpt @@ -30,22 +30,22 @@ foreach($delimiters as $delimiter) { try { var_dump( explode($delimiter, $string, -1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 0) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 1) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( explode($delimiter, $string, 2) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; } @@ -91,15 +91,15 @@ var_dump( explode("b", $obj) ); --EXPECT-- *** Testing explode() for basic operations *** -- Iteration 1 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 2 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 3 -- array(1) { [0]=> @@ -201,10 +201,10 @@ array(2) { string(56) "234NULL23abcd00000TRUEFALSE-11.234444true-11.24%PHP%ZEND" } -- Iteration 7 -- -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters +ValueError: explode(): Argument #1 ($separator) must not be empty, use str_split() to split a string into characters -- Iteration 8 -- array(2) { [0]=> diff --git a/ext/standard/tests/strings/fprintf_error.phpt b/ext/standard/tests/strings/fprintf_error.phpt index 39bc3ebff3be..b65db01f912f 100644 --- a/ext/standard/tests/strings/fprintf_error.phpt +++ b/ext/standard/tests/strings/fprintf_error.phpt @@ -10,28 +10,28 @@ echo "*** Testing Error Conditions ***\n"; try { var_dump( fprintf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* scalar argument */ try { var_dump( fprintf(3) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL argument */ try { var_dump( fprintf(NULL) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- *** Testing Error Conditions *** -fprintf() expects at least 2 arguments, 0 given -fprintf() expects at least 2 arguments, 1 given -fprintf() expects at least 2 arguments, 1 given +ArgumentCountError: fprintf() expects at least 2 arguments, 0 given +ArgumentCountError: fprintf() expects at least 2 arguments, 1 given +ArgumentCountError: fprintf() expects at least 2 arguments, 1 given Done diff --git a/ext/standard/tests/strings/gh11982.phpt b/ext/standard/tests/strings/gh11982.phpt index e5e45e7e1968..48993697f855 100644 --- a/ext/standard/tests/strings/gh11982.phpt +++ b/ext/standard/tests/strings/gh11982.phpt @@ -23,4 +23,3 @@ array(2) { [1]=> string(1) "a" } - diff --git a/ext/standard/tests/strings/gh18823_strict.phpt b/ext/standard/tests/strings/gh18823_strict.phpt index 39ae11ef61bc..ce6567d01953 100644 --- a/ext/standard/tests/strings/gh18823_strict.phpt +++ b/ext/standard/tests/strings/gh18823_strict.phpt @@ -6,14 +6,14 @@ declare(strict_types=1); try { setlocale(LC_ALL, 0, "0"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { setlocale(LC_ALL, "0", 0); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -setlocale(): Argument #2 ($locales) must be of type array|string|null, int given -setlocale(): Argument #3 must be of type ?string, int given +TypeError: setlocale(): Argument #2 ($locales) must be of type array|string|null, int given +TypeError: setlocale(): Argument #3 must be of type ?string, int given diff --git a/ext/standard/tests/strings/gh18823_weak.phpt b/ext/standard/tests/strings/gh18823_weak.phpt index 2a2b82d9aaa3..0144016b0197 100644 --- a/ext/standard/tests/strings/gh18823_weak.phpt +++ b/ext/standard/tests/strings/gh18823_weak.phpt @@ -24,8 +24,8 @@ setlocale(LC_ALL, new MyStringable); try { setlocale(LC_ALL, new MyStringableThrow); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -no +Error: no diff --git a/ext/standard/tests/strings/gh20906_1.phpt b/ext/standard/tests/strings/gh20906_1.phpt index ccb0dfbee566..e2ecb3991326 100644 --- a/ext/standard/tests/strings/gh20906_1.phpt +++ b/ext/standard/tests/strings/gh20906_1.phpt @@ -17,7 +17,7 @@ class A { try { new A; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- diff --git a/ext/standard/tests/strings/implode_error.phpt b/ext/standard/tests/strings/implode_error.phpt index 417b3591e0dd..902629b8989f 100644 --- a/ext/standard/tests/strings/implode_error.phpt +++ b/ext/standard/tests/strings/implode_error.phpt @@ -6,24 +6,24 @@ Test implode() function: error conditions try { var_dump(implode("glue")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* NULL as pieces */ try { var_dump(implode("glue", NULL)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* integer as glue */ try { var_dump(implode(12, "pieces")); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -implode(): Argument #2 ($array) must be of type ?array, string given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): Argument #2 ($array) must be of type ?array, string given diff --git a/ext/standard/tests/strings/implode_variation.phpt b/ext/standard/tests/strings/implode_variation.phpt index 2cc0870f39f4..d4ba5e6bb328 100644 --- a/ext/standard/tests/strings/implode_variation.phpt +++ b/ext/standard/tests/strings/implode_variation.phpt @@ -50,7 +50,7 @@ foreach($glues as $glue) { try { var_dump(implode($glue, $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; } @@ -60,7 +60,7 @@ echo "\n*** Testing implode() on empty string ***\n"; try { implode(""); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* checking sub-arrays */ @@ -70,12 +70,12 @@ var_dump(implode("TEST", $sub_array)); try { var_dump(implode(array(1, 2, 3, 4), $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { var_dump(implode(2, $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n*** Testing implode() on objects ***\n"; @@ -185,7 +185,7 @@ string(35) "2101-639111PHP111 1string%0with%0...%0" -- Iteration 3 -- string(27) "20-6391PHP string%0with%0...%0" -- Iteration 4 -- -implode(): Argument #1 ($separator) must be of type string, array given +TypeError: implode(): Argument #1 ($separator) must be of type string, array given -- Iteration 5 -- string(27) "20-6391PHP string%0with%0...%0" -- Iteration 6 -- @@ -198,7 +198,7 @@ string(35) "2000-639010PHP000 0string%0with%0...%0" string(43) "2\00\0-639\01\0PHP\0\0\0 \0string%0with%0...%0" *** Testing implode() on empty string *** -implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given *** Testing implode() on sub-arrays *** @@ -206,7 +206,7 @@ Warning: Array to string conversion in %s on line %d Warning: Array to string conversion in %s on line %d string(27) "ArrayTESTArrayTESTPHPTEST50" -implode(): Argument #1 ($separator) must be of type string, array given +TypeError: implode(): Argument #1 ($separator) must be of type string, array given Warning: Array to string conversion in %s diff --git a/ext/standard/tests/strings/join_error.phpt b/ext/standard/tests/strings/join_error.phpt index 0029bcc34b08..8e0b8378a93b 100644 --- a/ext/standard/tests/strings/join_error.phpt +++ b/ext/standard/tests/strings/join_error.phpt @@ -11,7 +11,7 @@ $glue = 'string_val'; try { var_dump(join($glue)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done\n"; @@ -20,5 +20,5 @@ echo "Done\n"; *** Testing join() : error conditions *** -- Testing join() with less than expected no. of arguments -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/strings/join_error1.phpt b/ext/standard/tests/strings/join_error1.phpt index 0bb451a73d98..27a7741b72e9 100644 --- a/ext/standard/tests/strings/join_error1.phpt +++ b/ext/standard/tests/strings/join_error1.phpt @@ -85,7 +85,7 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter ++; @@ -101,49 +101,49 @@ echo "Done\n"; --- Testing join() by supplying different values for 'pieces' argument --- -- Iteration 1 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 2 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 3 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 4 -- -join(): Argument #2 ($array) must be of type ?array, int given +TypeError: join(): Argument #2 ($array) must be of type ?array, int given -- Iteration 5 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 6 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 7 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 8 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 9 -- -join(): Argument #2 ($array) must be of type ?array, float given +TypeError: join(): Argument #2 ($array) must be of type ?array, float given -- Iteration 10 -- -join(): Argument #2 ($array) must be of type ?array, true given +TypeError: join(): Argument #2 ($array) must be of type ?array, true given -- Iteration 11 -- -join(): Argument #2 ($array) must be of type ?array, false given +TypeError: join(): Argument #2 ($array) must be of type ?array, false given -- Iteration 12 -- -join(): Argument #2 ($array) must be of type ?array, true given +TypeError: join(): Argument #2 ($array) must be of type ?array, true given -- Iteration 13 -- -join(): Argument #2 ($array) must be of type ?array, false given +TypeError: join(): Argument #2 ($array) must be of type ?array, false given -- Iteration 14 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 15 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 16 -- -join(): Argument #2 ($array) must be of type ?array, test given +TypeError: join(): Argument #2 ($array) must be of type ?array, test given -- Iteration 17 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 18 -- -join(): Argument #2 ($array) must be of type ?array, string given +TypeError: join(): Argument #2 ($array) must be of type ?array, string given -- Iteration 19 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 20 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 21 -- -join(): Argument #2 ($array) must be of type ?array, resource given +TypeError: join(): Argument #2 ($array) must be of type ?array, resource given -- Iteration 22 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given -- Iteration 23 -- -join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given +TypeError: join(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given Done diff --git a/ext/standard/tests/strings/join_variation1.phpt b/ext/standard/tests/strings/join_variation1.phpt index 256f361460b2..5092f395718f 100644 --- a/ext/standard/tests/strings/join_variation1.phpt +++ b/ext/standard/tests/strings/join_variation1.phpt @@ -74,7 +74,7 @@ for($index = 0; $index < count($values); $index ++) { try { var_dump(join($glue, $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; @@ -105,15 +105,15 @@ string(29) "element11.07654321E-9element2" -- Iteration 9 -- string(19) "element10.5element2" -- Iteration 10 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 11 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 12 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 13 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 14 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 15 -- string(17) "element11element2" -- Iteration 16 -- @@ -129,5 +129,5 @@ string(16) "element1element2" -- Iteration 21 -- string(16) "element1element2" -- Iteration 22 -- -join(): Argument #1 ($separator) must be of type array|string, resource given +TypeError: join(): Argument #1 ($separator) must be of type array|string, resource given Done diff --git a/ext/standard/tests/strings/join_variation4.phpt b/ext/standard/tests/strings/join_variation4.phpt index 21774b4bca2e..94875ac75bc1 100644 --- a/ext/standard/tests/strings/join_variation4.phpt +++ b/ext/standard/tests/strings/join_variation4.phpt @@ -41,7 +41,7 @@ for($index = 0; $index < count($glues); $index ++) { try { var_dump(join($glues[$index], $pieces)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $counter++; } @@ -57,7 +57,7 @@ string(57) "2101-6391-1.3444111PHP111 16999.999999991string%0with%0...%0" -- Iteration 3 -- string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0" -- Iteration 4 -- -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given -- Iteration 5 -- string(47) "20-639-1.34441PHP 6999.99999999string%0with%0...%0" -- Iteration 6 -- diff --git a/ext/standard/tests/strings/join_variation5.phpt b/ext/standard/tests/strings/join_variation5.phpt index 9e5898d8c107..b5bbbd1a947d 100644 --- a/ext/standard/tests/strings/join_variation5.phpt +++ b/ext/standard/tests/strings/join_variation5.phpt @@ -16,7 +16,7 @@ var_dump(join("TEST", $sub_array)); try { var_dump(join(array(1, 2, 3, 4), $sub_array)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // numeric value as glue, pieces as array containing sub array @@ -35,7 +35,7 @@ Warning: Array to string conversion in %s on line %d Warning: Array to string conversion in %s on line %d string(27) "ArrayTESTArrayTESTPHPTEST50" -join(): Argument #1 ($separator) must be of type string, array given +TypeError: join(): Argument #1 ($separator) must be of type string, array given Warning: Array to string conversion in %s on line %d diff --git a/ext/standard/tests/strings/levenshtein_error_conditions.phpt b/ext/standard/tests/strings/levenshtein_error_conditions.phpt index 55e144b3b25b..30122f5dad5e 100644 --- a/ext/standard/tests/strings/levenshtein_error_conditions.phpt +++ b/ext/standard/tests/strings/levenshtein_error_conditions.phpt @@ -10,14 +10,14 @@ var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdef try { var_dump(levenshtein('AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv', 'A')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo '--- String 2 ---' . \PHP_EOL; var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsu')); try { var_dump(levenshtein('A', 'AbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrstuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuvwxyzAbcdefghijklmnopqrtsuv')); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } // TODO ValueError for negative costs? diff --git a/ext/standard/tests/strings/md5_file.phpt b/ext/standard/tests/strings/md5_file.phpt index a6fba9ea0384..7f927942545e 100644 --- a/ext/standard/tests/strings/md5_file.phpt +++ b/ext/standard/tests/strings/md5_file.phpt @@ -32,7 +32,7 @@ echo "\n*** Testing for error conditions ***\n"; try { var_dump( md5_file("") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } /* invalid filename */ var_dump( md5_file("aZrq16u") ); @@ -64,7 +64,7 @@ echo "\nDone"; ?> --EXPECTF-- *** Testing for error conditions *** -Path must not be empty +ValueError: Path must not be empty Warning: md5_file(): Failed to open stream: No such file or directory in %s on line %d bool(false) diff --git a/ext/standard/tests/strings/metaphone.phpt b/ext/standard/tests/strings/metaphone.phpt index 6b8f5c1c89d9..ddb9ca99992b 100644 --- a/ext/standard/tests/strings/metaphone.phpt +++ b/ext/standard/tests/strings/metaphone.phpt @@ -9,7 +9,7 @@ var_dump(metaphone(-1)); try { var_dump(metaphone("valid phrase", -1)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(metaphone("valid phrase", 0)); var_dump(metaphone("valid phrase", 10000)); @@ -30,7 +30,7 @@ echo "Done\n"; --EXPECT-- string(0) "" string(0) "" -metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0 +ValueError: metaphone(): Argument #2 ($max_phonemes) must be greater than or equal to 0 string(6) "FLTFRS" string(6) "FLTFRS" string(26) "0FLFRWRTKRFLNKHTLSLN0KLTR0" diff --git a/ext/standard/tests/strings/parse_str_null_bytes.phpt b/ext/standard/tests/strings/parse_str_null_bytes.phpt index fd0d94bb0fc8..f3690ae858db 100644 --- a/ext/standard/tests/strings/parse_str_null_bytes.phpt +++ b/ext/standard/tests/strings/parse_str_null_bytes.phpt @@ -6,9 +6,9 @@ parse_str() rejects null bytes try { parse_str("a=1\0&b=2", $result); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -parse_str(): Argument #1 ($string) must not contain any null bytes +ValueError: parse_str(): Argument #1 ($string) must not contain any null bytes diff --git a/ext/standard/tests/strings/pathinfo.phpt b/ext/standard/tests/strings/pathinfo.phpt index 1ff42a66121c..caf57db9cc4b 100644 --- a/ext/standard/tests/strings/pathinfo.phpt +++ b/ext/standard/tests/strings/pathinfo.phpt @@ -18,43 +18,43 @@ var_dump(pathinfo(__FILE__, PATHINFO_DIRNAME)); try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_FILENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_EXTENSION|PATHINFO_DIRNAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_FILENAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_EXTENSION); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME|PATHINFO_BASENAME); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_DIRNAME-1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { pathinfo(__FILE__, PATHINFO_ALL+1); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done\n"; @@ -128,12 +128,12 @@ string(12) "pathinfo.php" string(8) "pathinfo" string(3) "php" string(%d) "%s%estrings" -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants -pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be only one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants +ValueError: pathinfo(): Argument #2 ($flags) must be one of the PATHINFO_* constants Done diff --git a/ext/standard/tests/strings/printf_64bit.phpt b/ext/standard/tests/strings/printf_64bit.phpt index 083b7b2979db..f1d7fc1e11ef 100644 --- a/ext/standard/tests/strings/printf_64bit.phpt +++ b/ext/standard/tests/strings/printf_64bit.phpt @@ -31,7 +31,7 @@ echo "\n*** Output for zero argument ***\n"; try { printf(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Number of arguments not matching as specified in format field */ @@ -42,12 +42,12 @@ $name = "voudras"; try { printf("%d $string %s", $nbr, $name); } catch (\ArgumentCountError $e) { - print('Error found: '.$e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } /* Scalar argument */ -echo "\n*** Output for scalar argument ***\n"; +echo "*** Output for scalar argument ***\n"; printf(3); /* Float type variations */ @@ -205,10 +205,10 @@ echo"\n\n*** Output for invalid width(-15) specifier ***\n"; try { printf("%030.-15s", $tempstring); } catch (ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), "\n"; } -echo"\n\n*** Output for '%F' as the format parameter ***\n"; +echo "\n*** Output for '%F' as the format parameter ***\n"; printf("%F",1.23456789e10); echo"\n\n*** Output for '%X' as the format parameter ***\n"; @@ -233,10 +233,10 @@ printf("%d", $tempstring); ?> --EXPECTF-- *** Output for zero argument *** -printf() expects at least 1 argument, 0 given +ArgumentCountError: printf() expects at least 1 argument, 0 given *** Output for insufficient number of arguments *** -Error found: 5 arguments are required, 3 given +ArgumentCountError: 5 arguments are required, 3 given *** Output for scalar argument *** 3 @@ -676,7 +676,7 @@ Notice: printf(): Requested precision of 988 digits was truncated to PHP maximum 12345678900.0000000000%d *** Output for invalid width(-15) specifier *** -Unknown format specifier "-" +ValueError: Unknown format specifier "-" *** Output for '%F' as the format parameter *** 12345678900.000000 diff --git a/ext/standard/tests/strings/printf_error.phpt b/ext/standard/tests/strings/printf_error.phpt index 2842f5cea124..14cfbaf7015d 100644 --- a/ext/standard/tests/strings/printf_error.phpt +++ b/ext/standard/tests/strings/printf_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing printf() function with Zero arguments --\n"; try { var_dump( printf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing printf() function with less than expected no. of arguments --\n"; @@ -23,36 +23,36 @@ echo "\n-- Call printf with one argument less than expected --\n"; try { var_dump( printf($format1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format2,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1,$arg2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Call printf with two argument less than expected --\n"; try { var_dump( printf($format2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( printf($format3,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Call printf with three argument less than expected --\n"; try { var_dump( printf($format3) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -60,18 +60,18 @@ try { *** Testing printf() : error conditions *** -- Testing printf() function with Zero arguments -- -printf() expects at least 1 argument, 0 given +ArgumentCountError: printf() expects at least 1 argument, 0 given -- Testing printf() function with less than expected no. of arguments -- -- Call printf with one argument less than expected -- -2 arguments are required, 1 given -3 arguments are required, 2 given -4 arguments are required, 3 given +ArgumentCountError: 2 arguments are required, 1 given +ArgumentCountError: 3 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 3 given -- Call printf with two argument less than expected -- -3 arguments are required, 1 given -4 arguments are required, 2 given +ArgumentCountError: 3 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 2 given -- Call printf with three argument less than expected -- -4 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 1 given diff --git a/ext/standard/tests/strings/setlocale_null_byte.phpt b/ext/standard/tests/strings/setlocale_null_byte.phpt index 85663b98a71a..daad8004bce2 100644 --- a/ext/standard/tests/strings/setlocale_null_byte.phpt +++ b/ext/standard/tests/strings/setlocale_null_byte.phpt @@ -11,37 +11,37 @@ class NullByteStringable { try { var_dump(setlocale(LC_ALL, "C\0locale")); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, ["locale\0name", "C"])); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(@setlocale(LC_ALL, [str_repeat("x", 255), "C\0locale"])); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", ["C\0locale"])); } catch (TypeError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, "zz_ZZ.nope", new NullByteStringable())); } catch (ValueError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(setlocale(LC_ALL, [], new NullByteStringable())); } catch (ArgumentCountError $e) { - echo $e::class, ": ", $e->getMessage(), \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- diff --git a/ext/standard/tests/strings/sha1_file.phpt b/ext/standard/tests/strings/sha1_file.phpt index 2014eabb98f5..b08d6e54f023 100644 --- a/ext/standard/tests/strings/sha1_file.phpt +++ b/ext/standard/tests/strings/sha1_file.phpt @@ -35,7 +35,7 @@ echo "\n-- No filename --\n"; try { var_dump( sha1_file("") ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- invalid filename --\n"; @@ -48,7 +48,7 @@ echo "\n-- NULL as filename --\n"; try { var_dump( sha1_file(NULL) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Hexadecimal Output for Empty file as Argument --\n"; @@ -74,7 +74,7 @@ unlink("EmptyFileSHA1.txt"); *** Testing for error conditions *** -- No filename -- -Path must not be empty +ValueError: Path must not be empty -- invalid filename -- @@ -89,7 +89,7 @@ bool(false) -- NULL as filename -- Deprecated: sha1_file(): Passing null to parameter #1 ($filename) of type string is deprecated in %s on line %d -Path must not be empty +ValueError: Path must not be empty -- Hexadecimal Output for Empty file as Argument -- string(40) "da39a3ee5e6b4b0d3255bfef95601890afd80709" diff --git a/ext/standard/tests/strings/sprintf_error.phpt b/ext/standard/tests/strings/sprintf_error.phpt index bab3fabae31c..0d9fc331458a 100644 --- a/ext/standard/tests/strings/sprintf_error.phpt +++ b/ext/standard/tests/strings/sprintf_error.phpt @@ -9,7 +9,7 @@ echo "\n-- Testing sprintf() function with Zero arguments --\n"; try { var_dump( sprintf() ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n-- Testing sprintf() function with less than expected no. of arguments --\n"; @@ -23,48 +23,48 @@ $arg2 = 'two'; try { var_dump( sprintf($format1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format2,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1,$arg2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with two argument less than expected try { var_dump( sprintf($format2) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( sprintf($format3,$arg1) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // with three argument less than expected try { var_dump( sprintf($format3) ); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf('%100$d %d')); } catch (\ArgumentCountError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(sprintf("foo %", 42)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Done"; @@ -73,15 +73,15 @@ echo "Done"; *** Testing sprintf() : error conditions *** -- Testing sprintf() function with Zero arguments -- -sprintf() expects at least 1 argument, 0 given +ArgumentCountError: sprintf() expects at least 1 argument, 0 given -- Testing sprintf() function with less than expected no. of arguments -- -2 arguments are required, 1 given -3 arguments are required, 2 given -4 arguments are required, 3 given -3 arguments are required, 1 given -4 arguments are required, 2 given -4 arguments are required, 1 given -101 arguments are required, 1 given -Missing format specifier at end of string +ArgumentCountError: 2 arguments are required, 1 given +ArgumentCountError: 3 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 3 given +ArgumentCountError: 3 arguments are required, 1 given +ArgumentCountError: 4 arguments are required, 2 given +ArgumentCountError: 4 arguments are required, 1 given +ArgumentCountError: 101 arguments are required, 1 given +ValueError: Missing format specifier at end of string Done diff --git a/ext/standard/tests/strings/sprintf_star.phpt b/ext/standard/tests/strings/sprintf_star.phpt index 0c8a211e5c43..09b4765dc626 100644 --- a/ext/standard/tests/strings/sprintf_star.phpt +++ b/ext/standard/tests/strings/sprintf_star.phpt @@ -41,37 +41,37 @@ echo "\n"; try { printf("%.*G\n", "foo", 1.5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*G\n", -100, 1.5); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.*s\n", -1, "Foo"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%*G\n", -1, $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%9999999999999999999999.f\n", $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { printf("%.9999999999999999999999f\n", $f); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -104,9 +104,9 @@ foo 1.235 1.235 -Precision must be an integer -Precision must be between -1 and 2147483647 -Precision -1 is only supported for %g, %G, %h and %H -Width must be between 0 and 2147483647 -Width must be between 0 and 2147483647 -Precision must be between 0 and 2147483647 +ValueError: Precision must be an integer +ValueError: Precision must be between -1 and 2147483647 +ValueError: Precision -1 is only supported for %g, %G, %h and %H +ValueError: Width must be between 0 and 2147483647 +ValueError: Width must be between 0 and 2147483647 +ValueError: Precision must be between 0 and 2147483647 diff --git a/ext/standard/tests/strings/sprintf_variation1.phpt b/ext/standard/tests/strings/sprintf_variation1.phpt index 6b9430e38666..8918727d024d 100644 --- a/ext/standard/tests/strings/sprintf_variation1.phpt +++ b/ext/standard/tests/strings/sprintf_variation1.phpt @@ -73,21 +73,21 @@ foreach($values as $value) { try { var_dump(sprintf($value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with two arguments try { var_dump(sprintf($value, $arg1)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // with three arguments try { var_dump(sprintf($value, $arg1, $arg2)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $count++; @@ -147,29 +147,29 @@ string(3) "0.5" string(3) "0.5" -- Iteration 10 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 11 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 12 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 13 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 14 -- -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given -sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given +TypeError: sprintf(): Argument #1 ($format) must be of type string, array given -- Iteration 15 -- string(1) "1" @@ -207,7 +207,7 @@ string(6) "Object" string(6) "Object" -- Iteration 22 -- -sprintf(): Argument #1 ($format) must be of type string, resource given -sprintf(): Argument #1 ($format) must be of type string, resource given -sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given +TypeError: sprintf(): Argument #1 ($format) must be of type string, resource given Done diff --git a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt index 57d9931648a7..fb23322f1094 100644 --- a/ext/standard/tests/strings/sprintf_variation4_64bit.phpt +++ b/ext/standard/tests/strings/sprintf_variation4_64bit.phpt @@ -21,4 +21,3 @@ var_dump(sprintf("%%u = '%u'", $u)); // unsigned integer representation of a neg --EXPECT-- string(15) "%u = '43951789'" string(27) "%u = '18446744073665599827'" - diff --git a/ext/standard/tests/strings/sprintf_variation52.phpt b/ext/standard/tests/strings/sprintf_variation52.phpt index e7e022a6fae6..a3feb0b57784 100644 --- a/ext/standard/tests/strings/sprintf_variation52.phpt +++ b/ext/standard/tests/strings/sprintf_variation52.phpt @@ -21,7 +21,7 @@ echo"\n-- Testing for invalid width(-15) specifier --\n"; try { var_dump(sprintf("%030.-15s", $tempstring)); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo"\n-- Testing for '%X' as the format parameter --\n"; @@ -50,7 +50,7 @@ Notice: sprintf(): Requested precision of 988 digits was truncated to PHP maximu string(65) "12345678900.00000000000000000000000000000000000000000000000000000" -- Testing for invalid width(-15) specifier -- -Unknown format specifier "-" +ValueError: Unknown format specifier "-" -- Testing for '%X' as the format parameter -- string(1) "C" diff --git a/ext/standard/tests/strings/sprintf_variation54.phpt b/ext/standard/tests/strings/sprintf_variation54.phpt index e925293ceef7..18a001d6b06f 100644 --- a/ext/standard/tests/strings/sprintf_variation54.phpt +++ b/ext/standard/tests/strings/sprintf_variation54.phpt @@ -12,7 +12,7 @@ foreach ($formats as $format) { try { echo sprintf("%" . $format, $value), "\n"; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n"; } @@ -52,7 +52,7 @@ Array Resource id #%d %s with {}: -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string d with null: 0 diff --git a/ext/standard/tests/strings/sscanf_error.phpt b/ext/standard/tests/strings/sscanf_error.phpt index e04b5e2cbb62..7a6b0d834b22 100644 --- a/ext/standard/tests/strings/sscanf_error.phpt +++ b/ext/standard/tests/strings/sscanf_error.phpt @@ -13,11 +13,11 @@ echo "\n-- Testing sscanf() function with more than expected no. of arguments -- try { sscanf($str, $format, $str1, $str2, $extra_str); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- *** Testing sscanf() : error conditions *** -- Testing sscanf() function with more than expected no. of arguments -- -Variable is not assigned by any conversion specifiers +ValueError: Variable is not assigned by any conversion specifiers diff --git a/ext/standard/tests/strings/str_decrement_errors.phpt b/ext/standard/tests/strings/str_decrement_errors.phpt index 3186d24b81ed..ad07ddff5860 100644 --- a/ext/standard/tests/strings/str_decrement_errors.phpt +++ b/ext/standard/tests/strings/str_decrement_errors.phpt @@ -31,23 +31,23 @@ foreach ($strings as $s) { try { var_dump(str_decrement($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -str_decrement(): Argument #1 ($string) must not be empty -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must not be empty +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_decrement(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters diff --git a/ext/standard/tests/strings/str_decrement_underflow.phpt b/ext/standard/tests/strings/str_decrement_underflow.phpt index 0521497713a1..438d324dea42 100644 --- a/ext/standard/tests/strings/str_decrement_underflow.phpt +++ b/ext/standard/tests/strings/str_decrement_underflow.phpt @@ -17,16 +17,16 @@ foreach ($strings as $s) { try { var_dump(str_decrement($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -str_decrement(): Argument #1 ($string) must not be empty -str_decrement(): Argument #1 ($string) "0" is out of decrement range -str_decrement(): Argument #1 ($string) "a" is out of decrement range -str_decrement(): Argument #1 ($string) "A" is out of decrement range -str_decrement(): Argument #1 ($string) "00" is out of decrement range -str_decrement(): Argument #1 ($string) "0a" is out of decrement range -str_decrement(): Argument #1 ($string) "0A" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) must not be empty +ValueError: str_decrement(): Argument #1 ($string) "0" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "a" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "A" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "00" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "0a" is out of decrement range +ValueError: str_decrement(): Argument #1 ($string) "0A" is out of decrement range diff --git a/ext/standard/tests/strings/str_increment_errors.phpt b/ext/standard/tests/strings/str_increment_errors.phpt index e06d7e4bba86..3d7f06a7d274 100644 --- a/ext/standard/tests/strings/str_increment_errors.phpt +++ b/ext/standard/tests/strings/str_increment_errors.phpt @@ -31,23 +31,23 @@ foreach ($strings as $s) { try { var_dump(str_increment($s)); } catch (ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -str_increment(): Argument #1 ($string) must not be empty -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters -str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must not be empty +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters +ValueError: str_increment(): Argument #1 ($string) must be composed only of alphanumeric ASCII characters diff --git a/ext/standard/tests/strings/str_pad.phpt b/ext/standard/tests/strings/str_pad.phpt index c7b11e4ac0ce..36db7695f57e 100644 --- a/ext/standard/tests/strings/str_pad.phpt +++ b/ext/standard/tests/strings/str_pad.phpt @@ -67,7 +67,7 @@ echo "\n--- empty padding string ---\n"; try { str_pad($input_string, 12, ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } /* bad pad_type - passing an undefined one */ @@ -75,7 +75,7 @@ try { try { str_pad($input_string, $pad_length, "+", 15); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -302,5 +302,5 @@ string(16) "\t\variation\t\t" #### error conditions #### --- empty padding string --- -str_pad(): Argument #3 ($pad_string) must not be empty -str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH +ValueError: str_pad(): Argument #3 ($pad_string) must not be empty +ValueError: str_pad(): Argument #4 ($pad_type) must be STR_PAD_LEFT, STR_PAD_RIGHT, or STR_PAD_BOTH diff --git a/ext/standard/tests/strings/str_pad_variation1.phpt b/ext/standard/tests/strings/str_pad_variation1.phpt index cb71e61156fc..7f6a811c3bc0 100644 --- a/ext/standard/tests/strings/str_pad_variation1.phpt +++ b/ext/standard/tests/strings/str_pad_variation1.phpt @@ -21,7 +21,7 @@ $extra_large_pad_length = PHP_INT_MAX*5; try { var_dump( str_pad($input, $extra_large_pad_length) ); } catch (\TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $php_int_max_pad_length = PHP_INT_MAX; @@ -31,6 +31,6 @@ var_dump( str_pad($input, $php_int_max_pad_length) ); ?> --EXPECTF-- *** Testing str_pad() function: with large value for for 'pad_length' argument *** -str_pad(): Argument #2 ($length) must be of type int, float given +TypeError: str_pad(): Argument #2 ($length) must be of type int, float given Fatal error: Allowed memory size of %d bytes exhausted%s(tried to allocate %d bytes) in %s on line %d diff --git a/ext/standard/tests/strings/str_repeat.phpt b/ext/standard/tests/strings/str_repeat.phpt index 3351e7f87133..cd3b6345e05e 100644 --- a/ext/standard/tests/strings/str_repeat.phpt +++ b/ext/standard/tests/strings/str_repeat.phpt @@ -31,7 +31,7 @@ echo "\n\n*** Testing error conditions ***\n"; try { str_repeat($input[0], -1); // Invalid arg for multiplier } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -100,4 +100,4 @@ try { *** Testing error conditions *** -str_repeat(): Argument #2 ($times) must be greater than or equal to 0 +ValueError: str_repeat(): Argument #2 ($times) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/str_replace_basic.phpt b/ext/standard/tests/strings/str_replace_basic.phpt index 4dfbd098efc6..cc4704ebcb38 100644 --- a/ext/standard/tests/strings/str_replace_basic.phpt +++ b/ext/standard/tests/strings/str_replace_basic.phpt @@ -24,7 +24,7 @@ $fp_copy = $fp; try { var_dump( str_replace($fp_copy, $fp_copy, $fp_copy, $fp_copy) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump( $fp_copy ); fclose($fp); @@ -40,5 +40,5 @@ string(1) "q" int(1) string(0) "" int(0) -str_replace(): Argument #1 ($search) must be of type array|string, resource given +TypeError: str_replace(): Argument #1 ($search) must be of type array|string, resource given resource(%d) of type (stream) diff --git a/ext/standard/tests/strings/str_replace_variation3.phpt b/ext/standard/tests/strings/str_replace_variation3.phpt index 07c6ef7da346..77f8a2070ffe 100644 --- a/ext/standard/tests/strings/str_replace_variation3.phpt +++ b/ext/standard/tests/strings/str_replace_variation3.phpt @@ -83,7 +83,7 @@ var_dump($count); try { str_replace("a", array("q", "q", "c"), array("aaa"), $count); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(str_replace("a", 1, array("aaa", "bbb"), $count)); @@ -99,12 +99,12 @@ $resource2 = opendir( "." ); try { var_dump(str_replace("stream", "FOUND", $resource1, $count)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_replace("stream", "FOUND", $resource2, $count)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } @@ -180,7 +180,7 @@ array(2) { string(3) "ccc" } int(6) -str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string +TypeError: str_replace(): Argument #2 ($replace) must be of type string when argument #1 ($search) is a string array(2) { [0]=> string(3) "111" @@ -197,8 +197,8 @@ array(2) { int(1) -- Testing Resources -- -str_replace(): Argument #3 ($subject) must be of type array|string, resource given -str_replace(): Argument #3 ($subject) must be of type array|string, resource given +TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given +TypeError: str_replace(): Argument #3 ($subject) must be of type array|string, resource given -- Testing a longer and heredoc string -- string(623) "FOUNDghijklmnopqrstuvwxyz0123456789FOUNDghijklmnopqrstuvwxyz0123456789 diff --git a/ext/standard/tests/strings/str_split_variation6.phpt b/ext/standard/tests/strings/str_split_variation6.phpt index a8c1bbf1a927..4c70d9223df8 100644 --- a/ext/standard/tests/strings/str_split_variation6.phpt +++ b/ext/standard/tests/strings/str_split_variation6.phpt @@ -28,14 +28,14 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- *** Testing str_split() : different integer values for 'split_length' *** -- Iteration 1 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- array(42) { [0]=> @@ -124,7 +124,7 @@ array(42) { string(1) "t" } -- Iteration 3 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -143,4 +143,4 @@ array(1) { string(42) "This is a string with 123 & escape char \t" } -- Iteration 7 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_split_variation7.phpt b/ext/standard/tests/strings/str_split_variation7.phpt index 17e802b2406e..b07956c4d5dc 100644 --- a/ext/standard/tests/strings/str_split_variation7.phpt +++ b/ext/standard/tests/strings/str_split_variation7.phpt @@ -30,14 +30,14 @@ for($count = 0; $count < count($values); $count++) { try { var_dump( str_split($str, $values[$count]) ); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } ?> --EXPECT-- *** Testing str_split() : different integer values for 'split_length' with heredoc 'str' *** -- Iteration 1 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 2 -- array(30) { [0]=> @@ -102,7 +102,7 @@ array(30) { string(1) "." } -- Iteration 3 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 -- Iteration 4 -- array(1) { [0]=> @@ -121,4 +121,4 @@ array(1) { string(30) "string with 123,escape char ." } -- Iteration 7 -- -str_split(): Argument #2 ($length) must be greater than 0 +ValueError: str_split(): Argument #2 ($length) must be greater than 0 diff --git a/ext/standard/tests/strings/str_word_count.phpt b/ext/standard/tests/strings/str_word_count.phpt index a8c2af9255f0..38b0451e5735 100644 --- a/ext/standard/tests/strings/str_word_count.phpt +++ b/ext/standard/tests/strings/str_word_count.phpt @@ -12,25 +12,25 @@ var_dump(str_word_count($str)); try { var_dump(str_word_count($str, 3)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 123)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count($str, 999999999)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($str); @@ -87,10 +87,10 @@ array(6) { string(5) "today" } int(6) -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value string(53) "Hello friend, you're looking good today!" int(5) diff --git a/ext/standard/tests/strings/str_word_count1.phpt b/ext/standard/tests/strings/str_word_count1.phpt index c4f8ecf40a0f..9c4589826242 100644 --- a/ext/standard/tests/strings/str_word_count1.phpt +++ b/ext/standard/tests/strings/str_word_count1.phpt @@ -8,23 +8,23 @@ var_dump(str_word_count("")); try { var_dump(str_word_count("", -1)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(str_word_count("", -1, $a)); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($a); ?> --EXPECTF-- int(0) -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value Warning: Undefined variable $a in %s on line %d -str_word_count(): Argument #2 ($format) must be a valid format value +ValueError: str_word_count(): Argument #2 ($format) must be a valid format value Warning: Undefined variable $a in %s on line %d NULL diff --git a/ext/standard/tests/strings/strip_tags_variation2.phpt b/ext/standard/tests/strings/strip_tags_variation2.phpt index 421f8a62ae4e..93d8c7a840e1 100644 --- a/ext/standard/tests/strings/strip_tags_variation2.phpt +++ b/ext/standard/tests/strings/strip_tags_variation2.phpt @@ -75,7 +75,7 @@ foreach($values as $value) { try { var_dump(strip_tags($string, $value)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $iterator++; }; @@ -125,5 +125,5 @@ string(10) "helloworld" -- Iteration 20 -- string(10) "helloworld" -- Iteration 21 -- -strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given +TypeError: strip_tags(): Argument #2 ($allowed_tags) must be of type array|string|null, resource given Done diff --git a/ext/standard/tests/strings/stripos_error.phpt b/ext/standard/tests/strings/stripos_error.phpt index a3e805a709f9..8d3415807294 100644 --- a/ext/standard/tests/strings/stripos_error.phpt +++ b/ext/standard/tests/strings/stripos_error.phpt @@ -8,14 +8,14 @@ echo "\n-- Offset beyond the end of the string --\n"; try { stripos("Hello World", "o", 12); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "\n-- Offset before the start of the string --\n"; try { stripos("Hello World", "o", -12); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "*** Done ***"; @@ -24,8 +24,8 @@ echo "*** Done ***"; *** Testing stripos() function: error conditions *** -- Offset beyond the end of the string -- -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -- Offset before the start of the string -- -stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: stripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) *** Done *** diff --git a/ext/standard/tests/strings/stristr_variation2.phpt b/ext/standard/tests/strings/stristr_variation2.phpt index 72d5a93df8a6..395f44cbf1ca 100644 --- a/ext/standard/tests/strings/stristr_variation2.phpt +++ b/ext/standard/tests/strings/stristr_variation2.phpt @@ -57,7 +57,7 @@ foreach($inputs as $input) { try { var_dump( stristr("Hello World", $input) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count ++; } @@ -82,11 +82,11 @@ bool(false) -- Iteration 7 -- bool(false) -- Iteration 8 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 9 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 10 -- -stristr(): Argument #2 ($needle) must be of type string, array given +TypeError: stristr(): Argument #2 ($needle) must be of type string, array given -- Iteration 11 -- bool(false) -- Iteration 12 -- @@ -98,4 +98,4 @@ string(11) "Hello World" -- Iteration 15 -- bool(false) -- Iteration 16 -- -stristr(): Argument #2 ($needle) must be of type string, resource given +TypeError: stristr(): Argument #2 ($needle) must be of type string, resource given diff --git a/ext/standard/tests/strings/strncasecmp_error.phpt b/ext/standard/tests/strings/strncasecmp_error.phpt index 46bbdbe3b0e5..e1ec55cfd13b 100644 --- a/ext/standard/tests/strings/strncasecmp_error.phpt +++ b/ext/standard/tests/strings/strncasecmp_error.phpt @@ -12,11 +12,11 @@ $len = -10; try { var_dump( strncasecmp($str1, $str2, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing strncasecmp() function: error conditions *** -- Testing strncasecmp() function with invalid argument -- -strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncasecmp(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/strncmp_error.phpt b/ext/standard/tests/strings/strncmp_error.phpt index ed83651072c0..be6f5b0e6a86 100644 --- a/ext/standard/tests/strings/strncmp_error.phpt +++ b/ext/standard/tests/strings/strncmp_error.phpt @@ -14,10 +14,10 @@ $len = -10; try { var_dump( strncmp($str1, $str2, $len) ); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- *** Testing strncmp() function: error conditions *** -strncmp(): Argument #3 ($length) must be greater than or equal to 0 +ValueError: strncmp(): Argument #3 ($length) must be greater than or equal to 0 diff --git a/ext/standard/tests/strings/strpbrk_error.phpt b/ext/standard/tests/strings/strpbrk_error.phpt index 3d7f84e948bf..09b4dd75019e 100644 --- a/ext/standard/tests/strings/strpbrk_error.phpt +++ b/ext/standard/tests/strings/strpbrk_error.phpt @@ -8,10 +8,10 @@ echo "-- Testing strpbrk() function with empty second argument --\n"; try { strpbrk($haystack, ''); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -- Testing strpbrk() function with empty second argument -- -strpbrk(): Argument #2 ($characters) must be a non-empty string +ValueError: strpbrk(): Argument #2 ($characters) must be a non-empty string diff --git a/ext/standard/tests/strings/strpos.phpt b/ext/standard/tests/strings/strpos.phpt index 05913cc1f03b..24c0ae85d35f 100644 --- a/ext/standard/tests/strings/strpos.phpt +++ b/ext/standard/tests/strings/strpos.phpt @@ -84,7 +84,7 @@ for( $i = 0; $i < count( $offset_values ); $i++ ) { try { var_dump( strpos($string, "Hello", $offset_values[$i]) ); } catch (TypeError $e) { - echo "\n", $e->getMessage(), "\n"; + echo "\n", $e::class, ': ', $e->getMessage(), "\n"; } } @@ -162,13 +162,13 @@ var_dump( strpos($string, "") ); try { strpos($string, "test", strlen($string)+1); // offset > strlen() } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strpos($string, "test", -strlen($string)-1); // offset before start } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -227,14 +227,14 @@ abcd$:Hello world' is => int(0) *** Testing strpos() with possible variations in offset *** Position of 'Hello' with offset '1' is => int(74) Position of 'Hello' with offset 'string' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '0' is => int(0) Position of 'Hello' with offset '1' is => int(74) Position of 'Hello' with offset '' is => int(0) Position of 'Hello' with offset 'string12' is => -strpos(): Argument #3 ($offset) must be of type int, string given +TypeError: strpos(): Argument #3 ($offset) must be of type int, string given Position of 'Hello' with offset '-10' is => bool(false) Position of 'Hello' with offset '-15' is => int(74) Position of 'Hello' with offset '-85' is => int(0) @@ -278,7 +278,7 @@ int(7) *** Testing error conditions *** int(0) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) DONE diff --git a/ext/standard/tests/strings/strripos_offset.phpt b/ext/standard/tests/strings/strripos_offset.phpt index 59b5374caec7..e9ef27c6782b 100644 --- a/ext/standard/tests/strings/strripos_offset.phpt +++ b/ext/standard/tests/strings/strripos_offset.phpt @@ -6,39 +6,39 @@ strripos() offset integer overflow try { var_dump(strripos("t", "t", PHP_INT_MAX+1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, 1024, -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strripos(1024, "te", -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -strripos(): Argument #3 ($offset) must be of type int, float given -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +TypeError: strripos(): Argument #3 ($offset) must be of type int, float given +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/strrpos_negative_offset.phpt b/ext/standard/tests/strings/strrpos_negative_offset.phpt index e4ac469ba4b8..08a5b35cf094 100644 --- a/ext/standard/tests/strings/strrpos_negative_offset.phpt +++ b/ext/standard/tests/strings/strrpos_negative_offset.phpt @@ -11,7 +11,7 @@ strr[i]pos() function with negative offset try { strrpos("haystack", 'h', -9); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(strripos("HAYSTHACk", 'ha', -9)); var_dump(strripos("HAYSTACK", 'h', -8)); @@ -22,7 +22,7 @@ strr[i]pos() function with negative offset try { strripos("HAYSTACK", 'h', -9); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- @@ -32,11 +32,11 @@ int(7) bool(false) int(5) int(1) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(0) int(0) int(7) bool(false) int(5) int(1) -strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strripos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) diff --git a/ext/standard/tests/strings/strrpos_offset.phpt b/ext/standard/tests/strings/strrpos_offset.phpt index 46b37955e4ab..297c61fd219f 100644 --- a/ext/standard/tests/strings/strrpos_offset.phpt +++ b/ext/standard/tests/strings/strrpos_offset.phpt @@ -6,39 +6,39 @@ strrpos() offset integer overflow try { var_dump(strrpos("t", "t", PHP_INT_MAX+1)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, 1024, -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { strrpos(1024, "te", -PHP_INT_MAX-1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- -strrpos(): Argument #3 ($offset) must be of type int, float given -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +TypeError: strrpos(): Argument #3 ($offset) must be of type int, float given +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/strrpos_variation7.phpt b/ext/standard/tests/strings/strrpos_variation7.phpt index f73d4129d5c4..f149e6ff0525 100644 --- a/ext/standard/tests/strings/strrpos_variation7.phpt +++ b/ext/standard/tests/strings/strrpos_variation7.phpt @@ -14,7 +14,7 @@ var_dump( strrpos($empty_string, "") ); try { strrpos($empty_string, "", 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump( strrpos($empty_string, FALSE) ); @@ -24,6 +24,6 @@ echo "*** Done ***"; *** Testing strrpos() function: with heredoc strings *** -- With empty heredoc string -- int(0) -strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: strrpos(): Argument #3 ($offset) must be contained in argument #1 ($haystack) int(0) *** Done *** diff --git a/ext/standard/tests/strings/strtr_variation6.phpt b/ext/standard/tests/strings/strtr_variation6.phpt index a43bbd24583a..1bf7ae0bf7e9 100644 --- a/ext/standard/tests/strings/strtr_variation6.phpt +++ b/ext/standard/tests/strings/strtr_variation6.phpt @@ -67,7 +67,7 @@ for($index = 0; $index < count($from_arr); $index++) { try { var_dump(strtr($str, $from, $to)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $count++; } @@ -89,11 +89,11 @@ string(6) "m1tatm" -- Iteration 6 -- string(6) "tm0atm" -- Iteration 7 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 8 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 9 -- -strtr(): Argument #2 ($from) must be of type string, array given +TypeError: strtr(): Argument #2 ($from) must be of type string, array given -- Iteration 10 -- string(6) "0a2atm" -- Iteration 11 -- @@ -113,4 +113,4 @@ string(6) "012atm" -- Iteration 16 -- string(6) "012ttm" -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type string, resource given +TypeError: strtr(): Argument #2 ($from) must be of type string, resource given diff --git a/ext/standard/tests/strings/strtr_variation8.phpt b/ext/standard/tests/strings/strtr_variation8.phpt index 31e41ae9e263..759f725c6aaa 100644 --- a/ext/standard/tests/strings/strtr_variation8.phpt +++ b/ext/standard/tests/strings/strtr_variation8.phpt @@ -64,7 +64,7 @@ for($index = 0; $index < count($replace_pairs_arr); $index++) { try { var_dump(strtr($str, $replace_pairs)); } catch (TypeError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $count ++; @@ -78,22 +78,22 @@ echo "*** Done ***"; *** Testing strtr() function: with unexpected inputs for 'replace_pairs' *** -- Iteration 1 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 2 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 3 -- -strtr(): Argument #2 ($from) must be of type array, int given +TypeError: strtr(): Argument #2 ($from) must be of type array, int given -- Iteration 4 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 5 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 6 -- -strtr(): Argument #2 ($from) must be of type array, float given +TypeError: strtr(): Argument #2 ($from) must be of type array, float given -- Iteration 7 -- string(6) "012atm" @@ -105,26 +105,26 @@ string(6) "012atm" string(6) "122atm" -- Iteration 10 -- -strtr(): Argument #2 ($from) must be of type array, true given +TypeError: strtr(): Argument #2 ($from) must be of type array, true given -- Iteration 11 -- -strtr(): Argument #2 ($from) must be of type array, false given +TypeError: strtr(): Argument #2 ($from) must be of type array, false given -- Iteration 12 -- -strtr(): Argument #2 ($from) must be of type array, true given +TypeError: strtr(): Argument #2 ($from) must be of type array, true given -- Iteration 13 -- -strtr(): Argument #2 ($from) must be of type array, false given +TypeError: strtr(): Argument #2 ($from) must be of type array, false given -- Iteration 14 -- -strtr(): Argument #2 ($from) must be of type array, null given +TypeError: strtr(): Argument #2 ($from) must be of type array, null given -- Iteration 15 -- -strtr(): Argument #2 ($from) must be of type array, null given +TypeError: strtr(): Argument #2 ($from) must be of type array, null given -- Iteration 16 -- -strtr(): Argument #2 ($from) must be of type array, sample given +TypeError: strtr(): Argument #2 ($from) must be of type array, sample given -- Iteration 17 -- -strtr(): Argument #2 ($from) must be of type array, resource given +TypeError: strtr(): Argument #2 ($from) must be of type array, resource given *** Done *** diff --git a/ext/standard/tests/strings/strval_error.phpt b/ext/standard/tests/strings/strval_error.phpt index 8ec78f080f20..21addf6efafe 100644 --- a/ext/standard/tests/strings/strval_error.phpt +++ b/ext/standard/tests/strings/strval_error.phpt @@ -16,7 +16,7 @@ echo "\n-- Testing strval() function with object which has not toString() method try { var_dump( strval(new MyClass()) ); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -24,4 +24,4 @@ try { *** Testing strval() : error conditions *** -- Testing strval() function with object which has not toString() method -- -Object of class MyClass could not be converted to string +Error: Object of class MyClass could not be converted to string diff --git a/ext/standard/tests/strings/substr_compare.phpt b/ext/standard/tests/strings/substr_compare.phpt index 51d093a65fa2..332fda98c827 100644 --- a/ext/standard/tests/strings/substr_compare.phpt +++ b/ext/standard/tests/strings/substr_compare.phpt @@ -18,7 +18,7 @@ echo "Test\n"; try { substr_compare("abcde", "abc", 0, -1); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(substr_compare("abcde", "abc", -1, NULL, -5) > 0); ?> @@ -34,5 +34,5 @@ int(-1) bool(true) int(0) Test -substr_compare(): Argument #4 ($length) must be greater than or equal to 0 +ValueError: substr_compare(): Argument #4 ($length) must be greater than or equal to 0 bool(true) diff --git a/ext/standard/tests/strings/substr_count_basic.phpt b/ext/standard/tests/strings/substr_count_basic.phpt index efb5806d1621..70449f95acda 100644 --- a/ext/standard/tests/strings/substr_count_basic.phpt +++ b/ext/standard/tests/strings/substr_count_basic.phpt @@ -7,12 +7,12 @@ echo "***Testing basic operations ***\n"; try { substr_count("", ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { substr_count("a", ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(substr_count("", "a")); var_dump(substr_count("", "a")); @@ -34,8 +34,8 @@ var_dump(substr_count($a, "bca", -200, -50)); ?> --EXPECT-- ***Testing basic operations *** -substr_count(): Argument #2 ($needle) must not be empty -substr_count(): Argument #2 ($needle) must not be empty +ValueError: substr_count(): Argument #2 ($needle) must not be empty +ValueError: substr_count(): Argument #2 ($needle) must not be empty int(0) int(0) int(0) diff --git a/ext/standard/tests/strings/substr_count_error.phpt b/ext/standard/tests/strings/substr_count_error.phpt index dc0d3d9834eb..408369173909 100644 --- a/ext/standard/tests/strings/substr_count_error.phpt +++ b/ext/standard/tests/strings/substr_count_error.phpt @@ -10,14 +10,14 @@ $str = 'abcdefghik'; try { substr_count($str, "t", -20); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* offset > size of the string */ try { substr_count($str, "t", 25); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* Using offset and length to go beyond the size of the string: @@ -25,14 +25,14 @@ try { try { substr_count($str, "i", 5, 7); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } /* length too small */ try { substr_count($str, "t", 2, -20); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -40,8 +40,8 @@ echo "Done\n"; ?> --EXPECT-- *** Testing error conditions *** -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) -substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #3 ($offset) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) +ValueError: substr_count(): Argument #4 ($length) must be contained in argument #1 ($haystack) Done diff --git a/ext/standard/tests/strings/substr_replace_error.phpt b/ext/standard/tests/strings/substr_replace_error.phpt index 165cc1e6913d..b4778d9dfbcb 100644 --- a/ext/standard/tests/strings/substr_replace_error.phpt +++ b/ext/standard/tests/strings/substr_replace_error.phpt @@ -14,12 +14,12 @@ echo "\n-- Testing substr_replace() function with start and length as arrays but try { var_dump(substr_replace($s1, "evening", array(5))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump(substr_replace($s1, "evening", 5, array(1))); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -27,5 +27,5 @@ try { *** Testing substr_replace() : error conditions *** -- Testing substr_replace() function with start and length as arrays but string not-- -substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string -substr_replace(): Argument #4 ($length) cannot be an array when working on a single string +TypeError: substr_replace(): Argument #3 ($offset) cannot be an array when working on a single string +TypeError: substr_replace(): Argument #4 ($length) cannot be an array when working on a single string diff --git a/ext/standard/tests/strings/unpack_error.phpt b/ext/standard/tests/strings/unpack_error.phpt index c41185b23ace..a494a18ce109 100644 --- a/ext/standard/tests/strings/unpack_error.phpt +++ b/ext/standard/tests/strings/unpack_error.phpt @@ -6,9 +6,9 @@ Test unpack() function : error conditions try { var_dump(unpack("B", pack("I", 65534))); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Invalid format type B +ValueError: Invalid format type B diff --git a/ext/standard/tests/strings/unpack_offset.phpt b/ext/standard/tests/strings/unpack_offset.phpt index bd787859c11a..6013e57ca81b 100644 --- a/ext/standard/tests/strings/unpack_offset.phpt +++ b/ext/standard/tests/strings/unpack_offset.phpt @@ -14,16 +14,16 @@ printf("0x%08x 0x%08x\n", try { unpack("l", "foo", 10); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unpack("l", "foo", -1); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- 0x01020304 0x05060708 0x01020304 0x05060708 -unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) -unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) +ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) +ValueError: unpack(): Argument #3 ($offset) must be contained in argument #2 ($data) diff --git a/ext/standard/tests/strings/vfprintf_error1.phpt b/ext/standard/tests/strings/vfprintf_error1.phpt index 1c114daee42d..c74ceb37950d 100644 --- a/ext/standard/tests/strings/vfprintf_error1.phpt +++ b/ext/standard/tests/strings/vfprintf_error1.phpt @@ -17,12 +17,12 @@ $extra_arg = 10; try { var_dump( vfprintf( $fp, $format, $args, $extra_arg ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( vfprintf( $fp, "Foo %d", array(6), "bar" ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // Close handle @@ -38,5 +38,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with more than expected no. of arguments -- -vfprintf() expects exactly 3 arguments, 4 given -vfprintf() expects exactly 3 arguments, 4 given +ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given +ArgumentCountError: vfprintf() expects exactly 3 arguments, 4 given diff --git a/ext/standard/tests/strings/vfprintf_error3.phpt b/ext/standard/tests/strings/vfprintf_error3.phpt index 24991552e0a3..b389ec5720cb 100644 --- a/ext/standard/tests/strings/vfprintf_error3.phpt +++ b/ext/standard/tests/strings/vfprintf_error3.phpt @@ -14,19 +14,19 @@ echo "\n-- Testing vfprintf() function with wrong variable types as argument --\ try { vfprintf($fp, array( 'foo %d', 'bar %s' ), 3.55552); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { vfprintf($fp, "Foo: %s", "not available"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { vfprintf($fp, "Foo %y fake", ["not available"]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } rewind( $fp ); @@ -47,7 +47,7 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with wrong variable types as argument -- -vfprintf(): Argument #2 ($format) must be of type string, array given -vfprintf(): Argument #3 ($values) must be of type array, string given -Unknown format specifier "y" +TypeError: vfprintf(): Argument #2 ($format) must be of type string, array given +TypeError: vfprintf(): Argument #3 ($values) must be of type array, string given +ValueError: Unknown format specifier "y" string(0) "" diff --git a/ext/standard/tests/strings/vfprintf_error4.phpt b/ext/standard/tests/strings/vfprintf_error4.phpt index 7c4578ee4090..74c43be68365 100644 --- a/ext/standard/tests/strings/vfprintf_error4.phpt +++ b/ext/standard/tests/strings/vfprintf_error4.phpt @@ -14,12 +14,12 @@ echo "\n-- Testing vfprintf() function with other strangeties --\n"; try { var_dump( vfprintf( 'foo', 'bar', array( 'baz' ) ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump( vfprintf( $fp, 'Foo %$c-0202Sd', array( 2 ) ) ); } catch(\ValueError $e) { - print('Error found: '.$e->getMessage().".\n"); + echo $e::class, ': ', $e->getMessage(), "\n"; } // Close handle fclose( $fp ); @@ -34,5 +34,5 @@ unlink( $file ); ?> --EXPECT-- -- Testing vfprintf() function with other strangeties -- -vfprintf(): Argument #1 ($stream) must be of type resource, string given -Error found: Argument number specifier must be greater than zero and less than 2147483647. +TypeError: vfprintf(): Argument #1 ($stream) must be of type resource, string given +ValueError: Argument number specifier must be greater than zero and less than 2147483647 diff --git a/ext/standard/tests/strings/vfprintf_variation1.phpt b/ext/standard/tests/strings/vfprintf_variation1.phpt index 36d983817024..18277b90543b 100644 --- a/ext/standard/tests/strings/vfprintf_variation1.phpt +++ b/ext/standard/tests/strings/vfprintf_variation1.phpt @@ -34,7 +34,7 @@ function writeAndDump($fp, $format, $args) var_dump( $content ); var_dump( $length ); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } @@ -60,7 +60,7 @@ unlink( $file ); ?> --EXPECT-- *** Testing vfprintf() : variation functionality *** -vfprintf(): Argument #3 ($values) must be of type array, null given +TypeError: vfprintf(): Argument #3 ($values) must be of type array, null given string(17) "Foo is 30 and bar" int(17) string(14) "Foobar testing" diff --git a/ext/standard/tests/strings/vprintf_variation2.phpt b/ext/standard/tests/strings/vprintf_variation2.phpt index f6d92e577402..5509d29832e3 100644 --- a/ext/standard/tests/strings/vprintf_variation2.phpt +++ b/ext/standard/tests/strings/vprintf_variation2.phpt @@ -84,9 +84,9 @@ foreach($values as $value) { echo "\n"; var_dump($result); } catch (\TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch (\ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $counter++; }; @@ -99,70 +99,70 @@ fclose($file_handle); *** Testing vprintf() : with unexpected values for args argument *** -- Iteration 1 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 2 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 3 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 4 -- -vprintf(): Argument #2 ($values) must be of type array, int given +TypeError: vprintf(): Argument #2 ($values) must be of type array, int given -- Iteration 5 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 6 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 7 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 8 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 9 -- -vprintf(): Argument #2 ($values) must be of type array, float given +TypeError: vprintf(): Argument #2 ($values) must be of type array, float given -- Iteration 10 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 11 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 12 -- -vprintf(): Argument #2 ($values) must be of type array, true given +TypeError: vprintf(): Argument #2 ($values) must be of type array, true given -- Iteration 13 -- -vprintf(): Argument #2 ($values) must be of type array, false given +TypeError: vprintf(): Argument #2 ($values) must be of type array, false given -- Iteration 14 -- -vprintf(): Argument #2 ($values) must be of type array, true given +TypeError: vprintf(): Argument #2 ($values) must be of type array, true given -- Iteration 15 -- -vprintf(): Argument #2 ($values) must be of type array, false given +TypeError: vprintf(): Argument #2 ($values) must be of type array, false given -- Iteration 16 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 17 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 18 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 19 -- -vprintf(): Argument #2 ($values) must be of type array, string given +TypeError: vprintf(): Argument #2 ($values) must be of type array, string given -- Iteration 20 -- -vprintf(): Argument #2 ($values) must be of type array, sample given +TypeError: vprintf(): Argument #2 ($values) must be of type array, sample given -- Iteration 21 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 22 -- -vprintf(): Argument #2 ($values) must be of type array, null given +TypeError: vprintf(): Argument #2 ($values) must be of type array, null given -- Iteration 23 -- -vprintf(): Argument #2 ($values) must be of type array, resource given +TypeError: vprintf(): Argument #2 ($values) must be of type array, resource given diff --git a/ext/standard/tests/strings/wordwrap.phpt b/ext/standard/tests/strings/wordwrap.phpt index efa12bef18dd..c617d8b272f5 100644 --- a/ext/standard/tests/strings/wordwrap.phpt +++ b/ext/standard/tests/strings/wordwrap.phpt @@ -30,7 +30,7 @@ var_dump("123|==1234567890|==123" === wordwrap("123 1234567890 123", 10, "|==", try { wordwrap(chr(0), 0, ""); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- @@ -53,4 +53,4 @@ bool(true) bool(true) bool(true) bool(true) -wordwrap(): Argument #3 ($break) must not be empty +ValueError: wordwrap(): Argument #3 ($break) must not be empty diff --git a/ext/standard/tests/strings/wordwrap_error.phpt b/ext/standard/tests/strings/wordwrap_error.phpt index b93bb80565b8..983d1bbe89a8 100644 --- a/ext/standard/tests/strings/wordwrap_error.phpt +++ b/ext/standard/tests/strings/wordwrap_error.phpt @@ -25,7 +25,7 @@ $cut = true; try { wordwrap($str, $width, $break, $cut); } catch (\ValueError $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "-- width = -10 & cut = false --\n"; @@ -47,7 +47,7 @@ var_dump( wordwrap($str, $width, $break, $cut) ); -- width = 0 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = 0 & cut = true -- -wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0 +ValueError: wordwrap(): Argument #4 ($cut_long_words) cannot be true when argument #2 ($width) is 0 -- width = -10 & cut = false -- string(39) "testing
\nwordwrap
\nfunction" -- width = -10 & cut = true -- diff --git a/ext/standard/tests/time/bug60222.phpt b/ext/standard/tests/time/bug60222.phpt index 0256e2de1d5c..28d7cee2a4ed 100644 --- a/ext/standard/tests/time/bug60222.phpt +++ b/ext/standard/tests/time/bug60222.phpt @@ -5,15 +5,15 @@ Bug #60222 (time_nanosleep() does validate input params) try { time_nanosleep(-1, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { time_nanosleep(0, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0 -time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0 +ValueError: time_nanosleep(): Argument #1 ($seconds) must be greater than or equal to 0 +ValueError: time_nanosleep(): Argument #2 ($nanoseconds) must be greater than or equal to 0 diff --git a/ext/standard/tests/url/parse_url_error_002.phpt b/ext/standard/tests/url/parse_url_error_002.phpt index 8747e568e939..49492c0c98a5 100644 --- a/ext/standard/tests/url/parse_url_error_002.phpt +++ b/ext/standard/tests/url/parse_url_error_002.phpt @@ -12,7 +12,7 @@ echo "\n\n--> Above range:\n"; try { parse_url($url, 99); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done" @@ -40,5 +40,5 @@ echo "Done" --> Above range: -parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given +ValueError: parse_url(): Argument #2 ($component) must be a valid URL component identifier, 99 given Done diff --git a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt index c4fffab73328..1e72aafe68fe 100644 --- a/ext/standard/tests/versioning/version_compare_invalid_operator.phpt +++ b/ext/standard/tests/versioning/version_compare_invalid_operator.phpt @@ -7,8 +7,8 @@ David Stockton - - i3logix PHP Testfest 2017 try { version_compare('1.2', '2.1', '??'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -version_compare(): Argument #3 ($operator) must be a valid comparison operator +ValueError: version_compare(): Argument #3 ($operator) must be a valid comparison operator diff --git a/ext/sysvmsg/tests/005.phpt b/ext/sysvmsg/tests/005.phpt index ec36c85b75ff..a38761ebffb8 100644 --- a/ext/sysvmsg/tests/005.phpt +++ b/ext/sysvmsg/tests/005.phpt @@ -31,7 +31,7 @@ foreach ($tests as $i => $q) { try { msg_receive($q, 0, $null, 0, $msg); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(msg_send($q, 1, 'foo', true, true, $errno)); @@ -46,7 +46,7 @@ bool(false) bool(false) bool(false) bool(true) -msg_receive(): Argument #4 ($max_message_size) must be greater than 0 +ValueError: msg_receive(): Argument #4 ($max_message_size) must be greater than 0 Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d bool(false) @@ -56,7 +56,7 @@ bool(false) bool(false) bool(false) bool(true) -msg_receive(): Argument #4 ($max_message_size) must be greater than 0 +ValueError: msg_receive(): Argument #4 ($max_message_size) must be greater than 0 Warning: msg_send(): msgsnd failed: Invalid argument in %s on line %d bool(false) diff --git a/ext/sysvmsg/tests/006.phpt b/ext/sysvmsg/tests/006.phpt index ae608c6c1fbf..3e59d4a5cd86 100644 --- a/ext/sysvmsg/tests/006.phpt +++ b/ext/sysvmsg/tests/006.phpt @@ -14,7 +14,7 @@ foreach ($tests as $elem) { try { var_dump(msg_send($queue, 1, $elem, false)); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } unset($msg); @@ -57,12 +57,12 @@ bool(true) bool(true) bool(false) Sending/receiving '': -msg_send(): Argument #3 ($message) must be of type string|int|float|bool, null given +TypeError: msg_send(): Argument #3 ($message) must be of type string|int|float|bool, null given bool(false) bool(true) bool(false) Sending/receiving 'Array': -msg_send(): Argument #3 ($message) must be of type string|int|float|bool, array given +TypeError: msg_send(): Argument #3 ($message) must be of type string|int|float|bool, array given bool(false) bool(false) bool(false) diff --git a/ext/sysvmsg/tests/gh16592.phpt b/ext/sysvmsg/tests/gh16592.phpt index 8490d000f891..7a1bbb627adc 100644 --- a/ext/sysvmsg/tests/gh16592.phpt +++ b/ext/sysvmsg/tests/gh16592.phpt @@ -12,8 +12,8 @@ $q = msg_get_queue(1); try { msg_send($q, 1, new Test, true); } catch (\TypeError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -Test::__serialize() must return an array +TypeError: Test::__serialize() must return an array diff --git a/ext/sysvshm/tests/001.phpt b/ext/sysvshm/tests/001.phpt index 10b258da2d0b..f97ff5eb0b36 100644 --- a/ext/sysvshm/tests/001.phpt +++ b/ext/sysvshm/tests/001.phpt @@ -13,19 +13,19 @@ if (!function_exists('ftok')){ print 'skip'; } try { ftok("",""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ftok(-1, -1); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { ftok("qwertyu","qwertyu"); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(ftok("nonexistentfile","q")); @@ -35,9 +35,9 @@ var_dump(ftok(__FILE__,"q")); echo "Done\n"; ?> --EXPECTF-- -ftok(): Argument #1 ($filename) must not be empty -ftok(): Argument #2 ($project_id) must be a single character -ftok(): Argument #2 ($project_id) must be a single character +ValueError: ftok(): Argument #1 ($filename) must not be empty +ValueError: ftok(): Argument #2 ($project_id) must be a single character +ValueError: ftok(): Argument #2 ($project_id) must be a single character Warning: ftok(): ftok() failed - No such file or directory in %s on line %d int(-1) diff --git a/ext/sysvshm/tests/002.phpt b/ext/sysvshm/tests/002.phpt index d9a91c580e93..2521a388cfd4 100644 --- a/ext/sysvshm/tests/002.phpt +++ b/ext/sysvshm/tests/002.phpt @@ -15,31 +15,31 @@ $key = ftok(__FILE__, 't'); try { shm_attach(-1, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shm_attach(0, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shm_attach(123, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shm_attach($key, -1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shm_attach($key, 0); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($s = shm_attach($key, 1024)); @@ -57,11 +57,11 @@ shm_remove($s); echo "Done\n"; ?> --EXPECTF-- -shm_attach(): Argument #2 ($size) must be greater than 0 -shm_attach(): Argument #2 ($size) must be greater than 0 -shm_attach(): Argument #2 ($size) must be greater than 0 -shm_attach(): Argument #2 ($size) must be greater than 0 -shm_attach(): Argument #2 ($size) must be greater than 0 +ValueError: shm_attach(): Argument #2 ($size) must be greater than 0 +ValueError: shm_attach(): Argument #2 ($size) must be greater than 0 +ValueError: shm_attach(): Argument #2 ($size) must be greater than 0 +ValueError: shm_attach(): Argument #2 ($size) must be greater than 0 +ValueError: shm_attach(): Argument #2 ($size) must be greater than 0 object(SysvSharedMemory)#%d (0) { } object(SysvSharedMemory)#%d (0) { diff --git a/ext/sysvshm/tests/003.phpt b/ext/sysvshm/tests/003.phpt index 1d842fb92759..4fbdb918966d 100644 --- a/ext/sysvshm/tests/003.phpt +++ b/ext/sysvshm/tests/003.phpt @@ -18,13 +18,13 @@ var_dump(shm_detach($s)); try { shm_detach($s); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { shm_remove($s); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; @@ -39,6 +39,6 @@ shm_remove($s); ?> --EXPECT-- bool(true) -Shared memory block has already been destroyed -Shared memory block has already been destroyed +Error: Shared memory block has already been destroyed +Error: Shared memory block has already been destroyed Done diff --git a/ext/sysvshm/tests/006.phpt b/ext/sysvshm/tests/006.phpt index edbf9288acce..35da41adc54b 100644 --- a/ext/sysvshm/tests/006.phpt +++ b/ext/sysvshm/tests/006.phpt @@ -16,7 +16,7 @@ $s = shm_attach($key, 1024); try { shm_put_var($s, 1, "test string"); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump(shm_remove_var($s, -10)); diff --git a/ext/sysvshm/tests/007.phpt b/ext/sysvshm/tests/007.phpt index 544c39deb00a..da0ebfb89e6f 100644 --- a/ext/sysvshm/tests/007.phpt +++ b/ext/sysvshm/tests/007.phpt @@ -19,12 +19,12 @@ shm_detach($s); try { shm_remove($s); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Done\n"; ?> --EXPECT-- bool(true) -Shared memory block has already been destroyed +Error: Shared memory block has already been destroyed Done diff --git a/ext/sysvshm/tests/gh16591.phpt b/ext/sysvshm/tests/gh16591.phpt index d3ece7cd796a..518750c2a43a 100644 --- a/ext/sysvshm/tests/gh16591.phpt +++ b/ext/sysvshm/tests/gh16591.phpt @@ -17,9 +17,9 @@ $mem = shm_attach(1); try { shm_put_var($mem, 1, new C); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Shared memory block has been destroyed by the serialization function +Error: Shared memory block has been destroyed by the serialization function diff --git a/ext/sysvshm/tests/gh9945.phpt b/ext/sysvshm/tests/gh9945.phpt index 8185d39b0981..cc53e5e1eafa 100644 --- a/ext/sysvshm/tests/gh9945.phpt +++ b/ext/sysvshm/tests/gh9945.phpt @@ -12,8 +12,8 @@ if (PHP_OS_FAMILY !== 'Linux' && PHP_OS_FAMILY !== 'Windows') die('skip only for try { shm_attach(0x100000000, 0); } catch (ValueError $exception) { - echo $exception->getMessage(), "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -shm_attach(): Argument #1 ($key) is out of range +ValueError: shm_attach(): Argument #1 ($key) is out of range diff --git a/ext/sysvshm/tests/serialize_exception.phpt b/ext/sysvshm/tests/serialize_exception.phpt index aae237e0fb38..a311600ec223 100644 --- a/ext/sysvshm/tests/serialize_exception.phpt +++ b/ext/sysvshm/tests/serialize_exception.phpt @@ -17,11 +17,11 @@ class Test { try { shm_put_var($s, 1, new Test); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } shm_remove($s); ?> --EXPECT-- -no +Error: no diff --git a/ext/tidy/tests/007.phpt b/ext/tidy/tests/007.phpt index fbb3731b1d01..09acb879dd21 100644 --- a/ext/tidy/tests/007.phpt +++ b/ext/tidy/tests/007.phpt @@ -17,13 +17,13 @@ var_dump($a->getopt("tab-size")); try { $a->getopt('bogus-opt'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { tidy_getopt($a, 'non-ASCII string ���'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -31,5 +31,5 @@ try { Current Value of 'tidy-mark': bool(false) Current Value of 'error-file': string(0) "" Current Value of 'tab-size': int(8) -tidy::getOpt(): Argument #1 ($option) is an invalid configuration option, "bogus-opt" given -tidy_getopt(): Argument #2 ($option) is an invalid configuration option, "non-ASCII string ���" given +ValueError: tidy::getOpt(): Argument #1 ($option) is an invalid configuration option, "bogus-opt" given +ValueError: tidy_getopt(): Argument #2 ($option) is an invalid configuration option, "non-ASCII string ���" given diff --git a/ext/tidy/tests/019.phpt b/ext/tidy/tests/019.phpt index 9bf6cf6349a3..411719cce25e 100644 --- a/ext/tidy/tests/019.phpt +++ b/ext/tidy/tests/019.phpt @@ -15,12 +15,12 @@ tidy_repair_string($l, $l, $l); try { tidy_repair_file($s, $l, $l, $l); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { tidy_repair_file($s, $s, $s, $s); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } tidy_repair_file($l, $l, $l ,$l); // This doesn't emit any warning, TODO look into @@ -37,6 +37,6 @@ Warning: tidy_repair_string(): Could not load the Tidy configuration file "" in Warning: tidy_repair_string(): Could not load the Tidy configuration file "1" in %s on line %d Warning: tidy_repair_string(): Could not set encoding "1" in %s on line %d -Path must not be empty -Path must not be empty +ValueError: Path must not be empty +ValueError: Path must not be empty Done diff --git a/ext/tidy/tests/021.phpt b/ext/tidy/tests/021.phpt index f4c2a99017f8..22e351e4d9dc 100644 --- a/ext/tidy/tests/021.phpt +++ b/ext/tidy/tests/021.phpt @@ -10,7 +10,7 @@ tidy try { tidy_get_opt_doc(new tidy, 'some_bogus_cfg'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $t = new tidy; @@ -18,6 +18,6 @@ var_dump($t->getOptDoc('ncr')); var_dump(strlen(tidy_get_opt_doc($t, 'wrap')) > 99); ?> --EXPECT-- -tidy_get_opt_doc(): Argument #2 ($option) is an invalid configuration option, "some_bogus_cfg" given +ValueError: tidy_get_opt_doc(): Argument #2 ($option) is an invalid configuration option, "some_bogus_cfg" given string(73) "This option specifies if Tidy should allow numeric character references. " bool(true) diff --git a/ext/tidy/tests/036.phpt b/ext/tidy/tests/036.phpt index d328c4862fe7..0de72c10c6be 100644 --- a/ext/tidy/tests/036.phpt +++ b/ext/tidy/tests/036.phpt @@ -11,65 +11,65 @@ $node = $tidy->body(); try { $node->value = ""; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->name = ""; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->type = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->line = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->column = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->proprietary = true; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->id = null; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->attribute = []; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $node->child = []; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -Cannot modify readonly property tidyNode::$value -Cannot modify readonly property tidyNode::$name -Cannot modify readonly property tidyNode::$type -Cannot modify readonly property tidyNode::$line -Cannot modify readonly property tidyNode::$column -Cannot modify readonly property tidyNode::$proprietary -Cannot modify readonly property tidyNode::$id -Cannot modify readonly property tidyNode::$attribute -Cannot modify readonly property tidyNode::$child +Error: Cannot modify readonly property tidyNode::$value +Error: Cannot modify readonly property tidyNode::$name +Error: Cannot modify readonly property tidyNode::$type +Error: Cannot modify readonly property tidyNode::$line +Error: Cannot modify readonly property tidyNode::$column +Error: Cannot modify readonly property tidyNode::$proprietary +Error: Cannot modify readonly property tidyNode::$id +Error: Cannot modify readonly property tidyNode::$attribute +Error: Cannot modify readonly property tidyNode::$child diff --git a/ext/tidy/tests/bug77040.phpt b/ext/tidy/tests/bug77040.phpt index 417c5e5f8924..a4f4c1613aa9 100644 --- a/ext/tidy/tests/bug77040.phpt +++ b/ext/tidy/tests/bug77040.phpt @@ -22,4 +22,4 @@ bool(true) bool(true) bool(false) bool(true) -bool(false) \ No newline at end of file +bool(false) diff --git a/ext/tidy/tests/gh20374.phpt b/ext/tidy/tests/gh20374.phpt index 73299856b081..fb7bca73ee61 100644 --- a/ext/tidy/tests/gh20374.phpt +++ b/ext/tidy/tests/gh20374.phpt @@ -50,7 +50,7 @@ foreach ($values as $key => $value) { $tidy->parseString($str, $config, 'utf8'); echo $tidy->value, "\n"; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/ext/tidy/tests/open_basedir_failure_config.phpt b/ext/tidy/tests/open_basedir_failure_config.phpt index 3b12c9e4ea8f..e7bdfd46f881 100644 --- a/ext/tidy/tests/open_basedir_failure_config.phpt +++ b/ext/tidy/tests/open_basedir_failure_config.phpt @@ -20,7 +20,7 @@ echo "=== __construct ===\n"; try { $tidy = new tidy(__DIR__.'/open_basedir/test.html', 'my_config_file.ini'); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "=== parseFile ===\n"; @@ -42,7 +42,7 @@ Warning: tidy_parse_string(): open_basedir restriction in effect. File(my_config Warning: tidy_parse_file(): open_basedir restriction in effect. File(my_config_file.ini) is not within the allowed path(s): (%sopen_basedir) in %s on line %d === __construct === -tidy::__construct(): open_basedir restriction in effect. File(my_config_file.ini) is not within the allowed path(s): (%sopen_basedir) +Exception: tidy::__construct(): open_basedir restriction in effect. File(my_config_file.ini) is not within the allowed path(s): (%sopen_basedir) === parseFile === Warning: tidy::parseFile(): open_basedir restriction in effect. File(my_config_file.ini) is not within the allowed path(s): (%sopen_basedir) in %s on line %d diff --git a/ext/tidy/tests/parsing_inexistent_file.phpt b/ext/tidy/tests/parsing_inexistent_file.phpt index e5f73c5388ce..ca9690683500 100644 --- a/ext/tidy/tests/parsing_inexistent_file.phpt +++ b/ext/tidy/tests/parsing_inexistent_file.phpt @@ -13,7 +13,7 @@ var_dump(tidy_parse_file("does_not_exist.html")); try { $tidy = new tidy("does_not_exist.html"); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- @@ -22,4 +22,4 @@ bool(false) Warning: tidy_parse_file(): Cannot load "does_not_exist.html" into memory in %s on line %d bool(false) -Cannot load "does_not_exist.html" into memory +Exception: Cannot load "does_not_exist.html" into memory diff --git a/ext/tidy/tests/tidy_error1.phpt b/ext/tidy/tests/tidy_error1.phpt index 5e7593762a93..e565db3aecea 100644 --- a/ext/tidy/tests/tidy_error1.phpt +++ b/ext/tidy/tests/tidy_error1.phpt @@ -14,14 +14,14 @@ $tidy = new tidy(); try { $tidy->parseString($buffer, $config); } catch (\ValueError $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $config = ['neither']; try { $tidy->parseString($buffer, $config); } catch (\TypeError $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $config = ['doctype-mode' => 'customtag']; @@ -29,7 +29,7 @@ $config = ['doctype-mode' => 'customtag']; try { var_dump($tidy->parseString($buffer, $config)); } catch (\ValueError $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $config = ['doctype' => 'php']; @@ -37,7 +37,7 @@ $config = ['doctype' => 'php']; try { var_dump($tidy->parseString($buffer, $config)); } catch (\TypeError $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $config = ['doctype' => 'auto', 0 => 'value2']; @@ -45,7 +45,7 @@ $config = ['doctype' => 'auto', 0 => 'value2']; try { var_dump($tidy->parseString($buffer, $config)); } catch (\TypeError $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/tidy/tests/uninitialized.phpt b/ext/tidy/tests/uninitialized.phpt index 7793f9725b19..38dd124c9623 100644 --- a/ext/tidy/tests/uninitialized.phpt +++ b/ext/tidy/tests/uninitialized.phpt @@ -9,21 +9,21 @@ $tidy = new tidy; try { var_dump($tidy->getHtmlVer()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($tidy->isXhtml()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($tidy->isXml()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -tidy object is not initialized -tidy object is not initialized -tidy object is not initialized +Error: tidy object is not initialized +Error: tidy object is not initialized +Error: tidy object is not initialized diff --git a/ext/tokenizer/tests/PhpToken_extension_errors.phpt b/ext/tokenizer/tests/PhpToken_extension_errors.phpt index c0676c6b7952..241bdae61572 100644 --- a/ext/tokenizer/tests/PhpToken_extension_errors.phpt +++ b/ext/tokenizer/tests/PhpToken_extension_errors.phpt @@ -12,7 +12,7 @@ class MyPhpToken1 extends PhpToken { try { var_dump(MyPhpToken1::tokenize("getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } abstract class MyPhpToken2 extends PhpToken { @@ -21,10 +21,10 @@ abstract class MyPhpToken2 extends PhpToken { try { var_dump(MyPhpToken2::tokenize("getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Undefined constant "UNKNOWN" -Cannot instantiate abstract class MyPhpToken2 +Error: Undefined constant "UNKNOWN" +Error: Cannot instantiate abstract class MyPhpToken2 diff --git a/ext/tokenizer/tests/PhpToken_methods.phpt b/ext/tokenizer/tests/PhpToken_methods.phpt index 13aee9856931..80d149f6ddf0 100644 --- a/ext/tokenizer/tests/PhpToken_methods.phpt +++ b/ext/tokenizer/tests/PhpToken_methods.phpt @@ -40,12 +40,12 @@ echo "\nError:\n"; try { $token->is(3.141); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token->is([3.141]); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($token->id); @@ -53,22 +53,22 @@ unset($token->text); try { $token->is(T_FUNCTION); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token->is('function'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token->is([T_FUNCTION]); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $token->is(['function']); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\nName of unknown token:\n"; @@ -110,12 +110,12 @@ bool(false) bool(false) Error: -PhpToken::is(): Argument #1 ($kind) must be of type string|int|array, float given -PhpToken::is(): Argument #1 ($kind) must only have elements of type string|int, float given -Typed property PhpToken::$id must not be accessed before initialization -Typed property PhpToken::$text must not be accessed before initialization -Typed property PhpToken::$id must not be accessed before initialization -Typed property PhpToken::$text must not be accessed before initialization +TypeError: PhpToken::is(): Argument #1 ($kind) must be of type string|int|array, float given +TypeError: PhpToken::is(): Argument #1 ($kind) must only have elements of type string|int, float given +Error: Typed property PhpToken::$id must not be accessed before initialization +Error: Typed property PhpToken::$text must not be accessed before initialization +Error: Typed property PhpToken::$id must not be accessed before initialization +Error: Typed property PhpToken::$text must not be accessed before initialization Name of unknown token: NULL diff --git a/ext/tokenizer/tests/parse_errors.phpt b/ext/tokenizer/tests/parse_errors.phpt index 2985272b3749..9e44105e9249 100644 --- a/ext/tokenizer/tests/parse_errors.phpt +++ b/ext/tokenizer/tests/parse_errors.phpt @@ -9,7 +9,7 @@ function test_parse_error($code) { try { var_dump(token_get_all($code, TOKEN_PARSE)); } catch (ParseError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } foreach (token_get_all($code) as $token) { @@ -29,7 +29,7 @@ test_parse_error(' --EXPECT-- -Invalid numeric literal +ParseError: Invalid numeric literal T_OPEN_TAG (getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Done"; ?> --EXPECT-- -syntax error, unexpected identifier "code" +ParseError: syntax error, unexpected identifier "code" Done diff --git a/ext/tokenizer/tests/token_get_all_heredoc_nowdoc.phpt b/ext/tokenizer/tests/token_get_all_heredoc_nowdoc.phpt index 6b3010d7cf41..62fc1a9c74bb 100644 --- a/ext/tokenizer/tests/token_get_all_heredoc_nowdoc.phpt +++ b/ext/tokenizer/tests/token_get_all_heredoc_nowdoc.phpt @@ -15,7 +15,7 @@ function test(string $code, int $flags) } } } catch (ParseError $e) { - echo "Parse error: {$e->getMessage()} on line {$e->getLine()}\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } } @@ -326,11 +326,11 @@ Line 2: T_END_HEREDOC (' INNER_END') Test case 5 -Parse error: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 2 +ParseError: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 2 Test case 6 -Parse error: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 2 +ParseError: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 2 Test case 7 @@ -343,7 +343,7 @@ Line 3: T_END_HEREDOC ('INNER_END') Test case 8 -Parse error: Invalid indentation - tabs and spaces cannot be mixed on line 3 +ParseError: Invalid indentation - tabs and spaces cannot be mixed on line 3 Test case 9 @@ -365,7 +365,7 @@ Line 3: T_END_HEREDOC (' INNER_END') Test case 11 -Parse error: Invalid body indentation level (expecting an indentation level of at least 3) on line 2 +ParseError: Invalid body indentation level (expecting an indentation level of at least 3) on line 2 Test case 12 @@ -396,7 +396,7 @@ Line 3: T_END_HEREDOC (' INNER_END') Test case 15 -Parse error: Invalid body indentation level (expecting an indentation level of at least 3) on line 2 +ParseError: Invalid body indentation level (expecting an indentation level of at least 3) on line 2 Test case 16 @@ -409,8 +409,8 @@ Line 3: T_END_HEREDOC (' INNER_END') Test case 17 -Parse error: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 4 +ParseError: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 4 Test case 18 -Parse error: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 4 +ParseError: syntax error, unexpected end of file, expecting variable or heredoc end or "${" or "{$" on line 4 diff --git a/ext/uri/tests/004.phpt b/ext/uri/tests/004.phpt index a7c2e190683a..9a47ac9a8d91 100644 --- a/ext/uri/tests/004.phpt +++ b/ext/uri/tests/004.phpt @@ -9,7 +9,7 @@ var_dump(Uri\Rfc3986\Uri::parse("")); try { new Uri\WhatWg\Url(""); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(Uri\WhatWg\Url::parse("")); @@ -58,7 +58,7 @@ object(Uri\Rfc3986\Uri)#%d (%d) { ["fragment"]=> NULL } -The specified URI is malformed (MissingSchemeNonRelativeUrl) +Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl) NULL object(Uri\Rfc3986\Uri)#%d (%d) { ["scheme"]=> diff --git a/ext/uri/tests/007.phpt b/ext/uri/tests/007.phpt index db051e553fb1..d17f53e2f2b2 100644 --- a/ext/uri/tests/007.phpt +++ b/ext/uri/tests/007.phpt @@ -6,13 +6,13 @@ Test URI creation errors try { new Uri\Rfc3986\Uri("https://example.com:8080@username:password/path?q=r#fragment"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { new Uri\WhatWg\Url("https://example.com:8080@username:password/path?q=r#fragment"); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; var_dump($e->errors); } @@ -23,8 +23,8 @@ var_dump($failures); ?> --EXPECTF-- -The specified URI is malformed -The specified URI is malformed (PortInvalid) +Uri\InvalidUriException: The specified URI is malformed +Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortInvalid) array(%d) { [0]=> object(Uri\WhatWg\UrlValidationError)#%d (%d) { diff --git a/ext/uri/tests/015.phpt b/ext/uri/tests/015.phpt index cf6c09703d2e..7f04b4ada0bc 100644 --- a/ext/uri/tests/015.phpt +++ b/ext/uri/tests/015.phpt @@ -10,17 +10,17 @@ try { $reflectionClass = new ReflectionClass(Uri\Rfc3986\Uri::class); $reflectionClass->newInstanceWithoutConstructor(); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $reflectionClass = new ReflectionClass(Uri\WhatWg\Url::class); $reflectionClass->newInstanceWithoutConstructor(); } catch (ReflectionException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Class Uri\Rfc3986\Uri is an internal class marked as final that cannot be instantiated without invoking its constructor -Class Uri\WhatWg\Url is an internal class marked as final that cannot be instantiated without invoking its constructor +ReflectionException: Class Uri\Rfc3986\Uri is an internal class marked as final that cannot be instantiated without invoking its constructor +ReflectionException: Class Uri\WhatWg\Url is an internal class marked as final that cannot be instantiated without invoking its constructor diff --git a/ext/uri/tests/023.phpt b/ext/uri/tests/023.phpt index d52fa3405322..7ecea0b1414a 100644 --- a/ext/uri/tests/023.phpt +++ b/ext/uri/tests/023.phpt @@ -18,13 +18,13 @@ var_dump($uri3->getScheme()); try { $uri3->withScheme(""); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri3->withScheme("http%73"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = Uri\WhatWg\Url::parse("https://example.com"); @@ -36,13 +36,13 @@ var_dump($url2->getScheme()); try { $url2->withScheme(""); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $url2->withScheme("http%73"); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -53,9 +53,9 @@ string(4) "http" string(4) "http" NULL NULL -The specified scheme is malformed -The specified scheme is malformed +Uri\InvalidUriException: The specified scheme is malformed +Uri\InvalidUriException: The specified scheme is malformed string(5) "https" string(4) "http" -The specified scheme is malformed -The specified scheme is malformed +Uri\WhatWg\InvalidUrlException: The specified scheme is malformed +Uri\WhatWg\InvalidUrlException: The specified scheme is malformed diff --git a/ext/uri/tests/026.phpt b/ext/uri/tests/026.phpt index e46c30055cb6..64205aa82d05 100644 --- a/ext/uri/tests/026.phpt +++ b/ext/uri/tests/026.phpt @@ -30,25 +30,25 @@ var_dump($uri6->getHost()); try { $uri3->withHost("test.com:8080"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri3->withHost("t%3As%2Ft.com"); // t:s/t.com } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri3->withHost("t:s/t.com"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri2->withHost(""); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $uri1 = Uri\Rfc3986\Uri::parse("ftp://user:pass@foo.com?query=abc#foo"); @@ -60,7 +60,7 @@ var_dump($uri2->getHost()); try { $uri1->withHost(null); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = Uri\WhatWg\Url::parse("https://example.com"); @@ -78,25 +78,25 @@ var_dump($url5->getAsciiHost()); try { $url3->withHost("test.com:8080"); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $url3->withHost("t%3As%2Ft.com"); // t:s/t.com } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $url3->withHost("t:s/t.com"); // t:s/t.com } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $url2->withHost(null); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = Uri\WhatWg\Url::parse("ftp://foo.com?query=abc#foo"); @@ -119,19 +119,19 @@ string(11) "192.168.0.1" string(11) "192.168.0.1" string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" -The specified host is malformed -The specified host is malformed +Uri\InvalidUriException: The specified host is malformed +Uri\InvalidUriException: The specified host is malformed string(7) "foo.com" string(8) "test.com" -Cannot remove the host from a URI that has a userinfo +Uri\InvalidUriException: Cannot remove the host from a URI that has a userinfo string(11) "example.com" string(8) "test.com" string(8) "test.com" string(11) "192.168.0.1" string(40) "[2001:db8:3333:4444:5555:6666:7777:8888]" -The specified host is malformed -The specified host is malformed (DomainInvalidCodePoint) -The specified host is malformed -The specified host is malformed (HostMissing) +Uri\WhatWg\InvalidUrlException: The specified host is malformed +Uri\WhatWg\InvalidUrlException: The specified host is malformed (DomainInvalidCodePoint) +Uri\WhatWg\InvalidUrlException: The specified host is malformed +Uri\WhatWg\InvalidUrlException: The specified host is malformed (HostMissing) string(7) "foo.com" string(8) "test.com" diff --git a/ext/uri/tests/026_userinfo.phpt b/ext/uri/tests/026_userinfo.phpt index cff2665803a4..4c7edfd5eb0d 100644 --- a/ext/uri/tests/026_userinfo.phpt +++ b/ext/uri/tests/026_userinfo.phpt @@ -26,7 +26,7 @@ var_dump($uri2->getPort()); try { $uri4->withUserInfo("u:s/r"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $uri5 = Uri\Rfc3986\Uri::parse("file:///foo/bar/"); @@ -46,6 +46,6 @@ NULL string(13) "%75s%2Fr:pass" string(11) "us%2Fr:pass" NULL -The specified userinfo is malformed +Uri\InvalidUriException: The specified userinfo is malformed NULL string(9) "user:pass" diff --git a/ext/uri/tests/027.phpt b/ext/uri/tests/027.phpt index 334d67aa0bb6..ea5d96f95292 100644 --- a/ext/uri/tests/027.phpt +++ b/ext/uri/tests/027.phpt @@ -30,7 +30,7 @@ var_dump($uri2->getPort()); try { $uri1->withPort(1); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = Uri\WhatWg\Url::parse("https://example.com:8080"); @@ -63,7 +63,7 @@ int(8080) NULL int(80) NULL -Cannot set a port without having a host +Uri\InvalidUriException: Cannot set a port without having a host int(8080) int(22) NULL diff --git a/ext/uri/tests/028.phpt b/ext/uri/tests/028.phpt index cfc11b331c8e..f3806c1ed2ab 100644 --- a/ext/uri/tests/028.phpt +++ b/ext/uri/tests/028.phpt @@ -26,13 +26,13 @@ var_dump($uri5->getPath()); try { $uri5->withPath("test"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri5->withPath("/#"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $uri1 = Uri\Rfc3986\Uri::parse("/foo"); @@ -73,8 +73,8 @@ string(10) "/foo%2Fbar" string(10) "/foo%2Fbar" string(0) "" string(0) "" -The specified path is malformed -The specified path is malformed +Uri\InvalidUriException: The specified path is malformed +Uri\InvalidUriException: The specified path is malformed string(4) "/foo" string(3) "bar" string(9) "/foo/bar/" diff --git a/ext/uri/tests/029.phpt b/ext/uri/tests/029.phpt index 4936cb60db87..8bb0158090e7 100644 --- a/ext/uri/tests/029.phpt +++ b/ext/uri/tests/029.phpt @@ -38,7 +38,7 @@ var_dump($uri5->getQuery()); try { $uri5->withQuery("#"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = Uri\WhatWg\Url::parse("https://example.com?foo=bar"); @@ -81,7 +81,7 @@ string(6) "t%65st" string(4) "test" string(25) "foo=foo%26bar&baz=/qux%3D" string(25) "foo=foo%26bar&baz=/qux%3D" -The specified query is malformed +Uri\InvalidUriException: The specified query is malformed string(7) "foo=bar" string(7) "foo=baz" NULL diff --git a/ext/uri/tests/030.phpt b/ext/uri/tests/030.phpt index 03ed763f7795..8912cf096ac4 100644 --- a/ext/uri/tests/030.phpt +++ b/ext/uri/tests/030.phpt @@ -18,13 +18,13 @@ var_dump($uri3->getFragment()); try { $uri3->withFragment(" "); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $uri1->withFragment("#fragment2"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $uri1 = Uri\Rfc3986\Uri::parse("https://example.com?abc=def"); @@ -57,8 +57,8 @@ string(9) "fragment2" string(9) "fragment2" NULL NULL -The specified fragment is malformed -The specified fragment is malformed +Uri\InvalidUriException: The specified fragment is malformed +Uri\InvalidUriException: The specified fragment is malformed NULL string(8) "fragment" string(9) "fragment1" diff --git a/ext/uri/tests/031.phpt b/ext/uri/tests/031.phpt index d3cc926b82fa..e7454a7d7f79 100644 --- a/ext/uri/tests/031.phpt +++ b/ext/uri/tests/031.phpt @@ -13,49 +13,49 @@ var_dump($uri2); try { unserialize('O:15:"Uri\Rfc3986\Uri":1:{i:0;a:0:{}}'); // less than 2 items } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":3:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}}'); // more than 2 items } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;N;i:1;a:0:{}}'); // first item is not an array } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:0:{}i:1;a:0:{}}'); // first array is empty } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";i:1;}i:1;a:0:{}}'); // "uri" key in first array is not a string } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:2:"%1";}i:1;a:0:{}}'); // "uri" key in first array contains invalid URI } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:4:"/uri";}i:1;s:0:"";}'); // second item in not an array } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:15:"Uri\Rfc3986\Uri":2:{i:0;a:1:{s:3:"uri";s:4:"/uri";}i:1;a:1:{s:5:"prop1";i:123;}}'); // second array contains a property } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url1 = new Uri\WhatWg\Url("https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists"); @@ -68,55 +68,55 @@ var_dump($url2); try { unserialize('O:14:"Uri\WhatWg\Url":1:{i:0;a:0:{}}'); // less than 2 items } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":3:{i:0;a:0:{}i:1;a:0:{}i:2;a:0:{}}'); // more than 2 items } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;N;i:1;a:0:{}}'); // first item is not an array } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:0:{}i:1;a:0:{}}'); // first array is empty } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:2:{s:3:"uri";s:19:"https://example.com";s:1:"a";i:1;}i:1;a:0:{}}'); // "uri" key in first array contains more than 1 item } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";i:1;}i:1;a:0:{}}'); // "uri" key in first array is not a string } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:11:"invalid-url";}i:1;a:0:{}}'); // "uri" key in first array contains invalid URL } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:19:"https://example.com";}i:1;s:0:"";}'); // second item in not an array } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:19:"https://example.com";}i:1;a:1:{s:5:"prop1";i:123;}}'); // second array contains property } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -140,14 +140,14 @@ object(Uri\Rfc3986\Uri)#%d (%d) { ["fragment"]=> string(11) "hash-exists" } -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object -Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object +Exception: Invalid serialization data for Uri\Rfc3986\Uri object string(163) "O:14:"Uri\WhatWg\Url":2:{i:0;a:1:{s:3:"uri";s:99:"https://username:password@www.example.com:8080/pathname1/pathname2/pathname3?query=true#hash-exists";}i:1;a:0:{}}" object(Uri\WhatWg\Url)#%d (%d) { ["scheme"]=> @@ -167,12 +167,12 @@ object(Uri\WhatWg\Url)#%d (%d) { ["fragment"]=> string(11) "hash-exists" } -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object -Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object +Exception: Invalid serialization data for Uri\WhatWg\Url object diff --git a/ext/uri/tests/051.phpt b/ext/uri/tests/051.phpt index 0485356075a8..722254e059ec 100644 --- a/ext/uri/tests/051.phpt +++ b/ext/uri/tests/051.phpt @@ -8,7 +8,7 @@ $uri = new Uri\Rfc3986\Uri("https://example.com"); try { $uri->resolve("á"); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $url = new Uri\WhatWg\Url("https://example.com"); @@ -16,7 +16,7 @@ $url = new Uri\WhatWg\Url("https://example.com"); try { $url->resolve("https://1.2.3.4.5"); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $softErrors = []; @@ -26,8 +26,8 @@ var_dump($softErrors); ?> --EXPECTF-- -The specified URI is malformed -The specified URI is malformed (Ipv4TooManyParts) +Uri\InvalidUriException: The specified URI is malformed +Uri\WhatWg\InvalidUrlException: The specified URI is malformed (Ipv4TooManyParts) string(23) "https://example.com/foo" array(%d) { [0]=> diff --git a/ext/uri/tests/052.phpt b/ext/uri/tests/052.phpt index 3d8d2053f6e8..fbe1cc90558b 100644 --- a/ext/uri/tests/052.phpt +++ b/ext/uri/tests/052.phpt @@ -8,14 +8,14 @@ $r = new Uri\WhatWg\UrlValidationError('foo', Uri\WhatWg\UrlValidationErrorType: try { $r->__construct('bar', Uri\WhatWg\UrlValidationErrorType::HostMissing, false); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($r); ?> --EXPECTF-- -Cannot modify readonly property Uri\WhatWg\UrlValidationError::$context +Error: Cannot modify readonly property Uri\WhatWg\UrlValidationError::$context object(Uri\WhatWg\UrlValidationError)#%d (%d) { ["context"]=> string(3) "foo" diff --git a/ext/uri/tests/053.phpt b/ext/uri/tests/053.phpt index c88f4d386f35..c077c68452fc 100644 --- a/ext/uri/tests/053.phpt +++ b/ext/uri/tests/053.phpt @@ -13,25 +13,25 @@ $r = new Uri\WhatWg\InvalidUrlException( try { $r->__construct("foo"); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r->__construct("bar", []); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r->__construct("baz", [], 0); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $r->__construct("qax", [], 0, null); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($r->getMessage()); @@ -41,10 +41,10 @@ var_dump($r->getPrevious()::class); ?> --EXPECTF-- -Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors -Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors -Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors -Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors +Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors +Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors +Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors +Error: Cannot modify readonly property Uri\WhatWg\InvalidUrlException::$errors string(3) "qax" array(%d) { [%d]=> diff --git a/ext/uri/tests/054.phpt b/ext/uri/tests/054.phpt index 757b21cc114a..b8670395162f 100644 --- a/ext/uri/tests/054.phpt +++ b/ext/uri/tests/054.phpt @@ -6,11 +6,11 @@ Test UrlValidationErrorType singleton try { new \Uri\WhatWg\Url('http://localhost:99999'); } catch (Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; var_dump($e->errors[0]->type === \Uri\WhatWg\UrlValidationErrorType::PortOutOfRange); } ?> --EXPECT-- -The specified URI is malformed (PortOutOfRange) +Uri\WhatWg\InvalidUrlException: The specified URI is malformed (PortOutOfRange) bool(true) diff --git a/ext/uri/tests/055.phpt b/ext/uri/tests/055.phpt index de240bb6e053..1b2349142352 100644 --- a/ext/uri/tests/055.phpt +++ b/ext/uri/tests/055.phpt @@ -6,8 +6,8 @@ Test InvalidUrlException constructor error handling try { var_dump(new Uri\Rfc3986\Uri('foo', new Uri\Rfc3986\Uri('bar'))); } catch (Uri\InvalidUriException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -The specified base URI must be absolute +Uri\InvalidUriException: The specified base URI must be absolute diff --git a/ext/uri/tests/057.phpt b/ext/uri/tests/057.phpt index 5cc4e5974212..f7dbbc729256 100644 --- a/ext/uri/tests/057.phpt +++ b/ext/uri/tests/057.phpt @@ -11,7 +11,7 @@ $f = new Foo(); try { Uri\WhatWg\Url::parse(" https://example.org ", errors: $f->x); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/058.phpt b/ext/uri/tests/058.phpt index c1ceaa1e02e5..2a73dcd0cec2 100644 --- a/ext/uri/tests/058.phpt +++ b/ext/uri/tests/058.phpt @@ -20,7 +20,7 @@ try { new \Uri\Rfc3986\Uri('https://example.com:2147483648'); } } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/065.phpt b/ext/uri/tests/065.phpt index 2c84cceea3d4..2e5755475da0 100644 --- a/ext/uri/tests/065.phpt +++ b/ext/uri/tests/065.phpt @@ -7,7 +7,7 @@ $uri = new Uri\WhatWg\Url('https://example.com'); try { $uri->__construct('ftp://example.org'); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($uri); @@ -15,7 +15,7 @@ $uri = new Uri\WhatWg\Url('https://example.com'); try { $uri->__unserialize([['uri' => 'ftp://example.org'], []]); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($uri); @@ -23,7 +23,7 @@ $uri = new Uri\Rfc3986\Uri('https://example.com'); try { $uri->__construct('ftp://example.org'); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($uri); @@ -31,7 +31,7 @@ $uri = new Uri\Rfc3986\Uri('https://example.com'); try { $uri->__unserialize([['uri' => 'ftp://example.org'], []]); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($uri); diff --git a/ext/uri/tests/101.phpt b/ext/uri/tests/101.phpt index daa83e45c9f8..2a5ec8438e96 100644 --- a/ext/uri/tests/101.phpt +++ b/ext/uri/tests/101.phpt @@ -8,13 +8,13 @@ zend_test try { var_dump(zend_test_uri_parser('invalid uri', "Uri\\WhatWg\\Url")); } catch (\Uri\WhatWg\InvalidUrlException $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($e->errors); } ?> --EXPECTF-- -The specified URI is malformed (MissingSchemeNonRelativeUrl) +Uri\WhatWg\InvalidUrlException: The specified URI is malformed (MissingSchemeNonRelativeUrl) array(1) { [0]=> object(Uri\WhatWg\UrlValidationError)#%d (3) { diff --git a/ext/uri/tests/gh19780.phpt b/ext/uri/tests/gh19780.phpt index fffa25bc37d2..f2b251b50dcf 100644 --- a/ext/uri/tests/gh19780.phpt +++ b/ext/uri/tests/gh19780.phpt @@ -10,7 +10,7 @@ use Uri\WhatWg\UrlValidationErrorType; try { new InvalidUrlException('message', ['foo']); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { @@ -18,10 +18,10 @@ try { 1 => new UrlValidationError('context', UrlValidationErrorType::HostMissing, true) ]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError -Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError +ValueError: Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError +ValueError: Uri\WhatWg\InvalidUrlException::__construct(): Argument #2 ($errors) must be a list of Uri\WhatWg\UrlValidationError diff --git a/ext/uri/tests/rfc3986/builder/basic_error_with_base.phpt b/ext/uri/tests/rfc3986/builder/basic_error_with_base.phpt index 284de4e6a522..1bf6ba5168ee 100644 --- a/ext/uri/tests/rfc3986/builder/basic_error_with_base.phpt +++ b/ext/uri/tests/rfc3986/builder/basic_error_with_base.phpt @@ -9,7 +9,7 @@ $builder = new Uri\Rfc3986\UriBuilder() try { $builder->build(new Uri\Rfc3986\Uri("/foo/bar")); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/fragment_error_special_char.phpt b/ext/uri/tests/rfc3986/builder/fragment_error_special_char.phpt index 8ed2a8938e9a..e1d65437ed54 100644 --- a/ext/uri/tests/rfc3986/builder/fragment_error_special_char.phpt +++ b/ext/uri/tests/rfc3986/builder/fragment_error_special_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setFragment("#foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/fragment_error_unicode_char.phpt b/ext/uri/tests/rfc3986/builder/fragment_error_unicode_char.phpt index 2a15d5e85a82..7b879cb1fb0d 100644 --- a/ext/uri/tests/rfc3986/builder/fragment_error_unicode_char.phpt +++ b/ext/uri/tests/rfc3986/builder/fragment_error_unicode_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setFragment("főő"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/host_error_ipv6_closing_brace.phpt b/ext/uri/tests/rfc3986/builder/host_error_ipv6_closing_brace.phpt index 45eef13faf71..cf6bca7e8033 100644 --- a/ext/uri/tests/rfc3986/builder/host_error_ipv6_closing_brace.phpt +++ b/ext/uri/tests/rfc3986/builder/host_error_ipv6_closing_brace.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setHost("[2001:%30db8:85a3:0000:0000:8a2e:0370:7334"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/host_error_percent_encoding1.phpt b/ext/uri/tests/rfc3986/builder/host_error_percent_encoding1.phpt index ae06238a1f8f..79d46e1d7825 100644 --- a/ext/uri/tests/rfc3986/builder/host_error_percent_encoding1.phpt +++ b/ext/uri/tests/rfc3986/builder/host_error_percent_encoding1.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setHost("ex%3mple.co"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/host_error_percent_encoding2.phpt b/ext/uri/tests/rfc3986/builder/host_error_percent_encoding2.phpt index cc514ec69191..7f3408d5660d 100644 --- a/ext/uri/tests/rfc3986/builder/host_error_percent_encoding2.phpt +++ b/ext/uri/tests/rfc3986/builder/host_error_percent_encoding2.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setHost("[2001:%308:85a3:0000:0000:8a2e:0370:7334]"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/path_error_first_segment_colon.phpt b/ext/uri/tests/rfc3986/builder/path_error_first_segment_colon.phpt index 8cce8d471aa1..84fd62931b22 100644 --- a/ext/uri/tests/rfc3986/builder/path_error_first_segment_colon.phpt +++ b/ext/uri/tests/rfc3986/builder/path_error_first_segment_colon.phpt @@ -9,7 +9,7 @@ $builder->setPath("fo:o/bar/baz"); try { $builder->build(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/path_error_leading_double_slash.phpt b/ext/uri/tests/rfc3986/builder/path_error_leading_double_slash.phpt index b1f0a2518f1c..3c3bd3888808 100644 --- a/ext/uri/tests/rfc3986/builder/path_error_leading_double_slash.phpt +++ b/ext/uri/tests/rfc3986/builder/path_error_leading_double_slash.phpt @@ -9,7 +9,7 @@ $builder->setPath("//foo/bar/baz"); try { $builder->build(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/path_error_missing_leading_slash.phpt b/ext/uri/tests/rfc3986/builder/path_error_missing_leading_slash.phpt index 97b6c3e8b854..858bf2998249 100644 --- a/ext/uri/tests/rfc3986/builder/path_error_missing_leading_slash.phpt +++ b/ext/uri/tests/rfc3986/builder/path_error_missing_leading_slash.phpt @@ -10,7 +10,7 @@ $builder->setHost("example.com"); try { $builder->build(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/path_error_special_char.phpt b/ext/uri/tests/rfc3986/builder/path_error_special_char.phpt index 039b22770246..33061f189fc3 100644 --- a/ext/uri/tests/rfc3986/builder/path_error_special_char.phpt +++ b/ext/uri/tests/rfc3986/builder/path_error_special_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setPath("#foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/port_error_missing_host.phpt b/ext/uri/tests/rfc3986/builder/port_error_missing_host.phpt index 4b40e84c78f3..a531cb888625 100644 --- a/ext/uri/tests/rfc3986/builder/port_error_missing_host.phpt +++ b/ext/uri/tests/rfc3986/builder/port_error_missing_host.phpt @@ -9,7 +9,7 @@ $builder->setPort(443); try { $builder->build(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/port_error_negative.phpt b/ext/uri/tests/rfc3986/builder/port_error_negative.phpt index 4cbc0e1c69d7..b42ae8e0ccf5 100644 --- a/ext/uri/tests/rfc3986/builder/port_error_negative.phpt +++ b/ext/uri/tests/rfc3986/builder/port_error_negative.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setPort(-1); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/query_error_special_char.phpt b/ext/uri/tests/rfc3986/builder/query_error_special_char.phpt index ecfced24a44c..2a8c67da48f8 100644 --- a/ext/uri/tests/rfc3986/builder/query_error_special_char.phpt +++ b/ext/uri/tests/rfc3986/builder/query_error_special_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setQuery("#foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/query_error_unicode_char.phpt b/ext/uri/tests/rfc3986/builder/query_error_unicode_char.phpt index 4c212cddd631..04168d773aa0 100644 --- a/ext/uri/tests/rfc3986/builder/query_error_unicode_char.phpt +++ b/ext/uri/tests/rfc3986/builder/query_error_unicode_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setQuery("főő"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/scheme_error_empty.phpt b/ext/uri/tests/rfc3986/builder/scheme_error_empty.phpt index 13594c163363..29d8a25ec4d6 100644 --- a/ext/uri/tests/rfc3986/builder/scheme_error_empty.phpt +++ b/ext/uri/tests/rfc3986/builder/scheme_error_empty.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setScheme(""); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/scheme_error_first_char.phpt b/ext/uri/tests/rfc3986/builder/scheme_error_first_char.phpt index c178a0fa1f1e..e3ad250a2662 100644 --- a/ext/uri/tests/rfc3986/builder/scheme_error_first_char.phpt +++ b/ext/uri/tests/rfc3986/builder/scheme_error_first_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setScheme("1"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/scheme_error_special_char.phpt b/ext/uri/tests/rfc3986/builder/scheme_error_special_char.phpt index 4941db44aa7d..b825291bd50f 100644 --- a/ext/uri/tests/rfc3986/builder/scheme_error_special_char.phpt +++ b/ext/uri/tests/rfc3986/builder/scheme_error_special_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setScheme(":"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/userinfo_error_missing_host.phpt b/ext/uri/tests/rfc3986/builder/userinfo_error_missing_host.phpt index a6919e8ffd0a..67bc29422a8a 100644 --- a/ext/uri/tests/rfc3986/builder/userinfo_error_missing_host.phpt +++ b/ext/uri/tests/rfc3986/builder/userinfo_error_missing_host.phpt @@ -9,7 +9,7 @@ $builder->setUserInfo("user:pass"); try { $builder->build(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/userinfo_error_percent_encoding.phpt b/ext/uri/tests/rfc3986/builder/userinfo_error_percent_encoding.phpt index 0830a57864d7..03493f574638 100644 --- a/ext/uri/tests/rfc3986/builder/userinfo_error_percent_encoding.phpt +++ b/ext/uri/tests/rfc3986/builder/userinfo_error_percent_encoding.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setUserInfo("%3"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/builder/userinfo_error_special_char.phpt b/ext/uri/tests/rfc3986/builder/userinfo_error_special_char.phpt index 9d3fb2544daf..78f3fa8fedea 100644 --- a/ext/uri/tests/rfc3986/builder/userinfo_error_special_char.phpt +++ b/ext/uri/tests/rfc3986/builder/userinfo_error_special_char.phpt @@ -8,7 +8,7 @@ $builder = new Uri\Rfc3986\UriBuilder(); try { $builder->setUserInfo("<>"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt index 2296a797e662..2f88cd444760 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withFragment("#fragment"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt index 5caea7996c5f..702e76d0d72a 100644 --- a/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt +++ b/ext/uri/tests/rfc3986/modification/fragment_error_unicode.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withFragment("ő"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt index be724549926d..544e1c1dc553 100644 --- a/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/host_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withHost("ex#mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/path_error_null_byte.phpt b/ext/uri/tests/rfc3986/modification/path_error_null_byte.phpt index b629ec8fdd54..9e49f23dd6dc 100644 --- a/ext/uri/tests/rfc3986/modification/path_error_null_byte.phpt +++ b/ext/uri/tests/rfc3986/modification/path_error_null_byte.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withPath("/\0foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt index 24863251f943..4f89a4c9fd32 100644 --- a/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/path_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withPath("/[foo]"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt index 1762470ee2a9..4841a1c6a0d5 100644 --- a/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt +++ b/ext/uri/tests/rfc3986/modification/path_error_unicode.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withPath("/ő"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt b/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt index 5ab98a5d449a..dac452f0e38c 100644 --- a/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt +++ b/ext/uri/tests/rfc3986/modification/path_error_without_leading_slash.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withPath("foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/port_error_negative.phpt b/ext/uri/tests/rfc3986/modification/port_error_negative.phpt index 250e01105b5c..02f20b3fb3e0 100644 --- a/ext/uri/tests/rfc3986/modification/port_error_negative.phpt +++ b/ext/uri/tests/rfc3986/modification/port_error_negative.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withPort(-1); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt index 24c7b36c4378..a9c37b4dd1fc 100644 --- a/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/query_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withQuery("#foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt b/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt index 5474792e39dd..a8f9691fc49d 100644 --- a/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt +++ b/ext/uri/tests/rfc3986/modification/query_error_unicode.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withQuery("ő"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt index b737f94bec7f..121366af8bb5 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_error_empty.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withScheme(""); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt index 7b6d179fdc9d..034c6e333f54 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_error_encoded.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withScheme("http%73"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt index beb94baf955c..3859d7312931 100644 --- a/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/scheme_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withScheme("https:"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt b/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt index 2db4f37c2e03..ebe4b7f80316 100644 --- a/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/modification/userinfo_error_reserved.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->withUserInfo("us/r:password"); // us/r:password } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/basic_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/basic_error_multibyte.phpt index cb6007c844aa..932112f7e5d7 100644 --- a/ext/uri/tests/rfc3986/parsing/basic_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/basic_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - basic - multibyte character try { new Uri\Rfc3986\Uri("🐘"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/basic_error_null_byte.phpt b/ext/uri/tests/rfc3986/parsing/basic_error_null_byte.phpt index 91d194e2ff5e..648ace0b39ed 100644 --- a/ext/uri/tests/rfc3986/parsing/basic_error_null_byte.phpt +++ b/ext/uri/tests/rfc3986/parsing/basic_error_null_byte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - basic - URI contains null byte try { new Uri\Rfc3986\Uri("https://exam\0ple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/host_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/host_error_multibyte.phpt index d901d0fdecbd..bde0d40901f3 100644 --- a/ext/uri/tests/rfc3986/parsing/host_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/host_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - host - multibyte character try { new Uri\Rfc3986\Uri("https://exḁmple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/host_error_reserved.phpt b/ext/uri/tests/rfc3986/parsing/host_error_reserved.phpt index 0568a027f5b9..2fc7f05e3100 100644 --- a/ext/uri/tests/rfc3986/parsing/host_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/parsing/host_error_reserved.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - host - reserved character try { new Uri\Rfc3986\Uri("https://ex[a]mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/path_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/path_error_multibyte.phpt index ded528d03082..fb7bd3475f6c 100644 --- a/ext/uri/tests/rfc3986/parsing/path_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/path_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - path - multibyte character try { new Uri\Rfc3986\Uri("https://example.com/fȎȎ"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/path_error_reserved.phpt b/ext/uri/tests/rfc3986/parsing/path_error_reserved.phpt index 2a7efd702569..d075fafe8220 100644 --- a/ext/uri/tests/rfc3986/parsing/path_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/parsing/path_error_reserved.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - path - reserved character try { new Uri\Rfc3986\Uri("https://example.com/fo[o/ba]r/"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/port_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/port_error_multibyte.phpt index 54bcd849e5f3..941f70763ab2 100644 --- a/ext/uri/tests/rfc3986/parsing/port_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/port_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - port - multibyte character try { new Uri\Rfc3986\Uri("https://example.com:Ȏ"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/port_error_negative.phpt b/ext/uri/tests/rfc3986/parsing/port_error_negative.phpt index df29c2767f05..12d130916cf6 100644 --- a/ext/uri/tests/rfc3986/parsing/port_error_negative.phpt +++ b/ext/uri/tests/rfc3986/parsing/port_error_negative.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - port - negative value try { var_dump(new Uri\Rfc3986\Uri("http://example.com:-1")); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/port_error_percent_encoded.phpt b/ext/uri/tests/rfc3986/parsing/port_error_percent_encoded.phpt index e38ad85b5758..9a6bc11f60fe 100644 --- a/ext/uri/tests/rfc3986/parsing/port_error_percent_encoded.phpt +++ b/ext/uri/tests/rfc3986/parsing/port_error_percent_encoded.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - port - percent encoded character try { new Uri\Rfc3986\Uri("https://example.com:%30"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/port_error_user_info_wrong_place.phpt b/ext/uri/tests/rfc3986/parsing/port_error_user_info_wrong_place.phpt index d2632a6f2806..28e6cd6e3711 100644 --- a/ext/uri/tests/rfc3986/parsing/port_error_user_info_wrong_place.phpt +++ b/ext/uri/tests/rfc3986/parsing/port_error_user_info_wrong_place.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - port - user info component is in wrong place try { var_dump(new Uri\Rfc3986\Uri("https://example.com:8080@username:password")); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/scheme_error_empty.phpt b/ext/uri/tests/rfc3986/parsing/scheme_error_empty.phpt index ba686e7fafca..0815dc45b9cf 100644 --- a/ext/uri/tests/rfc3986/parsing/scheme_error_empty.phpt +++ b/ext/uri/tests/rfc3986/parsing/scheme_error_empty.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - scheme - empty try { new Uri\Rfc3986\Uri("://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/scheme_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/scheme_error_multibyte.phpt index f638ca80e0cd..88e2d9cc8099 100644 --- a/ext/uri/tests/rfc3986/parsing/scheme_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/scheme_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - scheme - multibyte characters try { new Uri\Rfc3986\Uri("ƕŢŢƤƨ://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/scheme_error_percent_encoded.phpt b/ext/uri/tests/rfc3986/parsing/scheme_error_percent_encoded.phpt index d4dba6f260ad..42c86422053c 100644 --- a/ext/uri/tests/rfc3986/parsing/scheme_error_percent_encoded.phpt +++ b/ext/uri/tests/rfc3986/parsing/scheme_error_percent_encoded.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - scheme - percent encoded character try { new Uri\Rfc3986\Uri("http%2F://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/scheme_error_reserved.phpt b/ext/uri/tests/rfc3986/parsing/scheme_error_reserved.phpt index 99dfb664ea05..e54084444839 100644 --- a/ext/uri/tests/rfc3986/parsing/scheme_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/parsing/scheme_error_reserved.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - scheme - reserved character try { new Uri\Rfc3986\Uri("http&://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/userinfo_error_extended_ascii.phpt b/ext/uri/tests/rfc3986/parsing/userinfo_error_extended_ascii.phpt index 61ea8ecc3c28..34b4ad3540e2 100644 --- a/ext/uri/tests/rfc3986/parsing/userinfo_error_extended_ascii.phpt +++ b/ext/uri/tests/rfc3986/parsing/userinfo_error_extended_ascii.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - userinfo - extended ASCII character try { new Uri\Rfc3986\Uri("http://úzör@example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/userinfo_error_multibyte.phpt b/ext/uri/tests/rfc3986/parsing/userinfo_error_multibyte.phpt index fbceea77b1cd..098b673e76fa 100644 --- a/ext/uri/tests/rfc3986/parsing/userinfo_error_multibyte.phpt +++ b/ext/uri/tests/rfc3986/parsing/userinfo_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - userinfo - multibyte character try { new Uri\Rfc3986\Uri("http://usĕr:pąss@example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/parsing/userinfo_error_reserved.phpt b/ext/uri/tests/rfc3986/parsing/userinfo_error_reserved.phpt index 3b6caeb7a0ed..c10c660ed894 100644 --- a/ext/uri/tests/rfc3986/parsing/userinfo_error_reserved.phpt +++ b/ext/uri/tests/rfc3986/parsing/userinfo_error_reserved.phpt @@ -6,7 +6,7 @@ Test Uri\Rfc3986\Uri parsing - userinfo - reserved character try { new Uri\Rfc3986\Uri("http://us[er]:pass@example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/rfc3986/reference_resolution/resolve_error_null_byte.phpt b/ext/uri/tests/rfc3986/reference_resolution/resolve_error_null_byte.phpt index 26f55896c1be..86493e63166a 100644 --- a/ext/uri/tests/rfc3986/reference_resolution/resolve_error_null_byte.phpt +++ b/ext/uri/tests/rfc3986/reference_resolution/resolve_error_null_byte.phpt @@ -8,7 +8,7 @@ $uri = Uri\Rfc3986\Uri::parse("https://example.com"); try { $uri->resolve("/f\0o"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_empty.phpt b/ext/uri/tests/whatwg/modification/host_error_empty.phpt index c280140381d8..3b399de64460 100644 --- a/ext/uri/tests/whatwg/modification/host_error_empty.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_empty.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withHost(""); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt index deca314462b8..9e0d1db53ecf 100644 --- a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_opaque1.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("foo://example.com"); try { $url = $url->withHost("ex@mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt index 235960f19b53..a28058f729e5 100644 --- a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special1.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url = $url->withHost("ex@mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt index f465bb85f226..1bea3104c3a6 100644 --- a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special2.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url = $url->withHost("ex:mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special3.phpt b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special3.phpt index f465bb85f226..1bea3104c3a6 100644 --- a/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special3.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_forbidden_host_codepoint_special3.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url = $url->withHost("ex:mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_null_byte.phpt b/ext/uri/tests/whatwg/modification/host_error_null_byte.phpt index b6f501a201aa..5b78bb9fad17 100644 --- a/ext/uri/tests/whatwg/modification/host_error_null_byte.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_null_byte.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withHost("h\0st"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt b/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt index 719a3756a105..71da13e35975 100644 --- a/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt +++ b/ext/uri/tests/whatwg/modification/host_error_unset_existing.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url = $url->withHost(null); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/multiple_error_with_warnings.phpt b/ext/uri/tests/whatwg/modification/multiple_error_with_warnings.phpt index b5dd89446601..7aa2eae4b00e 100644 --- a/ext/uri/tests/whatwg/modification/multiple_error_with_warnings.phpt +++ b/ext/uri/tests/whatwg/modification/multiple_error_with_warnings.phpt @@ -12,7 +12,7 @@ $url = new Uri\WhatWg\Url("https://example.com") try { $url->withScheme("0"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; var_dump($e->errors); } diff --git a/ext/uri/tests/whatwg/modification/port_error_negative.phpt b/ext/uri/tests/whatwg/modification/port_error_negative.phpt index 1c6f447acd1e..90973fe0163f 100644 --- a/ext/uri/tests/whatwg/modification/port_error_negative.phpt +++ b/ext/uri/tests/whatwg/modification/port_error_negative.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withPort(-1); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/port_error_too_large.phpt b/ext/uri/tests/whatwg/modification/port_error_too_large.phpt index 204b3caccc96..29934d8e76bc 100644 --- a/ext/uri/tests/whatwg/modification/port_error_too_large.phpt +++ b/ext/uri/tests/whatwg/modification/port_error_too_large.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withPort(65536); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt b/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt index 0113d4ff8366..8d3f54d35ee8 100644 --- a/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_error_empty.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withScheme(""); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt b/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt index 906a99585ad1..9a0747626e9d 100644 --- a/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_error_encoded.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withScheme("http%73"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt b/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt index 90256bbab1c0..965ab2870ae1 100644 --- a/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_error_invalid.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withScheme("http?"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/modification/scheme_error_null_byte.phpt b/ext/uri/tests/whatwg/modification/scheme_error_null_byte.phpt index 649d318b8973..4e8ce3b60899 100644 --- a/ext/uri/tests/whatwg/modification/scheme_error_null_byte.phpt +++ b/ext/uri/tests/whatwg/modification/scheme_error_null_byte.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->withScheme("sch\0me"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/basic_error_empty.phpt b/ext/uri/tests/whatwg/parsing/basic_error_empty.phpt index 2b7114baa738..eba55502b707 100644 --- a/ext/uri/tests/whatwg/parsing/basic_error_empty.phpt +++ b/ext/uri/tests/whatwg/parsing/basic_error_empty.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - basic - empty string try { new Uri\WhatWg\Url(""); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_Invalid.phpt b/ext/uri/tests/whatwg/parsing/host_error_Invalid.phpt index 8444ee9e3e96..d4f3fbe78a11 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_Invalid.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_Invalid.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - invalid code point try { new Uri\WhatWg\Url("https://ex[a]mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_empty1.phpt b/ext/uri/tests/whatwg/parsing/host_error_empty1.phpt index 92b317078ebb..5089fa8580f7 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_empty1.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_empty1.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - empty try { new Uri\WhatWg\Url("https://"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_empty2.phpt b/ext/uri/tests/whatwg/parsing/host_error_empty2.phpt index 726241674fae..bcd42a7a925c 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_empty2.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_empty2.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - empty try { new Uri\WhatWg\Url("https://user:pass@"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_empty3.phpt b/ext/uri/tests/whatwg/parsing/host_error_empty3.phpt index 90f2738148f4..95b040fe8ec8 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_empty3.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_empty3.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - empty try { new Uri\WhatWg\Url("/"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_ipvfuture.phpt b/ext/uri/tests/whatwg/parsing/host_error_ipvfuture.phpt index 959aa0c4442b..b9305abe16b4 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_ipvfuture.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_ipvfuture.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - IPvFuture try { new Uri\WhatWg\Url("https://[v7.host]"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_error_null_byte.phpt b/ext/uri/tests/whatwg/parsing/host_error_null_byte.phpt index f450d26c4164..21928b9b265b 100644 --- a/ext/uri/tests/whatwg/parsing/host_error_null_byte.phpt +++ b/ext/uri/tests/whatwg/parsing/host_error_null_byte.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - basic - URL contains null byte try { new Uri\WhatWg\Url("https://exam\0ple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/host_success_empty4.phpt b/ext/uri/tests/whatwg/parsing/host_success_empty4.phpt index 25a28a9750c4..760bd1c7ce36 100644 --- a/ext/uri/tests/whatwg/parsing/host_success_empty4.phpt +++ b/ext/uri/tests/whatwg/parsing/host_success_empty4.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - host - empty try { new Uri\WhatWg\Url("///"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/path_error_relative_reference.phpt b/ext/uri/tests/whatwg/parsing/path_error_relative_reference.phpt index 8e6c6fd3842e..51d41e569874 100644 --- a/ext/uri/tests/whatwg/parsing/path_error_relative_reference.phpt +++ b/ext/uri/tests/whatwg/parsing/path_error_relative_reference.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - path - relative reference try { new Uri\WhatWg\Url("foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/path_error_relative_reference_absolute.phpt b/ext/uri/tests/whatwg/parsing/path_error_relative_reference_absolute.phpt index 01d549210d9f..22a790691492 100644 --- a/ext/uri/tests/whatwg/parsing/path_error_relative_reference_absolute.phpt +++ b/ext/uri/tests/whatwg/parsing/path_error_relative_reference_absolute.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - path - relative reference try { new Uri\WhatWg\Url("/foo"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/path_error_relative_reference_only_query_fragment.phpt b/ext/uri/tests/whatwg/parsing/path_error_relative_reference_only_query_fragment.phpt index 9c6a7a7906b2..2a19cc3ce4c0 100644 --- a/ext/uri/tests/whatwg/parsing/path_error_relative_reference_only_query_fragment.phpt +++ b/ext/uri/tests/whatwg/parsing/path_error_relative_reference_only_query_fragment.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - path - relative reference try { new Uri\WhatWg\Url("?query#fragment"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/port_error_multibyte.phpt b/ext/uri/tests/whatwg/parsing/port_error_multibyte.phpt index 8175f2ca992a..01a5e2c5e2f4 100644 --- a/ext/uri/tests/whatwg/parsing/port_error_multibyte.phpt +++ b/ext/uri/tests/whatwg/parsing/port_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - port - multibyte try { new Uri\WhatWg\Url("https://example.com:Ȏ"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/port_error_negative.phpt b/ext/uri/tests/whatwg/parsing/port_error_negative.phpt index bb23476db57c..30b23b3aaa19 100644 --- a/ext/uri/tests/whatwg/parsing/port_error_negative.phpt +++ b/ext/uri/tests/whatwg/parsing/port_error_negative.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - port - negative value try { new Uri\WhatWg\Url("http://example.com:-1"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/port_error_percent_encoded.phpt b/ext/uri/tests/whatwg/parsing/port_error_percent_encoded.phpt index 874211ccb1cf..315257fe13cf 100644 --- a/ext/uri/tests/whatwg/parsing/port_error_percent_encoded.phpt +++ b/ext/uri/tests/whatwg/parsing/port_error_percent_encoded.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - port - percent encoded character try { new Uri\WhatWg\Url("https://example.com:%30"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/port_error_user_info_wrong_place.phpt b/ext/uri/tests/whatwg/parsing/port_error_user_info_wrong_place.phpt index f0f79670230d..8eaf9b72e19c 100644 --- a/ext/uri/tests/whatwg/parsing/port_error_user_info_wrong_place.phpt +++ b/ext/uri/tests/whatwg/parsing/port_error_user_info_wrong_place.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - port - user info component is in wrong place try { var_dump(new Uri\WhatWg\Url("https://example.com:8080@username:password")); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_empty.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_empty.phpt index 023c1d3fab9d..f6aa7cb3e878 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_empty.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_empty.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - empty try { new Uri\WhatWg\Url("://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_invalid.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_invalid.phpt index 9c69b08161ef..7ba59cb0cf6f 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_invalid.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_invalid.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - invalid character try { new Uri\WhatWg\Url("http&://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_multibyte.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_multibyte.phpt index 0d6601e718ea..aad5e3b963da 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_multibyte.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_multibyte.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - multibyte codepoint try { new Uri\WhatWg\Url("ƕŢŢƤƨ://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_null_byte.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_null_byte.phpt index 5674c1f33093..4f98412718b1 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_null_byte.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_null_byte.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - null byte try { new Uri\WhatWg\Url("ht\0tp://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_only1.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_only1.phpt index 92832f65a019..311ca4145fa6 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_only1.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_only1.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - only scheme try { new Uri\WhatWg\Url("http:"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_only2.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_only2.phpt index 22ab6fc53515..00cac5fcf3bf 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_only2.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_only2.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - only scheme try { new Uri\WhatWg\Url("http:/"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_percent_encoded.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_percent_encoded.phpt index a0324edd3701..a1a3e2f2fd2b 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_percent_encoded.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_percent_encoded.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - percent encoded character try { new Uri\WhatWg\Url("http%2F://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/parsing/scheme_error_special.phpt b/ext/uri/tests/whatwg/parsing/scheme_error_special.phpt index 9966ad6248e5..485a024a4a17 100644 --- a/ext/uri/tests/whatwg/parsing/scheme_error_special.phpt +++ b/ext/uri/tests/whatwg/parsing/scheme_error_special.phpt @@ -6,7 +6,7 @@ Test Uri\WhatWg\Url parsing - scheme - invalid character try { new Uri\WhatWg\Url("hÁttp://example.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/uri/tests/whatwg/reference_resolution/resolve_error_host_null_byte.phpt b/ext/uri/tests/whatwg/reference_resolution/resolve_error_host_null_byte.phpt index 15b2a141f2fd..831e2160bced 100644 --- a/ext/uri/tests/whatwg/reference_resolution/resolve_error_host_null_byte.phpt +++ b/ext/uri/tests/whatwg/reference_resolution/resolve_error_host_null_byte.phpt @@ -8,7 +8,7 @@ $url = Uri\WhatWg\Url::parse("https://example.com"); try { $url->resolve("https://ex\0mple.com"); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/xml/tests/bug78563.phpt b/ext/xml/tests/bug78563.phpt index dc7d5fe02dc2..94dec81e792c 100644 --- a/ext/xml/tests/bug78563.phpt +++ b/ext/xml/tests/bug78563.phpt @@ -9,7 +9,7 @@ try { $parser = xml_parser_create(); clone $parser; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/xml/tests/gh15868.phpt b/ext/xml/tests/gh15868.phpt index 17ed80558d78..0e3b866574f6 100644 --- a/ext/xml/tests/gh15868.phpt +++ b/ext/xml/tests/gh15868.phpt @@ -14,7 +14,7 @@ xml_set_element_handler($parser, try { xml_parse_into_struct($parser, "", $values, $tags); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $parser = xml_parser_create(); @@ -27,7 +27,7 @@ xml_set_element_handler($parser, try { xml_parse_into_struct($parser, "", $values, $tags); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $parser = xml_parser_create(); @@ -37,10 +37,10 @@ xml_set_character_data_handler($parser, function() { try { xml_parse_into_struct($parser, "", $values, $tags); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -stop 1 -stop 2 -stop 3 +Error: stop 1 +Error: stop 2 +Error: stop 3 diff --git a/ext/xml/tests/xml_parser_get_option_variation4.phpt b/ext/xml/tests/xml_parser_get_option_variation4.phpt index f6d858a7e9c0..4afc09c41219 100644 --- a/ext/xml/tests/xml_parser_get_option_variation4.phpt +++ b/ext/xml/tests/xml_parser_get_option_variation4.phpt @@ -10,9 +10,9 @@ $xmlParser = xml_parser_create(); try { xml_parser_get_option ($xmlParser, 42); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -xml_parser_get_option(): Argument #2 ($option) must be a XML_OPTION_* constant +ValueError: xml_parser_get_option(): Argument #2 ($option) must be a XML_OPTION_* constant diff --git a/ext/xml/tests/xml_parser_set_option_errors.phpt b/ext/xml/tests/xml_parser_set_option_errors.phpt index fbb733423d77..9e722162c3bc 100644 --- a/ext/xml/tests/xml_parser_set_option_errors.phpt +++ b/ext/xml/tests/xml_parser_set_option_errors.phpt @@ -11,24 +11,24 @@ echo "Case folding\n"; try { xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, []); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { xml_parser_set_option($xmlParser, XML_OPTION_CASE_FOLDING, new stdClass()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Skip Whitespace\n"; try { xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, []); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { xml_parser_set_option($xmlParser, XML_OPTION_SKIP_WHITE, new stdClass()); } catch (TypeError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo "Tag Start\n"; @@ -42,17 +42,17 @@ echo "Encodings\n"; try { xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, 'Invalid Encoding'); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, []); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { xml_parser_set_option($xmlParser, XML_OPTION_TARGET_ENCODING, new stdClass()); } catch (Error $exception) { - echo $exception::class, ': ', $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> @@ -77,12 +77,12 @@ Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|in Warning: Object of class stdClass could not be converted to int in %s on line %d Encodings -xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding +ValueError: xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|int|bool, array given in %s on line %d Warning: Array to string conversion in %s on line %d -xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding +ValueError: xml_parser_set_option(): Argument #3 ($value) is not a supported target encoding Warning: xml_parser_set_option(): Argument #3 ($value) must be of type string|int|bool, stdClass given in %s on line %d Error: Object of class stdClass could not be converted to string diff --git a/ext/xml/tests/xml_parser_set_option_nonexistent_option.phpt b/ext/xml/tests/xml_parser_set_option_nonexistent_option.phpt index d19dc9e69d5c..3bed7aefd7f6 100644 --- a/ext/xml/tests/xml_parser_set_option_nonexistent_option.phpt +++ b/ext/xml/tests/xml_parser_set_option_nonexistent_option.phpt @@ -10,9 +10,9 @@ $xmlParser = xml_parser_create(); try { xml_parser_set_option($xmlParser, 42, 1); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -xml_parser_set_option(): Argument #2 ($option) must be a XML_OPTION_* constant +ValueError: xml_parser_set_option(): Argument #2 ($option) must be a XML_OPTION_* constant diff --git a/ext/xmlreader/tests/001.phpt b/ext/xmlreader/tests/001.phpt index ab84cd0b3a22..e5fc8d976bf1 100644 --- a/ext/xmlreader/tests/001.phpt +++ b/ext/xmlreader/tests/001.phpt @@ -21,11 +21,11 @@ $reader = new XMLReader(); try { $reader->XML($xmlstring); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- books books -XMLReader::XML(): Argument #1 ($source) must not be empty +ValueError: XMLReader::XML(): Argument #1 ($source) must not be empty diff --git a/ext/xmlreader/tests/002.phpt b/ext/xmlreader/tests/002.phpt index a0f55a2af3b4..c68860ba1305 100644 --- a/ext/xmlreader/tests/002.phpt +++ b/ext/xmlreader/tests/002.phpt @@ -13,7 +13,7 @@ $reader = new XMLReader(); try { $reader->open(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader = new XMLReader(); @@ -36,6 +36,6 @@ unlink($filename); ?> --EXPECT-- -XMLReader::open(): Argument #1 ($uri) must not be empty +ValueError: XMLReader::open(): Argument #1 ($uri) must not be empty books books diff --git a/ext/xmlreader/tests/003-get-errors.phpt b/ext/xmlreader/tests/003-get-errors.phpt index 6cb2f20b8d5f..240655e3c96c 100644 --- a/ext/xmlreader/tests/003-get-errors.phpt +++ b/ext/xmlreader/tests/003-get-errors.phpt @@ -34,7 +34,7 @@ while ($reader->read()) { try { $reader->getAttribute(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Ensure that node pointer has not changed position @@ -69,7 +69,7 @@ unlink(__DIR__.'/003-get-errors.xml'); book bool(true) num: 1 -XMLReader::getAttribute(): Argument #1 ($name) must not be empty +ValueError: XMLReader::getAttribute(): Argument #1 ($name) must not be empty num: 1 NULL num: 1 diff --git a/ext/xmlreader/tests/003-move-errors.phpt b/ext/xmlreader/tests/003-move-errors.phpt index be36d252c453..03eb7d1e1f67 100644 --- a/ext/xmlreader/tests/003-move-errors.phpt +++ b/ext/xmlreader/tests/003-move-errors.phpt @@ -34,7 +34,7 @@ while ($reader->read()) { try { $reader->moveToAttribute(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Ensure that node pointer has not changed position @@ -68,7 +68,7 @@ unlink(__DIR__.'/003-move-errors.xml'); book bool(true) num: 1 -XMLReader::moveToAttribute(): Argument #1 ($name) must not be empty +ValueError: XMLReader::moveToAttribute(): Argument #1 ($name) must not be empty num: 1 bool(false) num: 1 diff --git a/ext/xmlreader/tests/003.phpt b/ext/xmlreader/tests/003.phpt index a581d0dea02d..9611b677d087 100644 --- a/ext/xmlreader/tests/003.phpt +++ b/ext/xmlreader/tests/003.phpt @@ -71,7 +71,7 @@ while ($reader->read()) { try { $reader->moveToAttribute(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } @@ -88,4 +88,4 @@ num: 1 idx: 2 bool(false) bool(false) -XMLReader::moveToAttribute(): Argument #1 ($name) must not be empty +ValueError: XMLReader::moveToAttribute(): Argument #1 ($name) must not be empty diff --git a/ext/xmlreader/tests/007.phpt b/ext/xmlreader/tests/007.phpt index e9705cc5af66..47afd5877c77 100644 --- a/ext/xmlreader/tests/007.phpt +++ b/ext/xmlreader/tests/007.phpt @@ -45,7 +45,7 @@ $reader->XML($xmlstring); try { $reader->setRelaxNGSchema(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); @@ -53,4 +53,4 @@ $reader->close(); --EXPECT-- file relaxNG: ok string relaxNG: ok -XMLReader::setRelaxNGSchema(): Argument #1 ($filename) must not be empty +ValueError: XMLReader::setRelaxNGSchema(): Argument #1 ($filename) must not be empty diff --git a/ext/xmlreader/tests/014.phpt b/ext/xmlreader/tests/014.phpt index 26886ae26e6e..21b62187dfd1 100644 --- a/ext/xmlreader/tests/014.phpt +++ b/ext/xmlreader/tests/014.phpt @@ -27,20 +27,20 @@ while ($reader->read()) { try { $reader->value = 'movie1'; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Try to set the value of the first "num" attribute from "1" to "num attribute 1" $attr = $reader->moveToFirstAttribute(); try { $reader->value = 'num attribute 1'; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } // Try to set the name of the first attribute from "num" to "number" try { $reader->name = 'number'; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } @@ -54,6 +54,6 @@ $reader->close(); unlink(__DIR__.'/_014.xml'); ?> --EXPECT-- -Cannot modify readonly property XMLReader::$value -Cannot modify readonly property XMLReader::$value -Cannot modify readonly property XMLReader::$name +Error: Cannot modify readonly property XMLReader::$value +Error: Cannot modify readonly property XMLReader::$value +Error: Cannot modify readonly property XMLReader::$name diff --git a/ext/xmlreader/tests/015-get-errors.phpt b/ext/xmlreader/tests/015-get-errors.phpt index 3cf6134df205..d0a62c76dd55 100644 --- a/ext/xmlreader/tests/015-get-errors.phpt +++ b/ext/xmlreader/tests/015-get-errors.phpt @@ -29,7 +29,7 @@ while ($reader->read()) { try { $attr = $reader->getAttributeNs('idx', null); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } echo $reader->name . ": "; @@ -47,5 +47,5 @@ unlink(__DIR__.'/015-get-errors.xml'); ?> --EXPECTF-- Deprecated: XMLReader::getAttributeNs(): Passing null to parameter #2 ($namespace) of type string is deprecated in %s on line %d -XMLReader::getAttributeNs(): Argument #2 ($namespace) must not be empty +ValueError: XMLReader::getAttributeNs(): Argument #2 ($namespace) must not be empty ns1:num: 1 diff --git a/ext/xmlreader/tests/015-move-errors.phpt b/ext/xmlreader/tests/015-move-errors.phpt index d885c5a6fe97..7b8ed8b0bd49 100644 --- a/ext/xmlreader/tests/015-move-errors.phpt +++ b/ext/xmlreader/tests/015-move-errors.phpt @@ -27,7 +27,7 @@ while ($reader->read()) { try { $reader->moveToAttributeNs('idx', null); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } } } @@ -42,4 +42,4 @@ unlink(__DIR__.'/015-move-errors.xml'); ?> --EXPECTF-- Deprecated: XMLReader::moveToAttributeNs(): Passing null to parameter #2 ($namespace) of type string is deprecated in %s on line %d -XMLReader::moveToAttributeNs(): Argument #2 ($namespace) must not be empty +ValueError: XMLReader::moveToAttributeNs(): Argument #2 ($namespace) must not be empty diff --git a/ext/xmlreader/tests/bug51936.phpt b/ext/xmlreader/tests/bug51936.phpt index 6014c5550a62..6640f35d9930 100644 --- a/ext/xmlreader/tests/bug51936.phpt +++ b/ext/xmlreader/tests/bug51936.phpt @@ -14,7 +14,7 @@ try { $xmlreader2 = clone $xmlreader; $xmlreader2->next(); } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/ext/xmlreader/tests/bug73246.phpt b/ext/xmlreader/tests/bug73246.phpt index f20c16045386..ee91045941c1 100644 --- a/ext/xmlreader/tests/bug73246.phpt +++ b/ext/xmlreader/tests/bug73246.phpt @@ -8,20 +8,20 @@ $reader = new XMLReader(); try { $reader->open(__FILE__, "UTF\0-8"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $reader->XML('', "UTF\0-8"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { XMLReader::fromStream(fopen('php://memory', 'r'), encoding: "UTF\0-8"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -XMLReader::open(): Argument #2 ($encoding) must not contain any null bytes -XMLReader::XML(): Argument #2 ($encoding) must not contain any null bytes -XMLReader::fromStream(): Argument #2 ($encoding) must not contain any null bytes +ValueError: XMLReader::open(): Argument #2 ($encoding) must not contain any null bytes +ValueError: XMLReader::XML(): Argument #2 ($encoding) must not contain any null bytes +ValueError: XMLReader::fromStream(): Argument #2 ($encoding) must not contain any null bytes diff --git a/ext/xmlreader/tests/bug81521.phpt b/ext/xmlreader/tests/bug81521.phpt index 2789a16e21bb..be2c8448ed00 100644 --- a/ext/xmlreader/tests/bug81521.phpt +++ b/ext/xmlreader/tests/bug81521.phpt @@ -8,14 +8,14 @@ $reader = new XMLReader(); try { var_dump($reader->setParserProperty(XMLReader::LOADDTD, 1)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { var_dump($reader->getParserProperty(XMLReader::LOADDTD)); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot access parser properties before loading data -Cannot access parser properties before loading data +Error: Cannot access parser properties before loading data +Error: Cannot access parser properties before loading data diff --git a/ext/xmlreader/tests/expand_error.phpt b/ext/xmlreader/tests/expand_error.phpt index 1eba483733a2..909a4062cec3 100644 --- a/ext/xmlreader/tests/expand_error.phpt +++ b/ext/xmlreader/tests/expand_error.phpt @@ -18,7 +18,7 @@ $reader = new XMLReader(); try { $reader->expand(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); @@ -29,7 +29,7 @@ var_dump($reader->expand()); $reader->close(); ?> --EXPECTF-- -Data must be loaded before expanding +Error: Data must be loaded before expanding Warning: XMLReader::expand(): An Error Occurred while expanding in %s on line %d bool(false) diff --git a/ext/xmlreader/tests/fromStream_custom_constructor.phpt b/ext/xmlreader/tests/fromStream_custom_constructor.phpt index 3ec370274ad3..26ec2ad8e722 100644 --- a/ext/xmlreader/tests/fromStream_custom_constructor.phpt +++ b/ext/xmlreader/tests/fromStream_custom_constructor.phpt @@ -21,7 +21,7 @@ $reader = CustomXMLReader::fromStream($h, encoding: "UTF-8"); try { var_dump($reader); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($reader->read()); var_dump($reader->nodeType); @@ -60,6 +60,6 @@ object(CustomXMLReader)#%d (14) { ["xmlLang"]=> string(0) "" } -Failed to read property because no XML data has been read yet +Error: Failed to read property because no XML data has been read yet bool(true) int(1) diff --git a/ext/xmlreader/tests/fromStream_custom_constructor_error.phpt b/ext/xmlreader/tests/fromStream_custom_constructor_error.phpt index 60e65fa92117..e5d04efaaeef 100644 --- a/ext/xmlreader/tests/fromStream_custom_constructor_error.phpt +++ b/ext/xmlreader/tests/fromStream_custom_constructor_error.phpt @@ -17,10 +17,10 @@ fseek($h, 0); try { CustomXMLReader::fromStream($h, encoding: "UTF-8"); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($h); ?> --EXPECT-- -nope +Error: nope diff --git a/ext/xmlreader/tests/fromString_custom_constructor.phpt b/ext/xmlreader/tests/fromString_custom_constructor.phpt index 4299544613d4..6de6c01e44c7 100644 --- a/ext/xmlreader/tests/fromString_custom_constructor.phpt +++ b/ext/xmlreader/tests/fromString_custom_constructor.phpt @@ -17,7 +17,7 @@ $reader = CustomXMLReader::fromString(""); try { var_dump($reader); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($reader->read()); var_dump($reader->nodeType); @@ -54,6 +54,6 @@ object(CustomXMLReader)#%d (14) { ["xmlLang"]=> string(0) "" } -Failed to read property because no XML data has been read yet +Error: Failed to read property because no XML data has been read yet bool(true) int(1) diff --git a/ext/xmlreader/tests/fromString_custom_constructor_error.phpt b/ext/xmlreader/tests/fromString_custom_constructor_error.phpt index 9bcffddba70d..0db74a843732 100644 --- a/ext/xmlreader/tests/fromString_custom_constructor_error.phpt +++ b/ext/xmlreader/tests/fromString_custom_constructor_error.phpt @@ -13,8 +13,8 @@ class CustomXMLReader extends XMLReader { try { CustomXMLReader::fromString(""); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -nope +Error: nope diff --git a/ext/xmlreader/tests/fromUri_custom_constructor_error.phpt b/ext/xmlreader/tests/fromUri_custom_constructor_error.phpt index ad36c1e0c22f..9aa7ffa02d99 100644 --- a/ext/xmlreader/tests/fromUri_custom_constructor_error.phpt +++ b/ext/xmlreader/tests/fromUri_custom_constructor_error.phpt @@ -13,7 +13,7 @@ class CustomXMLReader extends XMLReader { try { CustomXMLReader::fromUri("nonexistent"); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $filename = __DIR__ . '/_fromUri_custom_constructor_error.xml'; @@ -24,12 +24,12 @@ file_put_contents($filename, $xmlstring); try { CustomXMLReader::fromUri($filename); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unable to open source data -nope +Error: Unable to open source data +Error: nope --CLEAN-- open(__FILE__, "does not exist"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $h = fopen("php://memory", "w+"); try { XMLReader::fromStream($h, encoding: "does not exist"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } fclose($h); try { $reader->XML('', "does not exist"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -XMLReader::open(): Argument #2 ($encoding) must be a valid character encoding -XMLReader::fromStream(): Argument #2 ($encoding) must be a valid character encoding -XMLReader::XML(): Argument #2 ($encoding) must be a valid character encoding +ValueError: XMLReader::open(): Argument #2 ($encoding) must be a valid character encoding +ValueError: XMLReader::fromStream(): Argument #2 ($encoding) must be a valid character encoding +ValueError: XMLReader::XML(): Argument #2 ($encoding) must be a valid character encoding diff --git a/ext/xmlreader/tests/next_basic.phpt b/ext/xmlreader/tests/next_basic.phpt index 0cf907bcd4eb..1ece18df6540 100644 --- a/ext/xmlreader/tests/next_basic.phpt +++ b/ext/xmlreader/tests/next_basic.phpt @@ -13,13 +13,13 @@ $reader = new XMLReader(); try { $reader->read(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $reader->next(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); @@ -40,8 +40,8 @@ $reader->close(); ?> --EXPECT-- -Data must be loaded before reading -Data must be loaded before reading +Error: Data must be loaded before reading +Error: Data must be loaded before reading node1 bool(true) node3 diff --git a/ext/xmlreader/tests/setParserProperty_error.phpt b/ext/xmlreader/tests/setParserProperty_error.phpt index 292745751e7f..e631ec4787a7 100644 --- a/ext/xmlreader/tests/setParserProperty_error.phpt +++ b/ext/xmlreader/tests/setParserProperty_error.phpt @@ -13,9 +13,9 @@ $reader->XML($xml); try { $reader->setParserProperty(-1, true); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); ?> --EXPECT-- -XMLReader::setParserProperty(): Argument #1 ($property) must be a valid parser property +ValueError: XMLReader::setParserProperty(): Argument #1 ($property) must be a valid parser property diff --git a/ext/xmlreader/tests/setSchema_error.phpt b/ext/xmlreader/tests/setSchema_error.phpt index a586c38f5532..8e4b9cbff839 100644 --- a/ext/xmlreader/tests/setSchema_error.phpt +++ b/ext/xmlreader/tests/setSchema_error.phpt @@ -9,7 +9,7 @@ $reader = new XMLReader(); try { $reader->setSchema(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); @@ -17,7 +17,7 @@ $reader = new XMLReader(); try { $reader->setSchema('schema-missing-file.xsd'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader->close(); @@ -25,7 +25,7 @@ $reader = new XMLReader(); try { $reader->setSchema('schema-empty.xsd'); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } $reader = new XMLReader(); @@ -37,7 +37,7 @@ var_dump(@$reader->setSchema('schema-bad.xsd')); $reader->close(); ?> --EXPECT-- -XMLReader::setSchema(): Argument #1 ($filename) must not be empty -Schema must be set prior to reading -Schema must be set prior to reading +ValueError: XMLReader::setSchema(): Argument #1 ($filename) must not be empty +Error: Schema must be set prior to reading +Error: Schema must be set prior to reading bool(false) diff --git a/ext/xmlreader/tests/virtual_properties3.phpt b/ext/xmlreader/tests/virtual_properties3.phpt index ad016c4db764..13607f5fb724 100644 --- a/ext/xmlreader/tests/virtual_properties3.phpt +++ b/ext/xmlreader/tests/virtual_properties3.phpt @@ -15,31 +15,31 @@ $reader = new MyXMLReader(); try { unset($reader->attributeCount); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($reader->baseURI); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($reader->depth); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($reader->hasAttributes); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unset($reader->hasValue); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unset($reader->x); @@ -47,9 +47,9 @@ var_dump(isset($reader->x)); ?> --EXPECT-- -Cannot unset MyXMLReader::$attributeCount -Cannot unset MyXMLReader::$baseURI -Cannot unset MyXMLReader::$depth -Cannot unset MyXMLReader::$hasAttributes -Cannot unset MyXMLReader::$hasValue +Error: Cannot unset MyXMLReader::$attributeCount +Error: Cannot unset MyXMLReader::$baseURI +Error: Cannot unset MyXMLReader::$depth +Error: Cannot unset MyXMLReader::$hasAttributes +Error: Cannot unset MyXMLReader::$hasValue bool(false) diff --git a/ext/xmlwriter/tests/010.phpt b/ext/xmlwriter/tests/010.phpt index 29d7d6fa7cee..1e27e68c1c07 100644 --- a/ext/xmlwriter/tests/010.phpt +++ b/ext/xmlwriter/tests/010.phpt @@ -16,7 +16,7 @@ var_dump(xmlwriter_end_attribute($xw)); try { xmlwriter_start_attribute($xw, "-1"); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(xmlwriter_end_attribute($xw)); @@ -24,7 +24,7 @@ var_dump(xmlwriter_end_attribute($xw)); try { xmlwriter_start_attribute($xw, "\""); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump(xmlwriter_end_attribute($xw)); @@ -45,9 +45,9 @@ echo "Done\n"; bool(true) bool(true) bool(true) -xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, "-1" given +ValueError: xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, "-1" given bool(false) -xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, """ given +ValueError: xmlwriter_start_attribute(): Argument #2 ($name) must be a valid attribute name, """ given bool(false) bool(true) string(14) "" diff --git a/ext/xmlwriter/tests/xmlwriter_open_uri_error_001.phpt b/ext/xmlwriter/tests/xmlwriter_open_uri_error_001.phpt index 3b136a9be2c8..35cc60d90e58 100644 --- a/ext/xmlwriter/tests/xmlwriter_open_uri_error_001.phpt +++ b/ext/xmlwriter/tests/xmlwriter_open_uri_error_001.phpt @@ -7,7 +7,7 @@ xmlwriter try { xmlwriter_open_uri(''); } catch (ValueError $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --CREDITS-- @@ -15,4 +15,4 @@ Koen Kuipers koenk82@gmail.com Theo van der Zee #Test Fest Utrecht 09-05-2009 --EXPECT-- -xmlwriter_open_uri(): Argument #1 ($uri) must not be empty +ValueError: xmlwriter_open_uri(): Argument #1 ($uri) must not be empty diff --git a/ext/xmlwriter/tests/xmlwriter_toMemory_custom_constructor_error.phpt b/ext/xmlwriter/tests/xmlwriter_toMemory_custom_constructor_error.phpt index 3a87d963c9d6..935c4d4b481e 100644 --- a/ext/xmlwriter/tests/xmlwriter_toMemory_custom_constructor_error.phpt +++ b/ext/xmlwriter/tests/xmlwriter_toMemory_custom_constructor_error.phpt @@ -14,9 +14,9 @@ class CustomXMLWriter extends XMLWriter { try { CustomXMLWriter::toMemory(); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -nope +Error: nope diff --git a/ext/xmlwriter/tests/xmlwriter_toStream_custom_constructor_error.phpt b/ext/xmlwriter/tests/xmlwriter_toStream_custom_constructor_error.phpt index 636d8ffbbc01..f3f0b6856354 100644 --- a/ext/xmlwriter/tests/xmlwriter_toStream_custom_constructor_error.phpt +++ b/ext/xmlwriter/tests/xmlwriter_toStream_custom_constructor_error.phpt @@ -16,9 +16,9 @@ $h = fopen("php://output", "w"); try { CustomXMLWriter::toStream($h); } catch (Throwable $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -nope +Error: nope diff --git a/ext/xmlwriter/tests/xmlwriter_toStream_open_invalidated_stream.phpt b/ext/xmlwriter/tests/xmlwriter_toStream_open_invalidated_stream.phpt index b6c6733bb7f8..98243ba344c2 100644 --- a/ext/xmlwriter/tests/xmlwriter_toStream_open_invalidated_stream.phpt +++ b/ext/xmlwriter/tests/xmlwriter_toStream_open_invalidated_stream.phpt @@ -11,9 +11,9 @@ fclose($h); try { XMLWriter::toStream($h); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -XMLWriter::toStream(): supplied resource is not a valid stream resource +TypeError: XMLWriter::toStream(): supplied resource is not a valid stream resource diff --git a/ext/zend_test/tests/gh13970.phpt b/ext/zend_test/tests/gh13970.phpt index f6b68f897023..bdf6d0891fc7 100644 --- a/ext/zend_test/tests/gh13970.phpt +++ b/ext/zend_test/tests/gh13970.phpt @@ -15,8 +15,8 @@ $reflection = new ReflectionFunction('test'); try { var_dump($reflection->getAttributes()[0]->newInstance()); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Attribute::__construct(): Argument #1 ($flags) must be of type int, ZendTestUnitEnum given +Error: Attribute::__construct(): Argument #1 ($flags) must be of type int, ZendTestUnitEnum given diff --git a/ext/zend_test/tests/gh14741.phpt b/ext/zend_test/tests/gh14741.phpt index 389692f3de2b..c9b064d3207c 100644 --- a/ext/zend_test/tests/gh14741.phpt +++ b/ext/zend_test/tests/gh14741.phpt @@ -9,9 +9,9 @@ $it = $subject->getIterator(); try { clone $it; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Trying to clone an uncloneable object of class InternalIterator +Error: Trying to clone an uncloneable object of class InternalIterator TraversableTest::drop diff --git a/ext/zend_test/tests/gh16266.phpt b/ext/zend_test/tests/gh16266.phpt index 44cb7ef807c1..ed755515d7f0 100644 --- a/ext/zend_test/tests/gh16266.phpt +++ b/ext/zend_test/tests/gh16266.phpt @@ -8,14 +8,14 @@ try { $o = new _ZendTestClass(); $o->test('a', 'b', c: 'c'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { _ZendTestClass::test('a', 'b', c: 'c'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unknown named parameter $c -Unknown named parameter $c +Error: Unknown named parameter $c +Error: Unknown named parameter $c diff --git a/ext/zend_test/tests/gh17899.phpt b/ext/zend_test/tests/gh17899.phpt index 58f445a3b7bf..8d8ac963227c 100644 --- a/ext/zend_test/tests/gh17899.phpt +++ b/ext/zend_test/tests/gh17899.phpt @@ -32,4 +32,3 @@ Stack trace: thrown in on line %d - diff --git a/ext/zend_test/tests/gh19720.phpt b/ext/zend_test/tests/gh19720.phpt index 627444c4793a..fabdcaf70512 100644 --- a/ext/zend_test/tests/gh19720.phpt +++ b/ext/zend_test/tests/gh19720.phpt @@ -15,8 +15,8 @@ set_error_handler(function ($_, $errstr) { try { var_dump(Test::MyConst); } catch (Exception $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Constant ZEND_TEST_DEPRECATED is deprecated +Exception: Constant ZEND_TEST_DEPRECATED is deprecated diff --git a/ext/zend_test/tests/gh22169.phpt b/ext/zend_test/tests/gh22169.phpt index 5ed2ab22fa21..2511a36f0456 100644 --- a/ext/zend_test/tests/gh22169.phpt +++ b/ext/zend_test/tests/gh22169.phpt @@ -19,4 +19,3 @@ var_dump(_ZendTestClass::$escapeInterpolated); string(44) "424547494e200a0d090b1b0c5c242241414120454e44" string(43) "BEGIN \n\r\t\v\e\f\\\\$\"\101\x41\u{41} END" string(14) "begin $ \$ end" - diff --git a/ext/zend_test/tests/internal_dnf_arguments.phpt b/ext/zend_test/tests/internal_dnf_arguments.phpt index eb6f5fb514f0..47f0aba19d1d 100644 --- a/ext/zend_test/tests/internal_dnf_arguments.phpt +++ b/ext/zend_test/tests/internal_dnf_arguments.phpt @@ -15,7 +15,7 @@ var_dump((string)$paramType); try { zend_test_internal_dnf_arguments(new stdClass); } catch (\Throwable $err) { - echo $err->getMessage(), "\n"; + echo $err::class, ': ', $err->getMessage(), "\n"; } $obj = new \ArrayIterator([]); @@ -26,7 +26,7 @@ var_dump($result); --EXPECT-- string(32) "Iterator|(Traversable&Countable)" string(32) "Iterator|(Traversable&Countable)" -zend_test_internal_dnf_arguments(): Argument #1 ($arg) must be of type Iterator|(Traversable&Countable), stdClass given +TypeError: zend_test_internal_dnf_arguments(): Argument #1 ($arg) must be of type Iterator|(Traversable&Countable), stdClass given object(ArrayIterator)#5 (1) { ["storage":"ArrayIterator":private]=> array(0) { diff --git a/ext/zend_test/tests/observer_bug81430_1.phpt b/ext/zend_test/tests/observer_bug81430_1.phpt index aedfc09ed249..5754fa00f51a 100644 --- a/ext/zend_test/tests/observer_bug81430_1.phpt +++ b/ext/zend_test/tests/observer_bug81430_1.phpt @@ -38,4 +38,4 @@ call_user_func([$r->getAttributes(A::class)[0], 'newInstance']); - \ No newline at end of file + diff --git a/ext/zend_test/tests/observer_error_04.phpt b/ext/zend_test/tests/observer_error_04.phpt index 2a45bfe78c48..dc1955606575 100644 --- a/ext/zend_test/tests/observer_error_04.phpt +++ b/ext/zend_test/tests/observer_error_04.phpt @@ -25,7 +25,7 @@ function main() try { main(); } catch (SoapFault $e) { - echo $e->getMessage() . PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo 'Done.' . PHP_EOL; @@ -45,7 +45,7 @@ echo 'Done.' . PHP_EOL; - +SoapFault: diff --git a/ext/zend_test/tests/observer_preload.phpt b/ext/zend_test/tests/observer_preload.phpt index 042c9e088e53..731cc2efa798 100644 --- a/ext/zend_test/tests/observer_preload.phpt +++ b/ext/zend_test/tests/observer_preload.phpt @@ -43,4 +43,4 @@ echo 'Done' . PHP_EOL; Done - \ No newline at end of file + diff --git a/ext/zend_test/tests/zend_forbid_dynamic_call.phpt b/ext/zend_test/tests/zend_forbid_dynamic_call.phpt index 77d8649f5322..0e8a8d170092 100644 --- a/ext/zend_test/tests/zend_forbid_dynamic_call.phpt +++ b/ext/zend_test/tests/zend_forbid_dynamic_call.phpt @@ -13,17 +13,17 @@ try { $call = [$object, 'call']; $call(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } try { $callStatic = [ZendTestForbidDynamicCall::class, 'callStatic']; $callStatic(); } catch (Error $error) { - echo $error->getMessage(), "\n"; + echo $error::class, ': ', $error->getMessage(), "\n"; } ?> --EXPECT-- -Cannot call ZendTestForbidDynamicCall::call() dynamically -Cannot call ZendTestForbidDynamicCall::callStatic() dynamically +Error: Cannot call ZendTestForbidDynamicCall::call() dynamically +Error: Cannot call ZendTestForbidDynamicCall::callStatic() dynamically diff --git a/ext/zend_test/tests/zend_internal_class_prop_intersection.phpt b/ext/zend_test/tests/zend_internal_class_prop_intersection.phpt index dd9fe93a130e..f7f421f27d87 100644 --- a/ext/zend_test/tests/zend_internal_class_prop_intersection.phpt +++ b/ext/zend_test/tests/zend_internal_class_prop_intersection.phpt @@ -28,12 +28,12 @@ try { try { $o->classIntersectionProp = new EmptyIterator(); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $o->classIntersectionProp = new C(); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $o->classIntersectionProp = new I(); @@ -41,6 +41,6 @@ $o->classIntersectionProp = new I(); ==DONE== --EXPECT-- Error: Typed property _ZendTestClass::$classIntersectionProp must not be accessed before initialization -Cannot assign EmptyIterator to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable -Cannot assign C to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable +TypeError: Cannot assign EmptyIterator to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable +TypeError: Cannot assign C to property _ZendTestClass::$classIntersectionProp of type Traversable&Countable ==DONE== diff --git a/ext/zend_test/tests/zend_test_compile_string.phpt b/ext/zend_test/tests/zend_test_compile_string.phpt index fb47f748f87a..543c086bdb7a 100644 --- a/ext/zend_test/tests/zend_test_compile_string.phpt +++ b/ext/zend_test/tests/zend_test_compile_string.phpt @@ -46,7 +46,7 @@ EOF; try { zend_test_compile_string($source_string, "Sources\0string", ZEND_COMPILE_POSITION_AT_OPEN_TAG); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } zend_test_compile_string(null, null, null); @@ -65,7 +65,7 @@ string(3) "php" string(3) "php" string(3) "php" string(3) "php" -zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes +ValueError: zend_test_compile_string(): Argument #2 ($filename) must not contain any null bytes Deprecated: zend_test_compile_string(): Passing null to parameter #1 ($source_string) of type string is deprecated in %s on line %d diff --git a/ext/zip/tests/ZipArchive_closeString_error.phpt b/ext/zip/tests/ZipArchive_closeString_error.phpt index d5dca14a97fc..34309078727d 100644 --- a/ext/zip/tests/ZipArchive_closeString_error.phpt +++ b/ext/zip/tests/ZipArchive_closeString_error.phpt @@ -11,7 +11,7 @@ var_dump($zip->open(__DIR__ . '/test.zip')); try { $zip->closeString(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "2.\n"; @@ -21,7 +21,7 @@ echo $zip->getStatusString() . "\n"; try { $zip->closeString(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "3.\n"; @@ -31,17 +31,17 @@ echo gettype($zip->closeString()) . "\n"; try { $zip->closeString(); } catch (Error $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- 1. bool(true) -ZipArchive::closeString can only be called on an archive opened with ZipArchive::openString +Error: ZipArchive::closeString can only be called on an archive opened with ZipArchive::openString 2. Not a zip archive -Invalid or uninitialized Zip object +ValueError: Invalid or uninitialized Zip object 3. string -Invalid or uninitialized Zip object +ValueError: Invalid or uninitialized Zip object diff --git a/ext/zip/tests/bug72434.phpt b/ext/zip/tests/bug72434.phpt index e2ccebad3754..842ad2aa2b89 100644 --- a/ext/zip/tests/bug72434.phpt +++ b/ext/zip/tests/bug72434.phpt @@ -10,8 +10,8 @@ try { $unserialized_payload = unserialize($serialized_payload); var_dump($unserialized_payload); } catch (Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Unserialization of 'ZipArchive' is not allowed, override __serialize() and __unserialize() to implement it +Exception: Unserialization of 'ZipArchive' is not allowed, override __serialize() and __unserialize() to implement it diff --git a/ext/zip/tests/bug_gh8781.phpt b/ext/zip/tests/bug_gh8781.phpt index 31fac9bc6133..196e11630ef9 100644 --- a/ext/zip/tests/bug_gh8781.phpt +++ b/ext/zip/tests/bug_gh8781.phpt @@ -16,4 +16,3 @@ var_dump(is_file($file)); --EXPECT-- bool(true) bool(false) - diff --git a/ext/zip/tests/doubleclose.phpt b/ext/zip/tests/doubleclose.phpt index 611a3b713f84..6ea24e270f57 100644 --- a/ext/zip/tests/doubleclose.phpt +++ b/ext/zip/tests/doubleclose.phpt @@ -14,7 +14,7 @@ var_dump(zip_close($zip)); try { var_dump(zip_close($zip)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Object\n"; @@ -27,7 +27,7 @@ if ($zip->status == ZIPARCHIVE::ER_OK) { try { $zip->close(); } catch (ValueError $err) { - echo $err->getMessage(), PHP_EOL; + echo $err::class, ': ', $err->getMessage(), PHP_EOL; } } else { die("Failure"); @@ -44,8 +44,8 @@ Deprecated: Function zip_close() is deprecated since 8.0, use ZipArchive::close( NULL Deprecated: Function zip_close() is deprecated since 8.0, use ZipArchive::close() instead in %s on line %d -zip_close(): supplied resource is not a valid Zip Directory resource +TypeError: zip_close(): supplied resource is not a valid Zip Directory resource Object bool(true) -Invalid or uninitialized Zip object +ValueError: Invalid or uninitialized Zip object Done diff --git a/ext/zip/tests/gh19932.phpt b/ext/zip/tests/gh19932.phpt index 760fa1c9e766..766ed38b991b 100644 --- a/ext/zip/tests/gh19932.phpt +++ b/ext/zip/tests/gh19932.phpt @@ -22,4 +22,3 @@ echo "OK"; ?> --EXPECT-- OK - diff --git a/ext/zip/tests/gh21682.phpt b/ext/zip/tests/gh21682.phpt index ee09c73e5c4d..cee4e8732b1d 100644 --- a/ext/zip/tests/gh21682.phpt +++ b/ext/zip/tests/gh21682.phpt @@ -9,8 +9,8 @@ try { serialize($a); echo "ERROR: should have thrown\n"; } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Serialization of 'ZipArchive' is not allowed, override __serialize() and __unserialize() to implement it +Exception: Serialization of 'ZipArchive' is not allowed, override __serialize() and __unserialize() to implement it diff --git a/ext/zip/tests/gh21682_subclass_no_overrides.phpt b/ext/zip/tests/gh21682_subclass_no_overrides.phpt index 04fb49d9848e..ff06a668da26 100644 --- a/ext/zip/tests/gh21682_subclass_no_overrides.phpt +++ b/ext/zip/tests/gh21682_subclass_no_overrides.phpt @@ -11,16 +11,16 @@ try { serialize($zip); echo "ERROR: should have thrown\n"; } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { unserialize('O:5:"MyZip":0:{}'); echo "ERROR: should have thrown\n"; } catch (\Exception $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Serialization of 'MyZip' is not allowed, override __serialize() and __unserialize() to implement it -Unserialization of 'MyZip' is not allowed, override __serialize() and __unserialize() to implement it +Exception: Serialization of 'MyZip' is not allowed, override __serialize() and __unserialize() to implement it +Exception: Unserialization of 'MyZip' is not allowed, override __serialize() and __unserialize() to implement it diff --git a/ext/zip/tests/oo_addglob2.phpt b/ext/zip/tests/oo_addglob2.phpt index a98a22271205..298041cc0650 100644 --- a/ext/zip/tests/oo_addglob2.phpt +++ b/ext/zip/tests/oo_addglob2.phpt @@ -41,7 +41,7 @@ $options = [ try { $zip->addGlob($dirname. 'bar.*', GLOB_BRACE, $options); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $options['comp_flags'] = 65536; @@ -49,7 +49,7 @@ $options['comp_flags'] = 65536; try { $zip->addGlob($dirname. 'bar.*', GLOB_BRACE, $options); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $options['comp_flags'] = 5; diff --git a/ext/zip/tests/oo_getcomment.phpt b/ext/zip/tests/oo_getcomment.phpt index a43c5ae38a53..62915841e036 100644 --- a/ext/zip/tests/oo_getcomment.phpt +++ b/ext/zip/tests/oo_getcomment.phpt @@ -20,7 +20,7 @@ var_dump($zip->getCommentIndex($idx)); try { echo $zip->getCommentName('') . "\n"; } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $zip->close(); @@ -30,4 +30,4 @@ $zip->close(); Zip archive comment string(11) "foo comment" string(11) "foo comment" -ZipArchive::getCommentName(): Argument #1 ($name) must not be empty +ValueError: ZipArchive::getCommentName(): Argument #1 ($name) must not be empty diff --git a/ext/zip/tests/oo_getexternalattributesname_error.phpt b/ext/zip/tests/oo_getexternalattributesname_error.phpt index 175fdc4b7bb8..40dc24308292 100644 --- a/ext/zip/tests/oo_getexternalattributesname_error.phpt +++ b/ext/zip/tests/oo_getexternalattributesname_error.phpt @@ -16,8 +16,8 @@ $b = ZipArchive::OPSYS_DEFAULT; try { $zip->getExternalAttributesName("", $a, $b); } catch(ValueError $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -ZipArchive::getExternalAttributesName(): Argument #1 ($name) must not be empty +ValueError: ZipArchive::getExternalAttributesName(): Argument #1 ($name) must not be empty diff --git a/ext/zip/tests/oo_open.phpt b/ext/zip/tests/oo_open.phpt index 44fa46a9a6ea..7352d6fc20f2 100644 --- a/ext/zip/tests/oo_open.phpt +++ b/ext/zip/tests/oo_open.phpt @@ -26,7 +26,7 @@ $zip = new ZipArchive; try { $zip->open(''); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } if (!$zip->open($dirname . 'test.zip')) { @@ -42,5 +42,5 @@ if ($zip->status == ZIPARCHIVE::ER_OK) { --EXPECT-- ER_OPEN: ok create: ok -ZipArchive::open(): Argument #1 ($filename) must not be empty +ValueError: ZipArchive::open(): Argument #1 ($filename) must not be empty OK diff --git a/ext/zip/tests/oo_readonly_properties.phpt b/ext/zip/tests/oo_readonly_properties.phpt index 40eb29f68a7c..385b7de0e850 100644 --- a/ext/zip/tests/oo_readonly_properties.phpt +++ b/ext/zip/tests/oo_readonly_properties.phpt @@ -10,13 +10,13 @@ $zip = new ZipArchive(); try { $zip->lastId = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } try { $zip->lastId += 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->lastId); @@ -24,7 +24,7 @@ var_dump($zip->lastId); try { $zip->status = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->status); @@ -32,7 +32,7 @@ var_dump($zip->status); try { $zip->statusSys = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->statusSys); @@ -40,7 +40,7 @@ var_dump($zip->statusSys); try { $zip->numFiles = 1; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->numFiles); @@ -48,7 +48,7 @@ var_dump($zip->numFiles); try { $zip->filename = "a"; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->filename); @@ -56,23 +56,23 @@ var_dump($zip->filename); try { $zip->comment = "a"; } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } var_dump($zip->comment); ?> --EXPECT-- -Cannot write read-only property ZipArchive::$lastId -Cannot write read-only property ZipArchive::$lastId +Error: Cannot write read-only property ZipArchive::$lastId +Error: Cannot write read-only property ZipArchive::$lastId int(-1) -Cannot write read-only property ZipArchive::$status +Error: Cannot write read-only property ZipArchive::$status int(0) -Cannot write read-only property ZipArchive::$statusSys +Error: Cannot write read-only property ZipArchive::$statusSys int(0) -Cannot write read-only property ZipArchive::$numFiles +Error: Cannot write read-only property ZipArchive::$numFiles int(0) -Cannot write read-only property ZipArchive::$filename +Error: Cannot write read-only property ZipArchive::$filename string(0) "" -Cannot write read-only property ZipArchive::$comment +Error: Cannot write read-only property ZipArchive::$comment string(0) "" diff --git a/ext/zip/tests/oo_setcomment_error.phpt b/ext/zip/tests/oo_setcomment_error.phpt index 82b718ee1872..f94ba2282520 100644 --- a/ext/zip/tests/oo_setcomment_error.phpt +++ b/ext/zip/tests/oo_setcomment_error.phpt @@ -21,25 +21,25 @@ $longComment = str_repeat('a', 0x10000); try { var_dump($zip->setArchiveComment($longComment)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($zip->setCommentName('entry1.txt', $longComment)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump($zip->setCommentIndex(1, $longComment)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $zip->close(); ?> --EXPECT-- -ZipArchive::setArchiveComment(): Argument #1 ($comment) must be less than 65535 bytes -ZipArchive::setCommentName(): Argument #2 ($comment) must be less than 65535 bytes -ZipArchive::setCommentIndex(): Argument #2 ($comment) must be less than 65535 bytes +ValueError: ZipArchive::setArchiveComment(): Argument #1 ($comment) must be less than 65535 bytes +ValueError: ZipArchive::setCommentName(): Argument #2 ($comment) must be less than 65535 bytes +ValueError: ZipArchive::setCommentIndex(): Argument #2 ($comment) must be less than 65535 bytes --CLEAN-- setCompressionName('entry4.txt', ZipArchive::CM_DEFLATE)); try { $zip->setCompressionName('entry5.txt', PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $zip->setCompressionIndex(4, PHP_INT_MIN); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump($zip->setCompressionIndex(4, ZipArchive::CM_STORE)); @@ -69,8 +69,8 @@ unlink($tmpfile); bool(true) bool(true) bool(true) -ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d -ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d +ValueError: ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d +ValueError: ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d bool(true) bool(true) bool(true) diff --git a/ext/zip/tests/oo_setcompression_64bit.phpt b/ext/zip/tests/oo_setcompression_64bit.phpt index cb093e8ccfc9..70de8fade443 100644 --- a/ext/zip/tests/oo_setcompression_64bit.phpt +++ b/ext/zip/tests/oo_setcompression_64bit.phpt @@ -14,16 +14,16 @@ $zip = new ZipArchive; try { $zip->setCompressionName('entry5.txt', PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { $zip->setCompressionIndex(4, PHP_INT_MAX); } catch (\ValueError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECTF-- -ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d -ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d +ValueError: ZipArchive::setCompressionName(): Argument #2 ($method) must be between -1 and %d +ValueError: ZipArchive::setCompressionIndex(): Argument #2 ($method) must be between -1 and %d diff --git a/ext/zip/tests/zip_entry_close.phpt b/ext/zip/tests/zip_entry_close.phpt index 8e05c762f771..bdfbeea67831 100644 --- a/ext/zip/tests/zip_entry_close.phpt +++ b/ext/zip/tests/zip_entry_close.phpt @@ -11,7 +11,7 @@ echo "entry_close: "; var_dump(zip_entry_close($entry)); try { echo "entry_close: "; var_dump(zip_entry_close($entry)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } zip_close($zip); ?> @@ -28,7 +28,7 @@ Deprecated: Function zip_entry_close() is deprecated since 8.0 in %s on line %d bool(true) entry_close: Deprecated: Function zip_entry_close() is deprecated since 8.0 in %s on line %d -zip_entry_close(): supplied resource is not a valid Zip Entry resource +TypeError: zip_entry_close(): supplied resource is not a valid Zip Entry resource Deprecated: Function zip_close() is deprecated since 8.0, use ZipArchive::close() instead in %s on line %d Done diff --git a/ext/zip/tests/zip_open_error.phpt b/ext/zip/tests/zip_open_error.phpt index 2e43ac29713b..24f049647f0f 100644 --- a/ext/zip/tests/zip_open_error.phpt +++ b/ext/zip/tests/zip_open_error.phpt @@ -11,7 +11,7 @@ echo "Test case 1:"; try { $zip = zip_open(""); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "Test case 2:\n"; @@ -21,7 +21,7 @@ echo is_resource($zip) ? "OK" : "Failure"; --EXPECTF-- Test case 1: Deprecated: Function zip_open() is deprecated since 8.0, use ZipArchive::open() instead in %s on line %d -zip_open(): Argument #1 ($filename) must not be empty +ValueError: zip_open(): Argument #1 ($filename) must not be empty Test case 2: Deprecated: Function zip_open() is deprecated since 8.0, use ZipArchive::open() instead in %s on line %d diff --git a/ext/zlib/tests/deflate_add_error.phpt b/ext/zlib/tests/deflate_add_error.phpt index af7b95b79011..b4fc42aaf31f 100644 --- a/ext/zlib/tests/deflate_add_error.phpt +++ b/ext/zlib/tests/deflate_add_error.phpt @@ -9,7 +9,7 @@ $badResource = fopen("php://memory", "r+"); try { var_dump(deflate_add($badResource, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $resource = deflate_init(ZLIB_ENCODING_DEFLATE); @@ -18,10 +18,10 @@ $badFlushType = 6789; try { var_dump(deflate_add($resource, "test", $badFlushType)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -deflate_add(): Argument #1 ($context) must be of type DeflateContext, resource given -deflate_add(): Argument #3 ($flush_mode) must be one of ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH, ZLIB_FULL_FLUSH, ZLIB_BLOCK, or ZLIB_FINISH +TypeError: deflate_add(): Argument #1 ($context) must be of type DeflateContext, resource given +ValueError: deflate_add(): Argument #3 ($flush_mode) must be one of ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH, ZLIB_FULL_FLUSH, ZLIB_BLOCK, or ZLIB_FINISH diff --git a/ext/zlib/tests/deflate_init_error.phpt b/ext/zlib/tests/deflate_init_error.phpt index 6752b650e248..9fe0323a7d22 100644 --- a/ext/zlib/tests/deflate_init_error.phpt +++ b/ext/zlib/tests/deflate_init_error.phpt @@ -8,37 +8,37 @@ zlib try { var_dump(deflate_init(42)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['level' => 42])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['level' => -2])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['memory' => 0])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(deflate_init(ZLIB_ENCODING_DEFLATE, ['memory' => 10])); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE -deflate_init(): "level" option must be between -1 and 9 -deflate_init(): "level" option must be between -1 and 9 -deflate_init(): "memory" option must be between 1 and 9 -deflate_init(): "memory" option must be between 1 and 9 +ValueError: deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: deflate_init(): "level" option must be between -1 and 9 +ValueError: deflate_init(): "level" option must be between -1 and 9 +ValueError: deflate_init(): "memory" option must be between 1 and 9 +ValueError: deflate_init(): "memory" option must be between 1 and 9 diff --git a/ext/zlib/tests/deflate_init_strategy_type_error.phpt b/ext/zlib/tests/deflate_init_strategy_type_error.phpt index 2a59082bc320..7b2e9184529a 100644 --- a/ext/zlib/tests/deflate_init_strategy_type_error.phpt +++ b/ext/zlib/tests/deflate_init_strategy_type_error.phpt @@ -11,32 +11,32 @@ $fp = fopen('php://memory', 'r'); try { deflate_init(ZLIB_ENCODING_DEFLATE, ['level' => 'foo']); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { deflate_init(ZLIB_ENCODING_DEFLATE, ['memory' => []]); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { deflate_init(ZLIB_ENCODING_DEFLATE, ['window' => new A()]); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { deflate_init(ZLIB_ENCODING_DEFLATE, ['strategy' => $fp]); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } fclose($fp); ?> --EXPECT-- -deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, string given -deflate_init(): Argument #2 ($options) the value for option "memory" must be of type int, array given -deflate_init(): Argument #2 ($options) the value for option "window" must be of type int, A given -deflate_init(): Argument #2 ($options) the value for option "strategy" must be of type int, resource given +TypeError: deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, string given +TypeError: deflate_init(): Argument #2 ($options) the value for option "memory" must be of type int, array given +TypeError: deflate_init(): Argument #2 ($options) the value for option "window" must be of type int, A given +TypeError: deflate_init(): Argument #2 ($options) the value for option "strategy" must be of type int, resource given diff --git a/ext/zlib/tests/gh16326.phpt b/ext/zlib/tests/gh16326.phpt index b4997368549f..fe7eb1370957 100644 --- a/ext/zlib/tests/gh16326.phpt +++ b/ext/zlib/tests/gh16326.phpt @@ -7,20 +7,20 @@ zlib try { deflate_init(ZLIB_ENCODING_DEFLATE, ["dictionary" => [" ", ""]]); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { deflate_init(ZLIB_ENCODING_DEFLATE, ["dictionary" => ["hello", "wor\0ld"]]); } catch (ValueError $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } try { deflate_init(ZLIB_ENCODING_DEFLATE, ["dictionary" => [" ", new stdClass]]); } catch (Error $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } ?> --EXPECT-- -deflate_init(): Argument #2 ($options) must not contain empty strings -deflate_init(): Argument #2 ($options) must not contain strings with null bytes -Object of class stdClass could not be converted to string +ValueError: deflate_init(): Argument #2 ($options) must not contain empty strings +ValueError: deflate_init(): Argument #2 ($options) must not contain strings with null bytes +Error: Object of class stdClass could not be converted to string diff --git a/ext/zlib/tests/gh22142.phpt b/ext/zlib/tests/gh22142.phpt index 84397a4e85a9..9bbb9332df30 100644 --- a/ext/zlib/tests/gh22142.phpt +++ b/ext/zlib/tests/gh22142.phpt @@ -12,9 +12,9 @@ class Options { try { deflate_init(ZLIB_ENCODING_DEFLATE, new Options()); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, null given +TypeError: deflate_init(): Argument #2 ($options) the value for option "level" must be of type int, null given diff --git a/ext/zlib/tests/gzclose_basic.phpt b/ext/zlib/tests/gzclose_basic.phpt index f2e03a579de5..28a215681c0c 100644 --- a/ext/zlib/tests/gzclose_basic.phpt +++ b/ext/zlib/tests/gzclose_basic.phpt @@ -16,7 +16,7 @@ var_dump(gzclose($h)); try { gzread($h, 20); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $h = gzopen($f, 'r'); @@ -27,13 +27,13 @@ var_dump(fclose($h)); try { gzread($h, 20); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- bool(true) -gzread(): Argument #1 ($stream) must be an open stream resource +TypeError: gzread(): Argument #1 ($stream) must be an open stream resource bool(true) -gzread(): Argument #1 ($stream) must be an open stream resource +TypeError: gzread(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/zlib/tests/gzcompress_error1.phpt b/ext/zlib/tests/gzcompress_error1.phpt index b21743755417..f21daedd537e 100644 --- a/ext/zlib/tests/gzcompress_error1.phpt +++ b/ext/zlib/tests/gzcompress_error1.phpt @@ -16,7 +16,7 @@ $bad_level = 99; try { var_dump(gzcompress($data, $bad_level)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Testing with invalid encoding --\n"; @@ -25,7 +25,7 @@ $encoding = 99; try { var_dump(gzcompress($data, $level, $encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -33,7 +33,7 @@ try { *** Testing gzcompress() : error conditions *** -- Testing with incorrect compression level -- -gzcompress(): Argument #2 ($level) must be between -1 and 9 +ValueError: gzcompress(): Argument #2 ($level) must be between -1 and 9 -- Testing with invalid encoding -- -gzcompress(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: gzcompress(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzdeflate_error1.phpt b/ext/zlib/tests/gzdeflate_error1.phpt index 9b065edfc24e..75959f85cb09 100644 --- a/ext/zlib/tests/gzdeflate_error1.phpt +++ b/ext/zlib/tests/gzdeflate_error1.phpt @@ -17,7 +17,7 @@ $bad_level = 99; try { var_dump(gzdeflate($data, $bad_level)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Testing with incorrect encoding --\n"; @@ -26,7 +26,7 @@ $bad_encoding = 99; try { var_dump(gzdeflate($data, $level, $bad_encoding)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -34,7 +34,7 @@ try { *** Testing gzdeflate() : error conditions *** -- Testing with incorrect compression level -- -gzdeflate(): Argument #2 ($level) must be between -1 and 9 +ValueError: gzdeflate(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding -- -gzdeflate(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: gzdeflate(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzencode_error1.phpt b/ext/zlib/tests/gzencode_error1.phpt index 8428d3b950dc..c15d47f5b1f5 100644 --- a/ext/zlib/tests/gzencode_error1.phpt +++ b/ext/zlib/tests/gzencode_error1.phpt @@ -19,7 +19,7 @@ $bad_level = 99; try { var_dump(gzencode($data, $bad_level)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } echo "\n-- Testing with incorrect encoding_mode --\n"; @@ -27,7 +27,7 @@ $bad_mode = 99; try { var_dump(gzencode($data, $level, $bad_mode)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> @@ -35,7 +35,7 @@ try { *** Testing gzencode() : error conditions *** -- Testing with incorrect compression level -- -gzencode(): Argument #2 ($level) must be between -1 and 9 +ValueError: gzencode(): Argument #2 ($level) must be between -1 and 9 -- Testing with incorrect encoding_mode -- -gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/gzencode_invalid.phpt b/ext/zlib/tests/gzencode_invalid.phpt index e64bb294b3e8..98df53825feb 100644 --- a/ext/zlib/tests/gzencode_invalid.phpt +++ b/ext/zlib/tests/gzencode_invalid.phpt @@ -8,17 +8,17 @@ zlib try { var_dump(gzencode("", -10)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gzencode("", 100)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { var_dump(gzencode("", 1, 100)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gzencode("", -1, ZLIB_ENCODING_GZIP)); @@ -32,7 +32,7 @@ Lies in the darkness"; try { var_dump(gzencode($string, 9, 3)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gzencode($string, -1, ZLIB_ENCODING_GZIP)); @@ -40,11 +40,11 @@ var_dump(gzencode($string, 9, ZLIB_ENCODING_DEFLATE)); ?> --EXPECTF-- -gzencode(): Argument #2 ($level) must be between -1 and 9 -gzencode(): Argument #2 ($level) must be between -1 and 9 -gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: gzencode(): Argument #2 ($level) must be between -1 and 9 +ValueError: gzencode(): Argument #2 ($level) must be between -1 and 9 +ValueError: gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" -gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: gzencode(): Argument #3 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE string(%d) "%a" string(%d) "%a" diff --git a/ext/zlib/tests/gzeof_variation1.phpt b/ext/zlib/tests/gzeof_variation1.phpt index fb4191fa7940..55bfc55cab40 100644 --- a/ext/zlib/tests/gzeof_variation1.phpt +++ b/ext/zlib/tests/gzeof_variation1.phpt @@ -17,11 +17,11 @@ gzclose($h); try { var_dump(gzeof($h)); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } unlink($filename); ?> --EXPECT-- bool(false) bool(false) -gzeof(): Argument #1 ($stream) must be an open stream resource +TypeError: gzeof(): Argument #1 ($stream) must be an open stream resource diff --git a/ext/zlib/tests/gzfile_variation15.phpt b/ext/zlib/tests/gzfile_variation15.phpt index f33abba0284b..922718ce0181 100644 --- a/ext/zlib/tests/gzfile_variation15.phpt +++ b/ext/zlib/tests/gzfile_variation15.phpt @@ -99,4 +99,3 @@ array(1) { [0]=> string(28) "This is a file in script dir" } - diff --git a/ext/zlib/tests/gzopen_variation9.phpt b/ext/zlib/tests/gzopen_variation9.phpt index 0118dd3ea130..78f512f9d923 100644 --- a/ext/zlib/tests/gzopen_variation9.phpt +++ b/ext/zlib/tests/gzopen_variation9.phpt @@ -40,4 +40,3 @@ mode=e Warning: gzopen(): Failed to open stream: %s in %s on line %d gzopen=bool(false) - diff --git a/ext/zlib/tests/gzread_error2.phpt b/ext/zlib/tests/gzread_error2.phpt index 0a3d08efd09a..ab7231f64c93 100644 --- a/ext/zlib/tests/gzread_error2.phpt +++ b/ext/zlib/tests/gzread_error2.phpt @@ -10,13 +10,13 @@ var_dump(gzread($h, 10)); try { var_dump(gzread($h, 0)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gzread($h, 5)); try { var_dump(gzread($h, -1)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(gzread($h, 8)); gzclose($h); @@ -24,7 +24,7 @@ gzclose($h); ?> --EXPECT-- string(10) "When you'r" -gzread(): Argument #2 ($length) must be greater than 0 +ValueError: gzread(): Argument #2 ($length) must be greater than 0 string(5) "e tau" -gzread(): Argument #2 ($length) must be greater than 0 +ValueError: gzread(): Argument #2 ($length) must be greater than 0 string(8) "ght thro" diff --git a/ext/zlib/tests/gzwrite_error2.phpt b/ext/zlib/tests/gzwrite_error2.phpt index 5201f8064ae1..1e71e4b55485 100644 --- a/ext/zlib/tests/gzwrite_error2.phpt +++ b/ext/zlib/tests/gzwrite_error2.phpt @@ -21,4 +21,3 @@ unlink($filename); --EXPECT-- int(0) int(0) - diff --git a/ext/zlib/tests/inflate_add_error.phpt b/ext/zlib/tests/inflate_add_error.phpt index 129fd5b794f7..1d805ba5f9d2 100644 --- a/ext/zlib/tests/inflate_add_error.phpt +++ b/ext/zlib/tests/inflate_add_error.phpt @@ -9,7 +9,7 @@ $badResource = fopen("php://memory", "r+"); try { var_dump(inflate_add($badResource, "test")); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } $resource = inflate_init(ZLIB_ENCODING_DEFLATE); @@ -17,10 +17,10 @@ $badFlushType = 6789; try { var_dump(inflate_add($resource, "test", $badFlushType)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -inflate_add(): Argument #1 ($context) must be of type InflateContext, resource given -inflate_add(): Argument #3 ($flush_mode) must be one of ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH, ZLIB_FULL_FLUSH, ZLIB_BLOCK, or ZLIB_FINISH +TypeError: inflate_add(): Argument #1 ($context) must be of type InflateContext, resource given +ValueError: inflate_add(): Argument #3 ($flush_mode) must be one of ZLIB_NO_FLUSH, ZLIB_PARTIAL_FLUSH, ZLIB_SYNC_FLUSH, ZLIB_FULL_FLUSH, ZLIB_BLOCK, or ZLIB_FINISH diff --git a/ext/zlib/tests/inflate_init_error.phpt b/ext/zlib/tests/inflate_init_error.phpt index 9854f7453909..a5b6f6ca9897 100644 --- a/ext/zlib/tests/inflate_init_error.phpt +++ b/ext/zlib/tests/inflate_init_error.phpt @@ -8,9 +8,9 @@ zlib try { var_dump(inflate_init(42)); } catch (\ValueError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -inflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: inflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/ext/zlib/tests/inflate_init_window_type_error.phpt b/ext/zlib/tests/inflate_init_window_type_error.phpt index fbca3129681e..cd4c178f2a2c 100644 --- a/ext/zlib/tests/inflate_init_window_type_error.phpt +++ b/ext/zlib/tests/inflate_init_window_type_error.phpt @@ -8,9 +8,9 @@ zlib try { inflate_init(ZLIB_ENCODING_DEFLATE, ['window' => []]); } catch (TypeError $e) { - echo $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -inflate_init(): Argument #2 ($options) the value for option "window" must be of type int, array given +TypeError: inflate_init(): Argument #2 ($options) the value for option "window" must be of type int, array given diff --git a/ext/zlib/tests/leak_invalid_encoding_with_dict.phpt b/ext/zlib/tests/leak_invalid_encoding_with_dict.phpt index 507e6842cb58..a33aa058faab 100644 --- a/ext/zlib/tests/leak_invalid_encoding_with_dict.phpt +++ b/ext/zlib/tests/leak_invalid_encoding_with_dict.phpt @@ -7,14 +7,14 @@ zlib try { inflate_init(123456, ["dictionary" => "dict"]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { deflate_init(123456, ["dictionary" => "dict"]); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -inflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE -deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: inflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE +ValueError: deflate_init(): Argument #1 ($encoding) must be one of ZLIB_ENCODING_RAW, ZLIB_ENCODING_GZIP, or ZLIB_ENCODING_DEFLATE diff --git a/sapi/cli/tests/gh12363.phpt b/sapi/cli/tests/gh12363.phpt index 5093030642b6..86e92be3170b 100644 --- a/sapi/cli/tests/gh12363.phpt +++ b/sapi/cli/tests/gh12363.phpt @@ -36,4 +36,3 @@ Connection: close X-Powered-By: %s Date: Mon, 25 Mar 1985 00:20:00 GMT Content-type: text/html; charset=UTF-8 - diff --git a/tests/basic/GHSA-9pqp-7h25-4f32.phpt b/tests/basic/GHSA-9pqp-7h25-4f32.phpt index 29bcb6557d5a..17a145ad9d0d 100644 --- a/tests/basic/GHSA-9pqp-7h25-4f32.phpt +++ b/tests/basic/GHSA-9pqp-7h25-4f32.phpt @@ -100,4 +100,3 @@ Content-type: text/html; charset=UTF-8 Hello world array(0) { } - diff --git a/tests/classes/abstract_user_call.phpt b/tests/classes/abstract_user_call.phpt index a3e91967dff8..335cabceaf61 100644 --- a/tests/classes/abstract_user_call.phpt +++ b/tests/classes/abstract_user_call.phpt @@ -23,7 +23,7 @@ $o->func(); try { call_user_func(array($o, 'test_base::func')); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -31,4 +31,4 @@ try { test::func() Deprecated: Callables of the form ["test", "test_base::func"] are deprecated in %s on line %d -call_user_func(): Argument #1 ($callback) must be a valid callback, cannot call abstract method test_base::func() +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, cannot call abstract method test_base::func() diff --git a/tests/classes/array_access_013.phpt b/tests/classes/array_access_013.phpt index 22e1cb2d3fa3..6cdeed4ec8c0 100644 --- a/tests/classes/array_access_013.phpt +++ b/tests/classes/array_access_013.phpt @@ -19,7 +19,7 @@ try } catch(Exception $e) { - echo "Caught in " . $e->getMessage() . "()\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -28,7 +28,7 @@ try } catch(Exception $e) { - echo "Caught in " . $e->getMessage() . "()\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -37,7 +37,7 @@ try } catch(Exception $e) { - echo "Caught in " . $e->getMessage() . "()\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try @@ -46,11 +46,11 @@ try } catch(Exception $e) { - echo "Caught in " . $e->getMessage() . "()\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Caught in Test::offsetExists() -Caught in Test::offsetGet() -Caught in Test::offsetSet() -Caught in Test::offsetUnset() +Exception: Test::offsetExists +Exception: Test::offsetGet +Exception: Test::offsetSet +Exception: Test::offsetUnset diff --git a/tests/classes/autoload_012.phpt b/tests/classes/autoload_012.phpt index 0f00ebf562fb..4524a7be2222 100644 --- a/tests/classes/autoload_012.phpt +++ b/tests/classes/autoload_012.phpt @@ -9,9 +9,9 @@ spl_autoload_register(function ($name) { try { call_user_func("UndefC::test"); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- In autoload: string(6) "UndefC" -call_user_func(): Argument #1 ($callback) must be a valid callback, class "UndefC" not found +TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, class "UndefC" not found diff --git a/tests/classes/autoload_013.phpt b/tests/classes/autoload_013.phpt index 1b9302747eff..5499b9aaeb20 100644 --- a/tests/classes/autoload_013.phpt +++ b/tests/classes/autoload_013.phpt @@ -11,9 +11,9 @@ try { new ReflectionClass("UndefC"); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- In autoload: string(6) "UndefC" -Class "UndefC" does not exist +ReflectionException: Class "UndefC" does not exist diff --git a/tests/classes/autoload_014.phpt b/tests/classes/autoload_014.phpt index eaba7f05c121..517d6a690742 100644 --- a/tests/classes/autoload_014.phpt +++ b/tests/classes/autoload_014.phpt @@ -11,9 +11,9 @@ try { new ReflectionMethod("UndefC", "test"); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- In autoload: string(6) "UndefC" -Class "UndefC" does not exist +ReflectionException: Class "UndefC" does not exist diff --git a/tests/classes/autoload_015.phpt b/tests/classes/autoload_015.phpt index 9aa862a7834d..9a85ee540d1c 100644 --- a/tests/classes/autoload_015.phpt +++ b/tests/classes/autoload_015.phpt @@ -11,9 +11,9 @@ try { new ReflectionProperty('UndefC', 'p'); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- In autoload: string(6) "UndefC" -Class "UndefC" does not exist +ReflectionException: Class "UndefC" does not exist diff --git a/tests/classes/autoload_016.phpt b/tests/classes/autoload_016.phpt index c6e7a2b37682..857bebc7ba0c 100644 --- a/tests/classes/autoload_016.phpt +++ b/tests/classes/autoload_016.phpt @@ -12,9 +12,9 @@ $rc = new ReflectionClass("stdClass"); try { $rc->getProperty("UndefC::p"); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- In autoload: string(6) "UndefC" -Class "UndefC" does not exist +ReflectionException: Class "UndefC" does not exist diff --git a/tests/classes/autoload_017.phpt b/tests/classes/autoload_017.phpt index ef327ed37620..c92f0c1bf207 100644 --- a/tests/classes/autoload_017.phpt +++ b/tests/classes/autoload_017.phpt @@ -12,9 +12,9 @@ $rc = new ReflectionClass("stdClass"); try { $rc->implementsInterface("UndefI"); } catch (ReflectionException $e) { - echo $e->getMessage(); + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- In autoload: string(6) "UndefI" -Interface "UndefI" does not exist +ReflectionException: Interface "UndefI" does not exist diff --git a/tests/classes/bug27504.phpt b/tests/classes/bug27504.phpt index d32a0c8b3f24..aac9eb977e67 100644 --- a/tests/classes/bug27504.phpt +++ b/tests/classes/bug27504.phpt @@ -16,16 +16,16 @@ $foo = new foo(); try { call_user_func_array( array( $foo , 'bar' ) , array( '2' ) ); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { $foo->bar('3'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Called function foo:bar(1) -call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method foo::bar() -Call to private method foo::bar() from global scope +TypeError: call_user_func_array(): Argument #1 ($callback) must be a valid callback, cannot access private method foo::bar() +Error: Call to private method foo::bar() from global scope diff --git a/tests/classes/constants_visibility_002.phpt b/tests/classes/constants_visibility_002.phpt index 38fa8d614e76..cfeb5260edfe 100644 --- a/tests/classes/constants_visibility_002.phpt +++ b/tests/classes/constants_visibility_002.phpt @@ -17,11 +17,11 @@ A::staticConstDump(); try { constant('A::protectedConst'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(14) "protectedConst" string(14) "protectedConst" -Cannot access protected constant A::protectedConst +Error: Cannot access protected constant A::protectedConst diff --git a/tests/classes/constants_visibility_003.phpt b/tests/classes/constants_visibility_003.phpt index 7650ca80c894..509daf900b96 100644 --- a/tests/classes/constants_visibility_003.phpt +++ b/tests/classes/constants_visibility_003.phpt @@ -17,11 +17,11 @@ A::staticConstDump(); try { constant('A::privateConst'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- string(12) "privateConst" string(12) "privateConst" -Cannot access private constant A::privateConst +Error: Cannot access private constant A::privateConst diff --git a/tests/classes/ctor_failure.phpt b/tests/classes/ctor_failure.phpt index 949748289232..d747ba294eb9 100644 --- a/tests/classes/ctor_failure.phpt +++ b/tests/classes/ctor_failure.phpt @@ -22,10 +22,10 @@ try } catch (Exception $e) { - echo 'Caught ' . get_class($e) . '(' . $e->getMessage() . ")\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Test::__construct(Hello) -Caught Exception(Hello) +Exception: Hello diff --git a/tests/classes/destructor_and_exceptions.phpt b/tests/classes/destructor_and_exceptions.phpt index 0f51a21a09d0..b4a0923056fd 100644 --- a/tests/classes/destructor_and_exceptions.phpt +++ b/tests/classes/destructor_and_exceptions.phpt @@ -22,7 +22,7 @@ try } catch(Exception $e) { - echo "Caught: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } class FatalException extends Exception @@ -42,17 +42,17 @@ try } catch(Exception $e) { - echo "Caught Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } catch(FatalException $e) { - echo "Caught FatalException: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- FailClass::__destruct -Caught: FailClass +Exception: FailClass FatalException::__construct FailClass::__destruct -Caught Exception: FailClass +Exception: FailClass diff --git a/tests/classes/factory_and_singleton_007.phpt b/tests/classes/factory_and_singleton_007.phpt index 6cf120e18bef..a89d3bdead05 100644 --- a/tests/classes/factory_and_singleton_007.phpt +++ b/tests/classes/factory_and_singleton_007.phpt @@ -12,7 +12,7 @@ try { $obj = new test; $clone = clone $obj; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/tests/classes/factory_and_singleton_008.phpt b/tests/classes/factory_and_singleton_008.phpt index a23af647592f..e070c3be17df 100644 --- a/tests/classes/factory_and_singleton_008.phpt +++ b/tests/classes/factory_and_singleton_008.phpt @@ -12,7 +12,7 @@ try { $obj = new test; $clone = clone $obj; } catch (Throwable $e) { - echo $e::class, ": ", $e->getMessage(), PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> diff --git a/tests/classes/iterators_007.phpt b/tests/classes/iterators_007.phpt index 808fc58636dd..0a6068952496 100644 --- a/tests/classes/iterators_007.phpt +++ b/tests/classes/iterators_007.phpt @@ -27,15 +27,15 @@ while($t->x < 5) } catch(Exception $e) { - echo "Caught in " . $e->getMessage() . "()\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } $t->x++; } ?> --EXPECT-- -Caught in Test::rewind() -Caught in Test::current() -Caught in Test::key() +Exception: Test::rewind +Exception: Test::current +Exception: Test::key Current -Caught in Test::next() -Caught in Test::valid() +Exception: Test::next +Exception: Test::valid diff --git a/tests/classes/serialize_001.phpt b/tests/classes/serialize_001.phpt index 0e1cc18b997f..23db3096c36f 100644 --- a/tests/classes/serialize_001.phpt +++ b/tests/classes/serialize_001.phpt @@ -40,7 +40,7 @@ foreach($tests as $data) } catch(Exception $e) { - echo 'Exception: ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } diff --git a/tests/classes/tostring_001.phpt b/tests/classes/tostring_001.phpt index e9ef7b417583..174ceec15d22 100644 --- a/tests/classes/tostring_001.phpt +++ b/tests/classes/tostring_001.phpt @@ -30,7 +30,7 @@ print_r($o); try { var_dump((string)$o); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } var_dump($o); @@ -59,7 +59,7 @@ $ar[$o->__toString()] = "ERROR"; try { echo $ar[$o]; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "====test8====\n"; @@ -75,7 +75,7 @@ var_dump($o); try { echo $o; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> @@ -85,7 +85,7 @@ try { test1 Object ( ) -Object of class test1 could not be converted to string +Error: Object of class test1 could not be converted to string object(test1)#1 (0) { } ====test2==== @@ -118,7 +118,7 @@ test2::__toString() Converted ====test7==== test2::__toString() -Cannot access offset of type test2 on array +TypeError: Cannot access offset of type test2 on array ====test8==== test2::__toString() string(9) "Converted" @@ -131,5 +131,5 @@ Converted object(test3)#2 (0) { } test3::__toString() -test3::__toString(): Return value must be of type string, array returned +TypeError: test3::__toString(): Return value must be of type string, array returned ====DONE==== diff --git a/tests/classes/tostring_003.phpt b/tests/classes/tostring_003.phpt index 87a5fe42e1b1..e0bbcd2e635a 100644 --- a/tests/classes/tostring_003.phpt +++ b/tests/classes/tostring_003.phpt @@ -24,11 +24,11 @@ try } catch(Exception $e) { - var_dump($e->getMessage()); + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> ====DONE==== --EXPECT-- -string(5) "Damn!" +Exception: Damn! ====DONE==== diff --git a/tests/classes/tostring_004.phpt b/tests/classes/tostring_004.phpt index 48ac2770ddf9..bdbca528d6a0 100644 --- a/tests/classes/tostring_004.phpt +++ b/tests/classes/tostring_004.phpt @@ -15,7 +15,7 @@ echo "Try 1:\n"; try { printf($obj); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } printf("\n"); @@ -23,7 +23,7 @@ echo "\nTry 2:\n"; try { printf($obj . "\n"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n\nObject with bad __toString():\n"; @@ -38,7 +38,7 @@ echo "Try 1:\n"; try { printf($obj); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } printf("\n"); @@ -46,24 +46,24 @@ echo "\nTry 2:\n"; try { printf($obj . "\n"); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- Object with no __toString(): Try 1: -printf(): Argument #1 ($format) must be of type string, stdClass given +TypeError: printf(): Argument #1 ($format) must be of type string, stdClass given Try 2: -Object of class stdClass could not be converted to string +Error: Object of class stdClass could not be converted to string Object with bad __toString(): Try 1: -badToString::__toString(): Return value must be of type string, array returned +TypeError: badToString::__toString(): Return value must be of type string, array returned Try 2: -badToString::__toString(): Return value must be of type string, array returned +TypeError: badToString::__toString(): Return value must be of type string, array returned diff --git a/tests/classes/type_hinting_004.phpt b/tests/classes/type_hinting_004.phpt index 8d2297ab93ae..99c11ebbaded 100644 --- a/tests/classes/type_hinting_004.phpt +++ b/tests/classes/type_hinting_004.phpt @@ -14,32 +14,32 @@ Ensure type hints are enforced for functions invoked as callbacks. try { call_user_func('f1', 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func('f1', new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func('f2', 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func('f2'); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func('f2', new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func('f2', null); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } echo "\n\n---> Type hints with callback static method:\n"; @@ -63,32 +63,32 @@ Ensure type hints are enforced for functions invoked as callbacks. try { call_user_func(array('C', 'f1'), 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array('C', 'f1'), new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array('C', 'f2'), 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array('C', 'f2')); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array('C', 'f2'), new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array('C', 'f2'), null); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } echo "\n\n---> Type hints with callback instance method:\n"; @@ -113,32 +113,32 @@ Ensure type hints are enforced for functions invoked as callbacks. try { call_user_func(array($d, 'f1'), 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array($d, 'f1'), new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array($d, 'f2'), 1); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array($d, 'f2')); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array($d, 'f2'), new A); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } try { call_user_func(array($d, 'f2'), null); } catch (Error $ex) { - echo "{$ex->getCode()}: {$ex->getMessage()} - {$ex->getFile()}({$ex->getLine()})\n\n"; + echo $ex::class, ': ', $ex->getCode(), ': ', $ex->getMessage(), ' in ', $ex->getFile(), ' on line ', $ex->getLine(), "\n"; } ?> @@ -149,33 +149,27 @@ Deprecated: C::f2(): Implicitly marking parameter $a as nullable is deprecated, Deprecated: D::f2(): Implicitly marking parameter $a as nullable is deprecated, the explicit nullable type must be used instead in %s on line %d ---> Type hints with callback function: -0: f1(): Argument #1 ($a) must be of type A, int given%s(%d) - +TypeError: 0: f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d in f1; -0: f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) - +TypeError: 0: f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d in f2; in f2; in f2; ---> Type hints with callback static method: -0: C::f1(): Argument #1 ($a) must be of type A, int given%s(%d) - +TypeError: 0: C::f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d in C::f1 (static); -0: C::f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) - +TypeError: 0: C::f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d in C::f2 (static); in C::f2 (static); in C::f2 (static); ---> Type hints with callback instance method: -0: D::f1(): Argument #1 ($a) must be of type A, int given%s(%d) - +TypeError: 0: D::f1(): Argument #1 ($a) must be of type A, int given%s in %s on line %d in C::f1 (instance); -0: D::f2(): Argument #1 ($a) must be of type ?A, int given%s(%d) - +TypeError: 0: D::f2(): Argument #1 ($a) must be of type ?A, int given%s in %s on line %d in C::f2 (instance); in C::f2 (instance); in C::f2 (instance); diff --git a/tests/lang/bug28800.phpt b/tests/lang/bug28800.phpt index 487c57d24e4a..66e65e79c767 100644 --- a/tests/lang/bug28800.phpt +++ b/tests/lang/bug28800.phpt @@ -7,15 +7,14 @@ Bug #28800 (Incorrect string to number conversion for strings starting with 'inf try { echo ($v+0)."\n"; } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } ?> --EXPECT-- -Unsupported operand types: string + int -Unsupported operand types: string + int -Unsupported operand types: string + int -Unsupported operand types: string + int -Unsupported operand types: string + int -Unsupported operand types: string + int - +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int +TypeError: Unsupported operand types: string + int diff --git a/tests/lang/bug29893.phpt b/tests/lang/bug29893.phpt index d9af91419143..928318770d17 100644 --- a/tests/lang/bug29893.phpt +++ b/tests/lang/bug29893.phpt @@ -6,8 +6,8 @@ $base = 50; try { $base[$base] -= 0; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array diff --git a/tests/lang/bug44827.phpt b/tests/lang/bug44827.phpt index 997a1a633f85..c8c020445025 100644 --- a/tests/lang/bug44827.phpt +++ b/tests/lang/bug44827.phpt @@ -9,16 +9,16 @@ Testfest Munich 2009 try { define('::', true); } catch (ValueError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } try { constant('::'); } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECTF-- -define(): Argument #1 ($constant_name) cannot be a class constant -Class "" not found +ValueError: define(): Argument #1 ($constant_name) cannot be a class constant +Error: Class "" not found diff --git a/tests/lang/catchable_error_002.phpt b/tests/lang/catchable_error_002.phpt index 50f06051e303..68cb2c54506a 100644 --- a/tests/lang/catchable_error_002.phpt +++ b/tests/lang/catchable_error_002.phpt @@ -20,10 +20,10 @@ Catchable fatal error [2] try { blah (new StdClass); } catch (Error $ex) { - echo $ex->getMessage(), "\n"; + echo $ex::class, ': ', $ex->getMessage(), "\n"; } echo "ALIVE!\n"; ?> --EXPECTF-- -blah(): Argument #1 ($a) must be of type Foo, stdClass given, called in %scatchable_error_002.php on line %d +TypeError: blah(): Argument #1 ($a) must be of type Foo, stdClass given, called in %scatchable_error_002.php on line %d ALIVE! diff --git a/tests/lang/engine_assignExecutionOrder_002.phpt b/tests/lang/engine_assignExecutionOrder_002.phpt index a70cd5bafc8f..9b0ca7ba58a1 100644 --- a/tests/lang/engine_assignExecutionOrder_002.phpt +++ b/tests/lang/engine_assignExecutionOrder_002.phpt @@ -13,7 +13,7 @@ echo "A=$a B=$b\n"; try { $c[$c=1] = 1; } catch (Error $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } // i++ evaluated first, so $d[0] is 10 @@ -94,7 +94,7 @@ print_r($ee); ?> --EXPECTF-- A=hello B=bye -Cannot use a scalar value as an array +Error: Cannot use a scalar value as an array array(2) { [0]=> int(10) diff --git a/tests/lang/foreachLoopIteratorAggregate.002.phpt b/tests/lang/foreachLoopIteratorAggregate.002.phpt index bb5089e74b94..27e8e7458ce1 100644 --- a/tests/lang/foreachLoopIteratorAggregate.002.phpt +++ b/tests/lang/foreachLoopIteratorAggregate.002.phpt @@ -38,7 +38,7 @@ function f($className) { echo "$k => $v\n"; } } catch (Exception $e) { - echo $e->getLine() . ": " . $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), ' on line ', $e->getLine(), "\n"; } } @@ -49,7 +49,7 @@ f("bad4"); ?> --EXPECT-- -34: Objects returned by bad1::getIterator() must be traversable or implement interface Iterator -34: Objects returned by bad2::getIterator() must be traversable or implement interface Iterator -34: Objects returned by bad3::getIterator() must be traversable or implement interface Iterator -34: Objects returned by bad4::getIterator() must be traversable or implement interface Iterator +Exception: Objects returned by bad1::getIterator() must be traversable or implement interface Iterator on line 34 +Exception: Objects returned by bad2::getIterator() must be traversable or implement interface Iterator on line 34 +Exception: Objects returned by bad3::getIterator() must be traversable or implement interface Iterator on line 34 +Exception: Objects returned by bad4::getIterator() must be traversable or implement interface Iterator on line 34 diff --git a/tests/lang/func_get_arg.003.phpt b/tests/lang/func_get_arg.003.phpt index 7021f3145075..27726fa13a76 100644 --- a/tests/lang/func_get_arg.003.phpt +++ b/tests/lang/func_get_arg.003.phpt @@ -6,9 +6,9 @@ func_get_arg outside of a function declaration try { var_dump(func_get_arg(0)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -func_get_arg() cannot be called from the global scope +Error: func_get_arg() cannot be called from the global scope diff --git a/tests/lang/func_get_arg.004.phpt b/tests/lang/func_get_arg.004.phpt index 91e0025ee417..bd969e17fa64 100644 --- a/tests/lang/func_get_arg.004.phpt +++ b/tests/lang/func_get_arg.004.phpt @@ -8,11 +8,11 @@ function foo($a) try { var_dump(func_get_arg(2)); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } foo(2, 3); ?> --EXPECT-- -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function diff --git a/tests/lang/func_get_arg_variation.phpt b/tests/lang/func_get_arg_variation.phpt index 1c4f243fbf72..6ba2a61cf6c9 100644 --- a/tests/lang/func_get_arg_variation.phpt +++ b/tests/lang/func_get_arg_variation.phpt @@ -9,18 +9,18 @@ function foo($a) try { echo func_get_arg(-1); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } try { echo func_get_arg(2); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } foo(2); ?> --EXPECT-- -func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 -func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function +ValueError: func_get_arg(): Argument #1 ($position) must be greater than or equal to 0 +ValueError: func_get_arg(): Argument #1 ($position) must be less than the number of the arguments passed to the currently executed function diff --git a/tests/lang/func_get_args.003.phpt b/tests/lang/func_get_args.003.phpt index d56de663c5f9..404f3c92f6b4 100644 --- a/tests/lang/func_get_args.003.phpt +++ b/tests/lang/func_get_args.003.phpt @@ -6,9 +6,9 @@ func_get_args() outside of a function declaration try { var_dump(func_get_args()); } catch (\Error $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } ?> --EXPECT-- -func_get_args() cannot be called from the global scope +Error: func_get_args() cannot be called from the global scope diff --git a/tests/lang/func_num_args.003.phpt b/tests/lang/func_num_args.003.phpt index 0d97109dcc59..4d89191e0601 100644 --- a/tests/lang/func_num_args.003.phpt +++ b/tests/lang/func_num_args.003.phpt @@ -6,9 +6,9 @@ func_num_args() outside of a function declaration try { func_num_args(); } catch (Error $exception) { - echo $exception->getMessage() . "\n"; + echo $exception::class, ': ', $exception->getMessage(), "\n"; } ?> --EXPECT-- -func_num_args() must be called from a function context +Error: func_num_args() must be called from a function context diff --git a/tests/lang/operators/add_variationStr.phpt b/tests/lang/operators/add_variationStr.phpt index 9f8f19dadbdd..ebf7c875f60d 100644 --- a/tests/lang/operators/add_variationStr.phpt +++ b/tests/lang/operators/add_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal+$otherVal); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -34,7 +34,7 @@ float(1.2) --- testing: '0' + '-7.7' --- float(-7.7) --- testing: '0' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '0' + '123abc' --- int(123) --- testing: '0' + '123e5' --- @@ -50,7 +50,7 @@ int(123) --- testing: '0' + '3.4a' --- float(3.4) --- testing: '0' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '65' + '0' --- int(65) --- testing: '65' + '65' --- @@ -62,7 +62,7 @@ float(66.2) --- testing: '65' + '-7.7' --- float(57.3) --- testing: '65' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '65' + '123abc' --- int(188) --- testing: '65' + '123e5' --- @@ -78,7 +78,7 @@ int(188) --- testing: '65' + '3.4a' --- float(68.4) --- testing: '65' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '-44' + '0' --- int(-44) --- testing: '-44' + '65' --- @@ -90,7 +90,7 @@ float(-42.8) --- testing: '-44' + '-7.7' --- float(-51.7) --- testing: '-44' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '-44' + '123abc' --- int(79) --- testing: '-44' + '123e5' --- @@ -106,7 +106,7 @@ int(79) --- testing: '-44' + '3.4a' --- float(-40.6) --- testing: '-44' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '1.2' + '0' --- float(1.2) --- testing: '1.2' + '65' --- @@ -118,7 +118,7 @@ float(2.4) --- testing: '1.2' + '-7.7' --- float(-6.5) --- testing: '1.2' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '1.2' + '123abc' --- float(124.2) --- testing: '1.2' + '123e5' --- @@ -134,7 +134,7 @@ float(124.2) --- testing: '1.2' + '3.4a' --- float(4.6) --- testing: '1.2' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '-7.7' + '0' --- float(-7.7) --- testing: '-7.7' + '65' --- @@ -146,7 +146,7 @@ float(-6.5) --- testing: '-7.7' + '-7.7' --- float(-15.4) --- testing: '-7.7' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '-7.7' + '123abc' --- float(115.3) --- testing: '-7.7' + '123e5' --- @@ -162,35 +162,35 @@ float(115.3) --- testing: '-7.7' + '3.4a' --- float(-4.300000000000001) --- testing: '-7.7' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '0' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '65' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '-44' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '1.2' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '-7.7' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '123abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '123e5' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '123e5xyz' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + ' 123abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '123 abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '123abc ' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + '3.4a' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'abc' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123abc' + '0' --- int(123) --- testing: '123abc' + '65' --- @@ -202,7 +202,7 @@ float(124.2) --- testing: '123abc' + '-7.7' --- float(115.3) --- testing: '123abc' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123abc' + '123abc' --- int(246) --- testing: '123abc' + '123e5' --- @@ -218,7 +218,7 @@ int(246) --- testing: '123abc' + '3.4a' --- float(126.4) --- testing: '123abc' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123e5' + '0' --- float(12300000) --- testing: '123e5' + '65' --- @@ -230,7 +230,7 @@ float(12300001.2) --- testing: '123e5' + '-7.7' --- float(12299992.3) --- testing: '123e5' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123e5' + '123abc' --- float(12300123) --- testing: '123e5' + '123e5' --- @@ -246,7 +246,7 @@ float(12300123) --- testing: '123e5' + '3.4a' --- float(12300003.4) --- testing: '123e5' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123e5xyz' + '0' --- float(12300000) --- testing: '123e5xyz' + '65' --- @@ -258,7 +258,7 @@ float(12300001.2) --- testing: '123e5xyz' + '-7.7' --- float(12299992.3) --- testing: '123e5xyz' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123e5xyz' + '123abc' --- float(12300123) --- testing: '123e5xyz' + '123e5' --- @@ -274,7 +274,7 @@ float(12300123) --- testing: '123e5xyz' + '3.4a' --- float(12300003.4) --- testing: '123e5xyz' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: ' 123abc' + '0' --- int(123) --- testing: ' 123abc' + '65' --- @@ -286,7 +286,7 @@ float(124.2) --- testing: ' 123abc' + '-7.7' --- float(115.3) --- testing: ' 123abc' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: ' 123abc' + '123abc' --- int(246) --- testing: ' 123abc' + '123e5' --- @@ -302,7 +302,7 @@ int(246) --- testing: ' 123abc' + '3.4a' --- float(126.4) --- testing: ' 123abc' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123 abc' + '0' --- int(123) --- testing: '123 abc' + '65' --- @@ -314,7 +314,7 @@ float(124.2) --- testing: '123 abc' + '-7.7' --- float(115.3) --- testing: '123 abc' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123 abc' + '123abc' --- int(246) --- testing: '123 abc' + '123e5' --- @@ -330,7 +330,7 @@ int(246) --- testing: '123 abc' + '3.4a' --- float(126.4) --- testing: '123 abc' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123abc ' + '0' --- int(123) --- testing: '123abc ' + '65' --- @@ -342,7 +342,7 @@ float(124.2) --- testing: '123abc ' + '-7.7' --- float(115.3) --- testing: '123abc ' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '123abc ' + '123abc' --- int(246) --- testing: '123abc ' + '123e5' --- @@ -358,7 +358,7 @@ int(246) --- testing: '123abc ' + '3.4a' --- float(126.4) --- testing: '123abc ' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '3.4a' + '0' --- float(3.4) --- testing: '3.4a' + '65' --- @@ -370,7 +370,7 @@ float(4.6) --- testing: '3.4a' + '-7.7' --- float(-4.300000000000001) --- testing: '3.4a' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: '3.4a' + '123abc' --- float(126.4) --- testing: '3.4a' + '123e5' --- @@ -386,32 +386,32 @@ float(126.4) --- testing: '3.4a' + '3.4a' --- float(6.8) --- testing: '3.4a' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '0' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '65' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '-44' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '1.2' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '-7.7' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + 'abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '123abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '123e5' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '123e5xyz' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + ' 123abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '123 abc' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '123abc ' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + '3.4a' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string --- testing: 'a5.9' + 'a5.9' --- -Unsupported operand types: string + string +TypeError: Unsupported operand types: string + string diff --git a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt index 250813fca357..7563ae66eacd 100644 --- a/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_basiclong_64bit.phpt @@ -28,7 +28,7 @@ foreach ($longVals as $longVal) { try { var_dump($longVal<<$otherVal); } catch (ArithmeticError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -39,7 +39,7 @@ foreach ($otherVals as $otherVal) { try { var_dump($otherVal<<$longVal); } catch (ArithmeticError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -51,7 +51,7 @@ int(9223372036854775807) --- testing: 9223372036854775807 << 1 --- int(-2) --- testing: 9223372036854775807 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 7 --- int(-128) --- testing: 9223372036854775807 << 9 --- @@ -59,7 +59,7 @@ int(-512) --- testing: 9223372036854775807 << 65 --- int(0) --- testing: 9223372036854775807 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 2147483647 --- int(0) --- testing: 9223372036854775807 << 9223372036854775807 --- @@ -69,7 +69,7 @@ int(-9223372036854775808) --- testing: -9223372036854775808 << 1 --- int(0) --- testing: -9223372036854775808 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775808 << 7 --- int(0) --- testing: -9223372036854775808 << 9 --- @@ -77,7 +77,7 @@ int(0) --- testing: -9223372036854775808 << 65 --- int(0) --- testing: -9223372036854775808 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775808 << 2147483647 --- int(0) --- testing: -9223372036854775808 << 9223372036854775807 --- @@ -87,7 +87,7 @@ int(2147483647) --- testing: 2147483647 << 1 --- int(4294967294) --- testing: 2147483647 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 7 --- int(274877906816) --- testing: 2147483647 << 9 --- @@ -95,7 +95,7 @@ int(1099511627264) --- testing: 2147483647 << 65 --- int(0) --- testing: 2147483647 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 2147483647 --- int(0) --- testing: 2147483647 << 9223372036854775807 --- @@ -105,7 +105,7 @@ int(-2147483648) --- testing: -2147483648 << 1 --- int(-4294967296) --- testing: -2147483648 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483648 << 7 --- int(-274877906944) --- testing: -2147483648 << 9 --- @@ -113,7 +113,7 @@ int(-1099511627776) --- testing: -2147483648 << 65 --- int(0) --- testing: -2147483648 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483648 << 2147483647 --- int(0) --- testing: -2147483648 << 9223372036854775807 --- @@ -123,7 +123,7 @@ int(9223372034707292160) --- testing: 9223372034707292160 << 1 --- int(-4294967296) --- testing: 9223372034707292160 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372034707292160 << 7 --- int(-274877906944) --- testing: 9223372034707292160 << 9 --- @@ -131,7 +131,7 @@ int(-1099511627776) --- testing: 9223372034707292160 << 65 --- int(0) --- testing: 9223372034707292160 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372034707292160 << 2147483647 --- int(0) --- testing: 9223372034707292160 << 9223372036854775807 --- @@ -141,7 +141,7 @@ int(-9223372034707292160) --- testing: -9223372034707292160 << 1 --- int(4294967296) --- testing: -9223372034707292160 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372034707292160 << 7 --- int(274877906944) --- testing: -9223372034707292160 << 9 --- @@ -149,7 +149,7 @@ int(1099511627776) --- testing: -9223372034707292160 << 65 --- int(0) --- testing: -9223372034707292160 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372034707292160 << 2147483647 --- int(0) --- testing: -9223372034707292160 << 9223372036854775807 --- @@ -159,7 +159,7 @@ int(2147483648) --- testing: 2147483648 << 1 --- int(4294967296) --- testing: 2147483648 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483648 << 7 --- int(274877906944) --- testing: 2147483648 << 9 --- @@ -167,7 +167,7 @@ int(1099511627776) --- testing: 2147483648 << 65 --- int(0) --- testing: 2147483648 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483648 << 2147483647 --- int(0) --- testing: 2147483648 << 9223372036854775807 --- @@ -177,7 +177,7 @@ int(-2147483649) --- testing: -2147483649 << 1 --- int(-4294967298) --- testing: -2147483649 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483649 << 7 --- int(-274877907072) --- testing: -2147483649 << 9 --- @@ -185,7 +185,7 @@ int(-1099511628288) --- testing: -2147483649 << 65 --- int(0) --- testing: -2147483649 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483649 << 2147483647 --- int(0) --- testing: -2147483649 << 9223372036854775807 --- @@ -195,7 +195,7 @@ int(4294967294) --- testing: 4294967294 << 1 --- int(8589934588) --- testing: 4294967294 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967294 << 7 --- int(549755813632) --- testing: 4294967294 << 9 --- @@ -203,7 +203,7 @@ int(2199023254528) --- testing: 4294967294 << 65 --- int(0) --- testing: 4294967294 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967294 << 2147483647 --- int(0) --- testing: 4294967294 << 9223372036854775807 --- @@ -213,7 +213,7 @@ int(4294967295) --- testing: 4294967295 << 1 --- int(8589934590) --- testing: 4294967295 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967295 << 7 --- int(549755813760) --- testing: 4294967295 << 9 --- @@ -221,7 +221,7 @@ int(2199023255040) --- testing: 4294967295 << 65 --- int(0) --- testing: 4294967295 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967295 << 2147483647 --- int(0) --- testing: 4294967295 << 9223372036854775807 --- @@ -231,7 +231,7 @@ int(4294967293) --- testing: 4294967293 << 1 --- int(8589934586) --- testing: 4294967293 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967293 << 7 --- int(549755813504) --- testing: 4294967293 << 9 --- @@ -239,7 +239,7 @@ int(2199023254016) --- testing: 4294967293 << 65 --- int(0) --- testing: 4294967293 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967293 << 2147483647 --- int(0) --- testing: 4294967293 << 9223372036854775807 --- @@ -249,7 +249,7 @@ int(9223372036854775806) --- testing: 9223372036854775806 << 1 --- int(-4) --- testing: 9223372036854775806 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775806 << 7 --- int(-256) --- testing: 9223372036854775806 << 9 --- @@ -257,7 +257,7 @@ int(-1024) --- testing: 9223372036854775806 << 65 --- int(0) --- testing: 9223372036854775806 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775806 << 2147483647 --- int(0) --- testing: 9223372036854775806 << 9223372036854775807 --- @@ -267,7 +267,7 @@ int(-9223372036854775808) --- testing: 9.2233720368548E+18 << 1 --- int(0) --- testing: 9.2233720368548E+18 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9.2233720368548E+18 << 7 --- int(0) --- testing: 9.2233720368548E+18 << 9 --- @@ -275,7 +275,7 @@ int(0) --- testing: 9.2233720368548E+18 << 65 --- int(0) --- testing: 9.2233720368548E+18 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9.2233720368548E+18 << 2147483647 --- int(0) --- testing: 9.2233720368548E+18 << 9223372036854775807 --- @@ -285,7 +285,7 @@ int(-9223372036854775807) --- testing: -9223372036854775807 << 1 --- int(2) --- testing: -9223372036854775807 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775807 << 7 --- int(128) --- testing: -9223372036854775807 << 9 --- @@ -293,7 +293,7 @@ int(512) --- testing: -9223372036854775807 << 65 --- int(0) --- testing: -9223372036854775807 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775807 << 2147483647 --- int(0) --- testing: -9223372036854775807 << 9223372036854775807 --- @@ -303,7 +303,7 @@ int(-9223372036854775808) --- testing: -9.2233720368548E+18 << 1 --- int(0) --- testing: -9.2233720368548E+18 << -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9.2233720368548E+18 << 7 --- int(0) --- testing: -9.2233720368548E+18 << 9 --- @@ -311,7 +311,7 @@ int(0) --- testing: -9.2233720368548E+18 << 65 --- int(0) --- testing: -9.2233720368548E+18 << -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9.2233720368548E+18 << 2147483647 --- int(0) --- testing: -9.2233720368548E+18 << 9223372036854775807 --- @@ -319,19 +319,19 @@ int(0) --- testing: 0 << 9223372036854775807 --- int(0) --- testing: 0 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << 2147483647 --- int(0) --- testing: 0 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << 9223372034707292160 --- int(0) --- testing: 0 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << 2147483648 --- int(0) --- testing: 0 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << 4294967294 --- int(0) --- testing: 0 << 4294967295 --- @@ -341,27 +341,27 @@ int(0) --- testing: 0 << 9223372036854775806 --- int(0) --- testing: 0 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << 9223372036854775807 --- int(0) --- testing: 1 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << 2147483647 --- int(0) --- testing: 1 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << 9223372034707292160 --- int(0) --- testing: 1 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << 2147483648 --- int(0) --- testing: 1 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << 4294967294 --- int(0) --- testing: 1 << 4294967295 --- @@ -371,27 +371,27 @@ int(0) --- testing: 1 << 9223372036854775806 --- int(0) --- testing: 1 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << 9223372036854775807 --- int(0) --- testing: -1 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << 2147483647 --- int(0) --- testing: -1 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << 9223372034707292160 --- int(0) --- testing: -1 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << 2147483648 --- int(0) --- testing: -1 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << 4294967294 --- int(0) --- testing: -1 << 4294967295 --- @@ -401,27 +401,27 @@ int(0) --- testing: -1 << 9223372036854775806 --- int(0) --- testing: -1 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << 9223372036854775807 --- int(0) --- testing: 7 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << 2147483647 --- int(0) --- testing: 7 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << 9223372034707292160 --- int(0) --- testing: 7 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << 2147483648 --- int(0) --- testing: 7 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << 4294967294 --- int(0) --- testing: 7 << 4294967295 --- @@ -431,27 +431,27 @@ int(0) --- testing: 7 << 9223372036854775806 --- int(0) --- testing: 7 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << 9223372036854775807 --- int(0) --- testing: 9 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << 2147483647 --- int(0) --- testing: 9 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << 9223372034707292160 --- int(0) --- testing: 9 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << 2147483648 --- int(0) --- testing: 9 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << 4294967294 --- int(0) --- testing: 9 << 4294967295 --- @@ -461,27 +461,27 @@ int(0) --- testing: 9 << 9223372036854775806 --- int(0) --- testing: 9 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << 9223372036854775807 --- int(0) --- testing: 65 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << 2147483647 --- int(0) --- testing: 65 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << 9223372034707292160 --- int(0) --- testing: 65 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << 2147483648 --- int(0) --- testing: 65 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << 4294967294 --- int(0) --- testing: 65 << 4294967295 --- @@ -491,27 +491,27 @@ int(0) --- testing: 65 << 9223372036854775806 --- int(0) --- testing: 65 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << 9223372036854775807 --- int(0) --- testing: -44 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << 2147483647 --- int(0) --- testing: -44 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << 9223372034707292160 --- int(0) --- testing: -44 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << 2147483648 --- int(0) --- testing: -44 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << 4294967294 --- int(0) --- testing: -44 << 4294967295 --- @@ -521,27 +521,27 @@ int(0) --- testing: -44 << 9223372036854775806 --- int(0) --- testing: -44 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 9223372036854775807 --- int(0) --- testing: 2147483647 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 2147483647 --- int(0) --- testing: 2147483647 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 9223372034707292160 --- int(0) --- testing: 2147483647 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 2147483648 --- int(0) --- testing: 2147483647 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << 4294967294 --- int(0) --- testing: 2147483647 << 4294967295 --- @@ -551,27 +551,27 @@ int(0) --- testing: 2147483647 << 9223372036854775806 --- int(0) --- testing: 2147483647 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 9223372036854775807 --- int(0) --- testing: 9223372036854775807 << -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 2147483647 --- int(0) --- testing: 9223372036854775807 << -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 9223372034707292160 --- int(0) --- testing: 9223372036854775807 << -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 2147483648 --- int(0) --- testing: 9223372036854775807 << -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << 4294967294 --- int(0) --- testing: 9223372036854775807 << 4294967295 --- @@ -581,8 +581,8 @@ int(0) --- testing: 9223372036854775807 << 9223372036854775806 --- int(0) --- testing: 9223372036854775807 << 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 << -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt index cf227ddf8f8f..34d7f8519d2f 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal<<$otherVal); } catch (Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } diff --git a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt index c3e7af98928a..5576da911de9 100644 --- a/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftLeft_variationStr_64bit.phpt @@ -20,7 +20,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal<<$otherVal); } catch (\Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } diff --git a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt index 75be6afae23d..dfe56b4db383 100644 --- a/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt +++ b/tests/lang/operators/bitwiseShiftRight_basiclong_64bit.phpt @@ -28,7 +28,7 @@ foreach ($longVals as $longVal) { try { var_dump($longVal>>$otherVal); } catch (ArithmeticError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -39,7 +39,7 @@ foreach ($otherVals as $otherVal) { try { var_dump($otherVal>>$longVal); } catch (ArithmeticError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -51,7 +51,7 @@ int(9223372036854775807) --- testing: 9223372036854775807 >> 1 --- int(4611686018427387903) --- testing: 9223372036854775807 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 7 --- int(72057594037927935) --- testing: 9223372036854775807 >> 9 --- @@ -59,7 +59,7 @@ int(18014398509481983) --- testing: 9223372036854775807 >> 65 --- int(0) --- testing: 9223372036854775807 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 2147483647 --- int(0) --- testing: 9223372036854775807 >> 9223372036854775807 --- @@ -69,7 +69,7 @@ int(-9223372036854775808) --- testing: -9223372036854775808 >> 1 --- int(-4611686018427387904) --- testing: -9223372036854775808 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775808 >> 7 --- int(-72057594037927936) --- testing: -9223372036854775808 >> 9 --- @@ -77,7 +77,7 @@ int(-18014398509481984) --- testing: -9223372036854775808 >> 65 --- int(-1) --- testing: -9223372036854775808 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775808 >> 2147483647 --- int(-1) --- testing: -9223372036854775808 >> 9223372036854775807 --- @@ -87,7 +87,7 @@ int(2147483647) --- testing: 2147483647 >> 1 --- int(1073741823) --- testing: 2147483647 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 7 --- int(16777215) --- testing: 2147483647 >> 9 --- @@ -95,7 +95,7 @@ int(4194303) --- testing: 2147483647 >> 65 --- int(0) --- testing: 2147483647 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 2147483647 --- int(0) --- testing: 2147483647 >> 9223372036854775807 --- @@ -105,7 +105,7 @@ int(-2147483648) --- testing: -2147483648 >> 1 --- int(-1073741824) --- testing: -2147483648 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483648 >> 7 --- int(-16777216) --- testing: -2147483648 >> 9 --- @@ -113,7 +113,7 @@ int(-4194304) --- testing: -2147483648 >> 65 --- int(-1) --- testing: -2147483648 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483648 >> 2147483647 --- int(-1) --- testing: -2147483648 >> 9223372036854775807 --- @@ -123,7 +123,7 @@ int(9223372034707292160) --- testing: 9223372034707292160 >> 1 --- int(4611686017353646080) --- testing: 9223372034707292160 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372034707292160 >> 7 --- int(72057594021150720) --- testing: 9223372034707292160 >> 9 --- @@ -131,7 +131,7 @@ int(18014398505287680) --- testing: 9223372034707292160 >> 65 --- int(0) --- testing: 9223372034707292160 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372034707292160 >> 2147483647 --- int(0) --- testing: 9223372034707292160 >> 9223372036854775807 --- @@ -141,7 +141,7 @@ int(-9223372034707292160) --- testing: -9223372034707292160 >> 1 --- int(-4611686017353646080) --- testing: -9223372034707292160 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372034707292160 >> 7 --- int(-72057594021150720) --- testing: -9223372034707292160 >> 9 --- @@ -149,7 +149,7 @@ int(-18014398505287680) --- testing: -9223372034707292160 >> 65 --- int(-1) --- testing: -9223372034707292160 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372034707292160 >> 2147483647 --- int(-1) --- testing: -9223372034707292160 >> 9223372036854775807 --- @@ -159,7 +159,7 @@ int(2147483648) --- testing: 2147483648 >> 1 --- int(1073741824) --- testing: 2147483648 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483648 >> 7 --- int(16777216) --- testing: 2147483648 >> 9 --- @@ -167,7 +167,7 @@ int(4194304) --- testing: 2147483648 >> 65 --- int(0) --- testing: 2147483648 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483648 >> 2147483647 --- int(0) --- testing: 2147483648 >> 9223372036854775807 --- @@ -177,7 +177,7 @@ int(-2147483649) --- testing: -2147483649 >> 1 --- int(-1073741825) --- testing: -2147483649 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483649 >> 7 --- int(-16777217) --- testing: -2147483649 >> 9 --- @@ -185,7 +185,7 @@ int(-4194305) --- testing: -2147483649 >> 65 --- int(-1) --- testing: -2147483649 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -2147483649 >> 2147483647 --- int(-1) --- testing: -2147483649 >> 9223372036854775807 --- @@ -195,7 +195,7 @@ int(4294967294) --- testing: 4294967294 >> 1 --- int(2147483647) --- testing: 4294967294 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967294 >> 7 --- int(33554431) --- testing: 4294967294 >> 9 --- @@ -203,7 +203,7 @@ int(8388607) --- testing: 4294967294 >> 65 --- int(0) --- testing: 4294967294 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967294 >> 2147483647 --- int(0) --- testing: 4294967294 >> 9223372036854775807 --- @@ -213,7 +213,7 @@ int(4294967295) --- testing: 4294967295 >> 1 --- int(2147483647) --- testing: 4294967295 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967295 >> 7 --- int(33554431) --- testing: 4294967295 >> 9 --- @@ -221,7 +221,7 @@ int(8388607) --- testing: 4294967295 >> 65 --- int(0) --- testing: 4294967295 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967295 >> 2147483647 --- int(0) --- testing: 4294967295 >> 9223372036854775807 --- @@ -231,7 +231,7 @@ int(4294967293) --- testing: 4294967293 >> 1 --- int(2147483646) --- testing: 4294967293 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967293 >> 7 --- int(33554431) --- testing: 4294967293 >> 9 --- @@ -239,7 +239,7 @@ int(8388607) --- testing: 4294967293 >> 65 --- int(0) --- testing: 4294967293 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 4294967293 >> 2147483647 --- int(0) --- testing: 4294967293 >> 9223372036854775807 --- @@ -249,7 +249,7 @@ int(9223372036854775806) --- testing: 9223372036854775806 >> 1 --- int(4611686018427387903) --- testing: 9223372036854775806 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775806 >> 7 --- int(72057594037927935) --- testing: 9223372036854775806 >> 9 --- @@ -257,7 +257,7 @@ int(18014398509481983) --- testing: 9223372036854775806 >> 65 --- int(0) --- testing: 9223372036854775806 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775806 >> 2147483647 --- int(0) --- testing: 9223372036854775806 >> 9223372036854775807 --- @@ -267,7 +267,7 @@ int(-9223372036854775808) --- testing: 9.2233720368548E+18 >> 1 --- int(-4611686018427387904) --- testing: 9.2233720368548E+18 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9.2233720368548E+18 >> 7 --- int(-72057594037927936) --- testing: 9.2233720368548E+18 >> 9 --- @@ -275,7 +275,7 @@ int(-18014398509481984) --- testing: 9.2233720368548E+18 >> 65 --- int(-1) --- testing: 9.2233720368548E+18 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9.2233720368548E+18 >> 2147483647 --- int(-1) --- testing: 9.2233720368548E+18 >> 9223372036854775807 --- @@ -285,7 +285,7 @@ int(-9223372036854775807) --- testing: -9223372036854775807 >> 1 --- int(-4611686018427387904) --- testing: -9223372036854775807 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775807 >> 7 --- int(-72057594037927936) --- testing: -9223372036854775807 >> 9 --- @@ -293,7 +293,7 @@ int(-18014398509481984) --- testing: -9223372036854775807 >> 65 --- int(-1) --- testing: -9223372036854775807 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9223372036854775807 >> 2147483647 --- int(-1) --- testing: -9223372036854775807 >> 9223372036854775807 --- @@ -303,7 +303,7 @@ int(-9223372036854775808) --- testing: -9.2233720368548E+18 >> 1 --- int(-4611686018427387904) --- testing: -9.2233720368548E+18 >> -1 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9.2233720368548E+18 >> 7 --- int(-72057594037927936) --- testing: -9.2233720368548E+18 >> 9 --- @@ -311,7 +311,7 @@ int(-18014398509481984) --- testing: -9.2233720368548E+18 >> 65 --- int(-1) --- testing: -9.2233720368548E+18 >> -44 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -9.2233720368548E+18 >> 2147483647 --- int(-1) --- testing: -9.2233720368548E+18 >> 9223372036854775807 --- @@ -319,19 +319,19 @@ int(-1) --- testing: 0 >> 9223372036854775807 --- int(0) --- testing: 0 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> 2147483647 --- int(0) --- testing: 0 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> 9223372034707292160 --- int(0) --- testing: 0 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> 2147483648 --- int(0) --- testing: 0 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> 4294967294 --- int(0) --- testing: 0 >> 4294967295 --- @@ -341,27 +341,27 @@ int(0) --- testing: 0 >> 9223372036854775806 --- int(0) --- testing: 0 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 0 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> 9223372036854775807 --- int(0) --- testing: 1 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> 2147483647 --- int(0) --- testing: 1 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> 9223372034707292160 --- int(0) --- testing: 1 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> 2147483648 --- int(0) --- testing: 1 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> 4294967294 --- int(0) --- testing: 1 >> 4294967295 --- @@ -371,27 +371,27 @@ int(0) --- testing: 1 >> 9223372036854775806 --- int(0) --- testing: 1 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 1 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> 9223372036854775807 --- int(-1) --- testing: -1 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> 2147483647 --- int(-1) --- testing: -1 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> 9223372034707292160 --- int(-1) --- testing: -1 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> 2147483648 --- int(-1) --- testing: -1 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> 4294967294 --- int(-1) --- testing: -1 >> 4294967295 --- @@ -401,27 +401,27 @@ int(-1) --- testing: -1 >> 9223372036854775806 --- int(-1) --- testing: -1 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -1 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> 9223372036854775807 --- int(0) --- testing: 7 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> 2147483647 --- int(0) --- testing: 7 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> 9223372034707292160 --- int(0) --- testing: 7 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> 2147483648 --- int(0) --- testing: 7 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> 4294967294 --- int(0) --- testing: 7 >> 4294967295 --- @@ -431,27 +431,27 @@ int(0) --- testing: 7 >> 9223372036854775806 --- int(0) --- testing: 7 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 7 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> 9223372036854775807 --- int(0) --- testing: 9 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> 2147483647 --- int(0) --- testing: 9 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> 9223372034707292160 --- int(0) --- testing: 9 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> 2147483648 --- int(0) --- testing: 9 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> 4294967294 --- int(0) --- testing: 9 >> 4294967295 --- @@ -461,27 +461,27 @@ int(0) --- testing: 9 >> 9223372036854775806 --- int(0) --- testing: 9 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> 9223372036854775807 --- int(0) --- testing: 65 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> 2147483647 --- int(0) --- testing: 65 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> 9223372034707292160 --- int(0) --- testing: 65 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> 2147483648 --- int(0) --- testing: 65 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> 4294967294 --- int(0) --- testing: 65 >> 4294967295 --- @@ -491,27 +491,27 @@ int(0) --- testing: 65 >> 9223372036854775806 --- int(0) --- testing: 65 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 65 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> 9223372036854775807 --- int(-1) --- testing: -44 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> 2147483647 --- int(-1) --- testing: -44 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> 9223372034707292160 --- int(-1) --- testing: -44 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> 2147483648 --- int(-1) --- testing: -44 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> 4294967294 --- int(-1) --- testing: -44 >> 4294967295 --- @@ -521,27 +521,27 @@ int(-1) --- testing: -44 >> 9223372036854775806 --- int(-1) --- testing: -44 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: -44 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 9223372036854775807 --- int(0) --- testing: 2147483647 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 2147483647 --- int(0) --- testing: 2147483647 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 9223372034707292160 --- int(0) --- testing: 2147483647 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 2147483648 --- int(0) --- testing: 2147483647 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> 4294967294 --- int(0) --- testing: 2147483647 >> 4294967295 --- @@ -551,27 +551,27 @@ int(0) --- testing: 2147483647 >> 9223372036854775806 --- int(0) --- testing: 2147483647 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 2147483647 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 9223372036854775807 --- int(0) --- testing: 9223372036854775807 >> -9223372036854775808 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 2147483647 --- int(0) --- testing: 9223372036854775807 >> -2147483648 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 9223372034707292160 --- int(0) --- testing: 9223372036854775807 >> -9223372034707292160 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 2147483648 --- int(0) --- testing: 9223372036854775807 >> -2147483649 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> 4294967294 --- int(0) --- testing: 9223372036854775807 >> 4294967295 --- @@ -581,8 +581,8 @@ int(0) --- testing: 9223372036854775807 >> 9223372036854775806 --- int(0) --- testing: 9223372036854775807 >> 9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> -9223372036854775807 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number --- testing: 9223372036854775807 >> -9.2233720368548E+18 --- -Exception: Bit shift by negative number +ArithmeticError: Bit shift by negative number diff --git a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt index d1f124933c85..4ad78f247f1e 100644 --- a/tests/lang/operators/bitwiseShiftRight_variationStr.phpt +++ b/tests/lang/operators/bitwiseShiftRight_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal>>$otherVal); } catch (\Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } diff --git a/tests/lang/operators/divide_basiclong_64bit.phpt b/tests/lang/operators/divide_basiclong_64bit.phpt index 65ab5b69a221..8dd90793fe9d 100644 --- a/tests/lang/operators/divide_basiclong_64bit.phpt +++ b/tests/lang/operators/divide_basiclong_64bit.phpt @@ -28,7 +28,7 @@ foreach ($longVals as $longVal) { try { var_dump($longVal/$otherVal); } catch (\Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } diff --git a/tests/lang/operators/divide_variationStr.phpt b/tests/lang/operators/divide_variationStr.phpt index 6c62972ffd38..4b16f2d31506 100644 --- a/tests/lang/operators/divide_variationStr.phpt +++ b/tests/lang/operators/divide_variationStr.phpt @@ -16,9 +16,9 @@ foreach ($strVals as $strVal) { try { var_dump($strVal/$otherVal); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } catch (\DivisionByZeroError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -27,7 +27,7 @@ foreach ($strVals as $strVal) { ?> --EXPECT-- --- testing: '0'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '0'/'65' --- int(0) --- testing: '0'/'-44' --- @@ -37,7 +37,7 @@ float(0) --- testing: '0'/'-7.7' --- float(-0) --- testing: '0'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '0'/'123abc' --- int(0) --- testing: '0'/'123e5' --- @@ -53,9 +53,9 @@ int(0) --- testing: '0'/'3.4a' --- float(0) --- testing: '0'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '65'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '65'/'65' --- int(1) --- testing: '65'/'-44' --- @@ -65,7 +65,7 @@ float(54.16666666666667) --- testing: '65'/'-7.7' --- float(-8.441558441558442) --- testing: '65'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '65'/'123abc' --- float(0.5284552845528455) --- testing: '65'/'123e5' --- @@ -81,9 +81,9 @@ float(0.5284552845528455) --- testing: '65'/'3.4a' --- float(19.11764705882353) --- testing: '65'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '-44'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '-44'/'65' --- float(-0.676923076923077) --- testing: '-44'/'-44' --- @@ -93,7 +93,7 @@ float(-36.66666666666667) --- testing: '-44'/'-7.7' --- float(5.714285714285714) --- testing: '-44'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '-44'/'123abc' --- float(-0.35772357723577236) --- testing: '-44'/'123e5' --- @@ -109,9 +109,9 @@ float(-0.35772357723577236) --- testing: '-44'/'3.4a' --- float(-12.941176470588236) --- testing: '-44'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '1.2'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '1.2'/'65' --- float(0.01846153846153846) --- testing: '1.2'/'-44' --- @@ -121,7 +121,7 @@ float(1) --- testing: '1.2'/'-7.7' --- float(-0.15584415584415584) --- testing: '1.2'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '1.2'/'123abc' --- float(0.00975609756097561) --- testing: '1.2'/'123e5' --- @@ -137,9 +137,9 @@ float(0.00975609756097561) --- testing: '1.2'/'3.4a' --- float(0.35294117647058826) --- testing: '1.2'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '-7.7'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '-7.7'/'65' --- float(-0.11846153846153847) --- testing: '-7.7'/'-44' --- @@ -149,7 +149,7 @@ float(-6.416666666666667) --- testing: '-7.7'/'-7.7' --- float(1) --- testing: '-7.7'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '-7.7'/'123abc' --- float(-0.06260162601626017) --- testing: '-7.7'/'123e5' --- @@ -165,37 +165,37 @@ float(-0.06260162601626017) --- testing: '-7.7'/'3.4a' --- float(-2.264705882352941) --- testing: '-7.7'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'0' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'65' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'-44' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'1.2' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'-7.7' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'123abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'123e5' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'123e5xyz' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/' 123abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'123 abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'123abc ' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'3.4a' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'abc'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123abc'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '123abc'/'65' --- float(1.8923076923076922) --- testing: '123abc'/'-44' --- @@ -205,7 +205,7 @@ float(102.5) --- testing: '123abc'/'-7.7' --- float(-15.974025974025974) --- testing: '123abc'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123abc'/'123abc' --- int(1) --- testing: '123abc'/'123e5' --- @@ -221,9 +221,9 @@ int(1) --- testing: '123abc'/'3.4a' --- float(36.1764705882353) --- testing: '123abc'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123e5'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '123e5'/'65' --- float(189230.76923076922) --- testing: '123e5'/'-44' --- @@ -233,7 +233,7 @@ float(10250000) --- testing: '123e5'/'-7.7' --- float(-1597402.5974025973) --- testing: '123e5'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123e5'/'123abc' --- float(100000) --- testing: '123e5'/'123e5' --- @@ -249,9 +249,9 @@ float(100000) --- testing: '123e5'/'3.4a' --- float(3617647.0588235296) --- testing: '123e5'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123e5xyz'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '123e5xyz'/'65' --- float(189230.76923076922) --- testing: '123e5xyz'/'-44' --- @@ -261,7 +261,7 @@ float(10250000) --- testing: '123e5xyz'/'-7.7' --- float(-1597402.5974025973) --- testing: '123e5xyz'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123e5xyz'/'123abc' --- float(100000) --- testing: '123e5xyz'/'123e5' --- @@ -277,9 +277,9 @@ float(100000) --- testing: '123e5xyz'/'3.4a' --- float(3617647.0588235296) --- testing: '123e5xyz'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: ' 123abc'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: ' 123abc'/'65' --- float(1.8923076923076922) --- testing: ' 123abc'/'-44' --- @@ -289,7 +289,7 @@ float(102.5) --- testing: ' 123abc'/'-7.7' --- float(-15.974025974025974) --- testing: ' 123abc'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: ' 123abc'/'123abc' --- int(1) --- testing: ' 123abc'/'123e5' --- @@ -305,9 +305,9 @@ int(1) --- testing: ' 123abc'/'3.4a' --- float(36.1764705882353) --- testing: ' 123abc'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123 abc'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '123 abc'/'65' --- float(1.8923076923076922) --- testing: '123 abc'/'-44' --- @@ -317,7 +317,7 @@ float(102.5) --- testing: '123 abc'/'-7.7' --- float(-15.974025974025974) --- testing: '123 abc'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123 abc'/'123abc' --- int(1) --- testing: '123 abc'/'123e5' --- @@ -333,9 +333,9 @@ int(1) --- testing: '123 abc'/'3.4a' --- float(36.1764705882353) --- testing: '123 abc'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123abc '/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '123abc '/'65' --- float(1.8923076923076922) --- testing: '123abc '/'-44' --- @@ -345,7 +345,7 @@ float(102.5) --- testing: '123abc '/'-7.7' --- float(-15.974025974025974) --- testing: '123abc '/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '123abc '/'123abc' --- int(1) --- testing: '123abc '/'123e5' --- @@ -361,9 +361,9 @@ int(1) --- testing: '123abc '/'3.4a' --- float(36.1764705882353) --- testing: '123abc '/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '3.4a'/'0' --- -Division by zero +DivisionByZeroError: Division by zero --- testing: '3.4a'/'65' --- float(0.052307692307692305) --- testing: '3.4a'/'-44' --- @@ -373,7 +373,7 @@ float(2.8333333333333335) --- testing: '3.4a'/'-7.7' --- float(-0.44155844155844154) --- testing: '3.4a'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: '3.4a'/'123abc' --- float(0.027642276422764227) --- testing: '3.4a'/'123e5' --- @@ -389,32 +389,32 @@ float(0.027642276422764227) --- testing: '3.4a'/'3.4a' --- float(1) --- testing: '3.4a'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'0' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'65' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'-44' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'1.2' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'-7.7' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'123abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'123e5' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'123e5xyz' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/' 123abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'123 abc' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'123abc ' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'3.4a' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string --- testing: 'a5.9'/'a5.9' --- -Unsupported operand types: string / string +TypeError: Unsupported operand types: string / string diff --git a/tests/lang/operators/modulus_basiclong_64bit.phpt b/tests/lang/operators/modulus_basiclong_64bit.phpt index 34792c2b54d2..379ccc2dd633 100644 --- a/tests/lang/operators/modulus_basiclong_64bit.phpt +++ b/tests/lang/operators/modulus_basiclong_64bit.phpt @@ -28,7 +28,7 @@ foreach ($longVals as $longVal) { try { var_dump($longVal%$otherVal); } catch (DivisionByZeroError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -39,7 +39,7 @@ foreach ($otherVals as $otherVal) { try { var_dump($otherVal%$longVal); } catch (DivisionByZeroError $e) { - echo "Exception: " . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } @@ -47,7 +47,7 @@ foreach ($otherVals as $otherVal) { ?> --EXPECT-- --- testing: 9223372036854775807 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 9223372036854775807 % 1 --- int(0) --- testing: 9223372036854775807 % -1 --- @@ -65,7 +65,7 @@ int(1) --- testing: 9223372036854775807 % 9223372036854775807 --- int(0) --- testing: -9223372036854775808 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -9223372036854775808 % 1 --- int(0) --- testing: -9223372036854775808 % -1 --- @@ -83,7 +83,7 @@ int(-2) --- testing: -9223372036854775808 % 9223372036854775807 --- int(-1) --- testing: 2147483647 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 2147483647 % 1 --- int(0) --- testing: 2147483647 % -1 --- @@ -101,7 +101,7 @@ int(0) --- testing: 2147483647 % 9223372036854775807 --- int(2147483647) --- testing: -2147483648 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -2147483648 % 1 --- int(0) --- testing: -2147483648 % -1 --- @@ -119,7 +119,7 @@ int(-1) --- testing: -2147483648 % 9223372036854775807 --- int(-2147483648) --- testing: 9223372034707292160 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 9223372034707292160 % 1 --- int(0) --- testing: 9223372034707292160 % -1 --- @@ -137,7 +137,7 @@ int(1) --- testing: 9223372034707292160 % 9223372036854775807 --- int(9223372034707292160) --- testing: -9223372034707292160 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -9223372034707292160 % 1 --- int(0) --- testing: -9223372034707292160 % -1 --- @@ -155,7 +155,7 @@ int(-1) --- testing: -9223372034707292160 % 9223372036854775807 --- int(-9223372034707292160) --- testing: 2147483648 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 2147483648 % 1 --- int(0) --- testing: 2147483648 % -1 --- @@ -173,7 +173,7 @@ int(1) --- testing: 2147483648 % 9223372036854775807 --- int(2147483648) --- testing: -2147483649 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -2147483649 % 1 --- int(0) --- testing: -2147483649 % -1 --- @@ -191,7 +191,7 @@ int(-2) --- testing: -2147483649 % 9223372036854775807 --- int(-2147483649) --- testing: 4294967294 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 4294967294 % 1 --- int(0) --- testing: 4294967294 % -1 --- @@ -209,7 +209,7 @@ int(0) --- testing: 4294967294 % 9223372036854775807 --- int(4294967294) --- testing: 4294967295 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 4294967295 % 1 --- int(0) --- testing: 4294967295 % -1 --- @@ -227,7 +227,7 @@ int(1) --- testing: 4294967295 % 9223372036854775807 --- int(4294967295) --- testing: 4294967293 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 4294967293 % 1 --- int(0) --- testing: 4294967293 % -1 --- @@ -245,7 +245,7 @@ int(2147483646) --- testing: 4294967293 % 9223372036854775807 --- int(4294967293) --- testing: 9223372036854775806 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 9223372036854775806 % 1 --- int(0) --- testing: 9223372036854775806 % -1 --- @@ -263,7 +263,7 @@ int(0) --- testing: 9223372036854775806 % 9223372036854775807 --- int(9223372036854775806) --- testing: 9.2233720368548E+18 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: 9.2233720368548E+18 % 1 --- int(0) --- testing: 9.2233720368548E+18 % -1 --- @@ -281,7 +281,7 @@ int(-2) --- testing: 9.2233720368548E+18 % 9223372036854775807 --- int(-1) --- testing: -9223372036854775807 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -9223372036854775807 % 1 --- int(0) --- testing: -9223372036854775807 % -1 --- @@ -299,7 +299,7 @@ int(-1) --- testing: -9223372036854775807 % 9223372036854775807 --- int(0) --- testing: -9.2233720368548E+18 % 0 --- -Exception: Modulo by zero +DivisionByZeroError: Modulo by zero --- testing: -9.2233720368548E+18 % 1 --- int(0) --- testing: -9.2233720368548E+18 % -1 --- diff --git a/tests/lang/operators/modulus_variationStr.phpt b/tests/lang/operators/modulus_variationStr.phpt index 1f9aae88a4d8..941345fe4045 100644 --- a/tests/lang/operators/modulus_variationStr.phpt +++ b/tests/lang/operators/modulus_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal%$otherVal); } catch (\Throwable $e) { - echo get_class($e) . ': ' . $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } } diff --git a/tests/lang/operators/multiply_variationStr.phpt b/tests/lang/operators/multiply_variationStr.phpt index af650ae99355..622243617a28 100644 --- a/tests/lang/operators/multiply_variationStr.phpt +++ b/tests/lang/operators/multiply_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal*$otherVal); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -34,7 +34,7 @@ float(0) --- testing: '0' * '-7.7' --- float(-0) --- testing: '0' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '0' * '123abc' --- int(0) --- testing: '0' * '123e5' --- @@ -50,7 +50,7 @@ int(0) --- testing: '0' * '3.4a' --- float(0) --- testing: '0' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '65' * '0' --- int(0) --- testing: '65' * '65' --- @@ -62,7 +62,7 @@ float(78) --- testing: '65' * '-7.7' --- float(-500.5) --- testing: '65' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '65' * '123abc' --- int(7995) --- testing: '65' * '123e5' --- @@ -78,7 +78,7 @@ int(7995) --- testing: '65' * '3.4a' --- float(221) --- testing: '65' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '-44' * '0' --- int(0) --- testing: '-44' * '65' --- @@ -90,7 +90,7 @@ float(-52.8) --- testing: '-44' * '-7.7' --- float(338.8) --- testing: '-44' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '-44' * '123abc' --- int(-5412) --- testing: '-44' * '123e5' --- @@ -106,7 +106,7 @@ int(-5412) --- testing: '-44' * '3.4a' --- float(-149.6) --- testing: '-44' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '1.2' * '0' --- float(0) --- testing: '1.2' * '65' --- @@ -118,7 +118,7 @@ float(1.44) --- testing: '1.2' * '-7.7' --- float(-9.24) --- testing: '1.2' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '1.2' * '123abc' --- float(147.6) --- testing: '1.2' * '123e5' --- @@ -134,7 +134,7 @@ float(147.6) --- testing: '1.2' * '3.4a' --- float(4.08) --- testing: '1.2' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '-7.7' * '0' --- float(-0) --- testing: '-7.7' * '65' --- @@ -146,7 +146,7 @@ float(-9.24) --- testing: '-7.7' * '-7.7' --- float(59.290000000000006) --- testing: '-7.7' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '-7.7' * '123abc' --- float(-947.1) --- testing: '-7.7' * '123e5' --- @@ -162,35 +162,35 @@ float(-947.1) --- testing: '-7.7' * '3.4a' --- float(-26.18) --- testing: '-7.7' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '0' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '65' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '-44' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '1.2' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '-7.7' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '123abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '123e5' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '123e5xyz' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * ' 123abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '123 abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '123abc ' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * '3.4a' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'abc' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123abc' * '0' --- int(0) --- testing: '123abc' * '65' --- @@ -202,7 +202,7 @@ float(147.6) --- testing: '123abc' * '-7.7' --- float(-947.1) --- testing: '123abc' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123abc' * '123abc' --- int(15129) --- testing: '123abc' * '123e5' --- @@ -218,7 +218,7 @@ int(15129) --- testing: '123abc' * '3.4a' --- float(418.2) --- testing: '123abc' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123e5' * '0' --- float(0) --- testing: '123e5' * '65' --- @@ -230,7 +230,7 @@ float(14760000) --- testing: '123e5' * '-7.7' --- float(-94710000) --- testing: '123e5' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123e5' * '123abc' --- float(1512900000) --- testing: '123e5' * '123e5' --- @@ -246,7 +246,7 @@ float(1512900000) --- testing: '123e5' * '3.4a' --- float(41820000) --- testing: '123e5' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123e5xyz' * '0' --- float(0) --- testing: '123e5xyz' * '65' --- @@ -258,7 +258,7 @@ float(14760000) --- testing: '123e5xyz' * '-7.7' --- float(-94710000) --- testing: '123e5xyz' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123e5xyz' * '123abc' --- float(1512900000) --- testing: '123e5xyz' * '123e5' --- @@ -274,7 +274,7 @@ float(1512900000) --- testing: '123e5xyz' * '3.4a' --- float(41820000) --- testing: '123e5xyz' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: ' 123abc' * '0' --- int(0) --- testing: ' 123abc' * '65' --- @@ -286,7 +286,7 @@ float(147.6) --- testing: ' 123abc' * '-7.7' --- float(-947.1) --- testing: ' 123abc' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: ' 123abc' * '123abc' --- int(15129) --- testing: ' 123abc' * '123e5' --- @@ -302,7 +302,7 @@ int(15129) --- testing: ' 123abc' * '3.4a' --- float(418.2) --- testing: ' 123abc' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123 abc' * '0' --- int(0) --- testing: '123 abc' * '65' --- @@ -314,7 +314,7 @@ float(147.6) --- testing: '123 abc' * '-7.7' --- float(-947.1) --- testing: '123 abc' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123 abc' * '123abc' --- int(15129) --- testing: '123 abc' * '123e5' --- @@ -330,7 +330,7 @@ int(15129) --- testing: '123 abc' * '3.4a' --- float(418.2) --- testing: '123 abc' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123abc ' * '0' --- int(0) --- testing: '123abc ' * '65' --- @@ -342,7 +342,7 @@ float(147.6) --- testing: '123abc ' * '-7.7' --- float(-947.1) --- testing: '123abc ' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '123abc ' * '123abc' --- int(15129) --- testing: '123abc ' * '123e5' --- @@ -358,7 +358,7 @@ int(15129) --- testing: '123abc ' * '3.4a' --- float(418.2) --- testing: '123abc ' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '3.4a' * '0' --- float(0) --- testing: '3.4a' * '65' --- @@ -370,7 +370,7 @@ float(4.08) --- testing: '3.4a' * '-7.7' --- float(-26.18) --- testing: '3.4a' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: '3.4a' * '123abc' --- float(418.2) --- testing: '3.4a' * '123e5' --- @@ -386,32 +386,32 @@ float(418.2) --- testing: '3.4a' * '3.4a' --- float(11.559999999999999) --- testing: '3.4a' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '0' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '65' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '-44' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '1.2' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '-7.7' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * 'abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '123abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '123e5' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '123e5xyz' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * ' 123abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '123 abc' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '123abc ' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * '3.4a' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string --- testing: 'a5.9' * 'a5.9' --- -Unsupported operand types: string * string +TypeError: Unsupported operand types: string * string diff --git a/tests/lang/operators/negate_variationStr.phpt b/tests/lang/operators/negate_variationStr.phpt index 43b2f6a52a60..785192ed6922 100644 --- a/tests/lang/operators/negate_variationStr.phpt +++ b/tests/lang/operators/negate_variationStr.phpt @@ -13,7 +13,7 @@ foreach ($strVals as $strVal) { try { var_dump(-$strVal); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } @@ -30,7 +30,7 @@ float(-1.2) --- testing: '-7.7' --- float(7.7) --- testing: 'abc' --- -Unsupported operand types: string * int +TypeError: Unsupported operand types: string * int --- testing: '123abc' --- Warning: A non-numeric value encountered in %s on line %d @@ -58,4 +58,4 @@ int(-123) Warning: A non-numeric value encountered in %s on line %d float(-3.4) --- testing: 'a5.9' --- -Unsupported operand types: string * int +TypeError: Unsupported operand types: string * int diff --git a/tests/lang/operators/subtract_variationStr.phpt b/tests/lang/operators/subtract_variationStr.phpt index 6df852498df1..9eea2027cb50 100644 --- a/tests/lang/operators/subtract_variationStr.phpt +++ b/tests/lang/operators/subtract_variationStr.phpt @@ -16,7 +16,7 @@ foreach ($strVals as $strVal) { try { var_dump($strVal-$otherVal); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } } } @@ -34,7 +34,7 @@ float(-1.2) --- testing: '0' - '-7.7' --- float(7.7) --- testing: '0' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '0' - '123abc' --- int(-123) --- testing: '0' - '123e5' --- @@ -50,7 +50,7 @@ int(-123) --- testing: '0' - '3.4a' --- float(-3.4) --- testing: '0' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '65' - '0' --- int(65) --- testing: '65' - '65' --- @@ -62,7 +62,7 @@ float(63.8) --- testing: '65' - '-7.7' --- float(72.7) --- testing: '65' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '65' - '123abc' --- int(-58) --- testing: '65' - '123e5' --- @@ -78,7 +78,7 @@ int(-58) --- testing: '65' - '3.4a' --- float(61.6) --- testing: '65' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '-44' - '0' --- int(-44) --- testing: '-44' - '65' --- @@ -90,7 +90,7 @@ float(-45.2) --- testing: '-44' - '-7.7' --- float(-36.3) --- testing: '-44' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '-44' - '123abc' --- int(-167) --- testing: '-44' - '123e5' --- @@ -106,7 +106,7 @@ int(-167) --- testing: '-44' - '3.4a' --- float(-47.4) --- testing: '-44' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '1.2' - '0' --- float(1.2) --- testing: '1.2' - '65' --- @@ -118,7 +118,7 @@ float(0) --- testing: '1.2' - '-7.7' --- float(8.9) --- testing: '1.2' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '1.2' - '123abc' --- float(-121.8) --- testing: '1.2' - '123e5' --- @@ -134,7 +134,7 @@ float(-121.8) --- testing: '1.2' - '3.4a' --- float(-2.2) --- testing: '1.2' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '-7.7' - '0' --- float(-7.7) --- testing: '-7.7' - '65' --- @@ -146,7 +146,7 @@ float(-8.9) --- testing: '-7.7' - '-7.7' --- float(0) --- testing: '-7.7' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '-7.7' - '123abc' --- float(-130.7) --- testing: '-7.7' - '123e5' --- @@ -162,35 +162,35 @@ float(-130.7) --- testing: '-7.7' - '3.4a' --- float(-11.1) --- testing: '-7.7' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '0' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '65' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '-44' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '1.2' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '-7.7' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '123abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '123e5' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '123e5xyz' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - ' 123abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '123 abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '123abc ' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - '3.4a' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'abc' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123abc' - '0' --- int(123) --- testing: '123abc' - '65' --- @@ -202,7 +202,7 @@ float(121.8) --- testing: '123abc' - '-7.7' --- float(130.7) --- testing: '123abc' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123abc' - '123abc' --- int(0) --- testing: '123abc' - '123e5' --- @@ -218,7 +218,7 @@ int(0) --- testing: '123abc' - '3.4a' --- float(119.6) --- testing: '123abc' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123e5' - '0' --- float(12300000) --- testing: '123e5' - '65' --- @@ -230,7 +230,7 @@ float(12299998.8) --- testing: '123e5' - '-7.7' --- float(12300007.7) --- testing: '123e5' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123e5' - '123abc' --- float(12299877) --- testing: '123e5' - '123e5' --- @@ -246,7 +246,7 @@ float(12299877) --- testing: '123e5' - '3.4a' --- float(12299996.6) --- testing: '123e5' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123e5xyz' - '0' --- float(12300000) --- testing: '123e5xyz' - '65' --- @@ -258,7 +258,7 @@ float(12299998.8) --- testing: '123e5xyz' - '-7.7' --- float(12300007.7) --- testing: '123e5xyz' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123e5xyz' - '123abc' --- float(12299877) --- testing: '123e5xyz' - '123e5' --- @@ -274,7 +274,7 @@ float(12299877) --- testing: '123e5xyz' - '3.4a' --- float(12299996.6) --- testing: '123e5xyz' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: ' 123abc' - '0' --- int(123) --- testing: ' 123abc' - '65' --- @@ -286,7 +286,7 @@ float(121.8) --- testing: ' 123abc' - '-7.7' --- float(130.7) --- testing: ' 123abc' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: ' 123abc' - '123abc' --- int(0) --- testing: ' 123abc' - '123e5' --- @@ -302,7 +302,7 @@ int(0) --- testing: ' 123abc' - '3.4a' --- float(119.6) --- testing: ' 123abc' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123 abc' - '0' --- int(123) --- testing: '123 abc' - '65' --- @@ -314,7 +314,7 @@ float(121.8) --- testing: '123 abc' - '-7.7' --- float(130.7) --- testing: '123 abc' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123 abc' - '123abc' --- int(0) --- testing: '123 abc' - '123e5' --- @@ -330,7 +330,7 @@ int(0) --- testing: '123 abc' - '3.4a' --- float(119.6) --- testing: '123 abc' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123abc ' - '0' --- int(123) --- testing: '123abc ' - '65' --- @@ -342,7 +342,7 @@ float(121.8) --- testing: '123abc ' - '-7.7' --- float(130.7) --- testing: '123abc ' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '123abc ' - '123abc' --- int(0) --- testing: '123abc ' - '123e5' --- @@ -358,7 +358,7 @@ int(0) --- testing: '123abc ' - '3.4a' --- float(119.6) --- testing: '123abc ' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '3.4a' - '0' --- float(3.4) --- testing: '3.4a' - '65' --- @@ -370,7 +370,7 @@ float(2.2) --- testing: '3.4a' - '-7.7' --- float(11.1) --- testing: '3.4a' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: '3.4a' - '123abc' --- float(-119.6) --- testing: '3.4a' - '123e5' --- @@ -386,32 +386,32 @@ float(-119.6) --- testing: '3.4a' - '3.4a' --- float(0) --- testing: '3.4a' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '0' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '65' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '-44' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '1.2' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '-7.7' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - 'abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '123abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '123e5' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '123e5xyz' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - ' 123abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '123 abc' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '123abc ' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - '3.4a' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string --- testing: 'a5.9' - 'a5.9' --- -Unsupported operand types: string - string +TypeError: Unsupported operand types: string - string diff --git a/tests/lang/passByReference_010.phpt b/tests/lang/passByReference_010.phpt index 0ae8e953e204..f57acf08a3d7 100644 --- a/tests/lang/passByReference_010.phpt +++ b/tests/lang/passByReference_010.phpt @@ -13,7 +13,7 @@ try { f($a="a.original"); var_dump($a); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n\n---> Pass variable assignment by reference:\n"; @@ -23,7 +23,7 @@ try { f($b = $a); var_dump($a); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n\n---> Pass reference assignment by reference:\n"; @@ -33,7 +33,7 @@ try { f($b =& $a); var_dump($a); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "\n\n---> Pass concat assignment by reference:\n"; @@ -44,17 +44,17 @@ try { f($b .= $a); var_dump($a); } catch (Throwable $e) { - echo "Exception: " . $e->getMessage() ."\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- ---> Pass constant assignment by reference: -Exception: f(): Argument #1 ($a) could not be passed by reference +Error: f(): Argument #1 ($a) could not be passed by reference ---> Pass variable assignment by reference: -Exception: f(): Argument #1 ($a) could not be passed by reference +Error: f(): Argument #1 ($a) could not be passed by reference ---> Pass reference assignment by reference: @@ -63,4 +63,4 @@ string(9) "a.changed" ---> Pass concat assignment by reference: -Exception: f(): Argument #1 ($a) could not be passed by reference +Error: f(): Argument #1 ($a) could not be passed by reference diff --git a/tests/lang/syntax_errors.phpt b/tests/lang/syntax_errors.phpt index 1b52c31c6a09..71861316da4a 100644 --- a/tests/lang/syntax_errors.phpt +++ b/tests/lang/syntax_errors.phpt @@ -29,29 +29,29 @@ foreach ($badCode as $code) { try { eval($code); } catch (ParseError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } } echo "==DONE==\n"; ?> --EXPECT-- -Unclosed '(' -Unclosed '[' -Unclosed '{' -Unmatched ')' -Unmatched ']' -Unmatched '}' -Unclosed '(' does not match ']' -Unclosed '[' does not match ')' -Unclosed '{' does not match ')' -Unclosed '{' on line 1 -Unclosed '[' on line 1 -Unclosed '{' on line 1 -Unmatched ')' -Unmatched ']' -Unmatched '}' -Unclosed '(' on line 1 does not match ']' -Unclosed '[' on line 1 does not match ')' -Unclosed '{' on line 1 does not match ')' +ParseError: Unclosed '(' +ParseError: Unclosed '[' +ParseError: Unclosed '{' +ParseError: Unmatched ')' +ParseError: Unmatched ']' +ParseError: Unmatched '}' +ParseError: Unclosed '(' does not match ']' +ParseError: Unclosed '[' does not match ')' +ParseError: Unclosed '{' does not match ')' +ParseError: Unclosed '{' on line 1 +ParseError: Unclosed '[' on line 1 +ParseError: Unclosed '{' on line 1 +ParseError: Unmatched ')' +ParseError: Unmatched ']' +ParseError: Unmatched '}' +ParseError: Unclosed '(' on line 1 does not match ']' +ParseError: Unclosed '[' on line 1 does not match ')' +ParseError: Unclosed '{' on line 1 does not match ')' ==DONE== diff --git a/tests/output/ob_014.phpt b/tests/output/ob_014.phpt index 0893db5d2518..202540696b3c 100644 --- a/tests/output/ob_014.phpt +++ b/tests/output/ob_014.phpt @@ -7,9 +7,9 @@ echo "foo\n"; try { ob_end_flush(); } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ?> --EXPECT-- foo -str_rot13() expects exactly 1 argument, 2 given +ArgumentCountError: str_rot13() expects exactly 1 argument, 2 given diff --git a/tests/output/ob_015.phpt b/tests/output/ob_015.phpt index 47c9b24be164..10e7beee3fa2 100644 --- a/tests/output/ob_015.phpt +++ b/tests/output/ob_015.phpt @@ -6,10 +6,10 @@ ob_start("str_rot13", 1); try { echo "foo\n"; } catch (TypeError $e) { - echo $e->getMessage(), "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } ob_end_flush(); ?> --EXPECT-- foo -str_rot13() expects exactly 1 argument, 2 given +ArgumentCountError: str_rot13() expects exactly 1 argument, 2 given diff --git a/tests/output/ob_start_basic_002.phpt b/tests/output/ob_start_basic_002.phpt index 700dab5d3c38..6d124c308dfa 100644 --- a/tests/output/ob_start_basic_002.phpt +++ b/tests/output/ob_start_basic_002.phpt @@ -50,4 +50,3 @@ I stole your output. --> Use callback 'return_zero': 0 - diff --git a/tests/output/ob_start_callback_output/exception_handler_nested.phpt b/tests/output/ob_start_callback_output/exception_handler_nested.phpt index 562abd63aa63..6910fb3c134b 100644 --- a/tests/output/ob_start_callback_output/exception_handler_nested.phpt +++ b/tests/output/ob_start_callback_output/exception_handler_nested.phpt @@ -38,21 +38,21 @@ echo "In all of them\n\n"; try { ob_end_flush(); } catch (\ErrorException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Ended third_handler\n\n"; try { ob_end_flush(); } catch (\ErrorException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Ended second_handler\n\n"; try { ob_end_flush(); } catch (\ErrorException $e) { - echo $e->getMessage() . "\n"; + echo $e::class, ': ', $e->getMessage(), "\n"; } echo "Ended first_handler handler\n\n"; @@ -62,7 +62,7 @@ echo implode("\n", $log); ?> --EXPECT-- FIRST -ob_end_flush(): Producing output from user output handler first_handler is deprecated +ErrorException: ob_end_flush(): Producing output from user output handler first_handler is deprecated Ended first_handler handler All handlers are over @@ -71,12 +71,12 @@ third_handler: <<>> second_handler: <<>> first_handler: <<>> diff --git a/tests/output/ob_start_callback_output/functions_that_output_nested.phpt b/tests/output/ob_start_callback_output/functions_that_output_nested.phpt index 976ec46f880b..258b16ad67bd 100644 --- a/tests/output/ob_start_callback_output/functions_that_output_nested.phpt +++ b/tests/output/ob_start_callback_output/functions_that_output_nested.phpt @@ -66,4 +66,4 @@ var_export handle_echo: <<< Deprecated: ob_end_flush(): Producing output from user output handler handle_var_dump is deprecated in %s on line %d var_dump ->>> \ No newline at end of file +>>> diff --git a/tests/strings/002.phpt b/tests/strings/002.phpt index 6284e9bf5d33..09ed12b4a668 100644 --- a/tests/strings/002.phpt +++ b/tests/strings/002.phpt @@ -42,7 +42,7 @@ printf("printf test 29:%2\$-2d %1\$2d\n", 1, 2); try { print("printf test 30:"); printf("%0\$s", 1); print("x\n"); } catch(\ValueError $e) { - print('Error found: '.$e->getMessage()."\n"); + echo $e::class, ': ', $e->getMessage(), "\n"; } printf("printf test 31:%.17g\n", INF); printf("printf test 32:%.17g\n", -INF); @@ -84,7 +84,7 @@ printf test 26:2 1 printf test 27:3 1 2 printf test 28:02 1 printf test 29:2 1 -printf test 30:Error found: Argument number specifier must be greater than zero and less than 2147483647 +printf test 30:ValueError: Argument number specifier must be greater than zero and less than 2147483647 printf test 31:INF printf test 32:-INF vprintf test 1:2 1 diff --git a/tests/strings/offsets_general.phpt b/tests/strings/offsets_general.phpt index 16960eac9522..88358051d8ce 100644 --- a/tests/strings/offsets_general.phpt +++ b/tests/strings/offsets_general.phpt @@ -12,7 +12,7 @@ var_dump(isset($string[0][0])); try { var_dump($string["foo"]); } catch (\TypeError $e) { - echo $e->getMessage() . \PHP_EOL; + echo $e::class, ': ', $e->getMessage(), PHP_EOL; } var_dump(isset($string["foo"]["bar"])); @@ -23,5 +23,5 @@ string(1) "f" string(1) "o" bool(true) bool(true) -Cannot access offset of type string on string +TypeError: Cannot access offset of type string on string bool(false)