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..627e210d0f17 100644
--- a/Zend/tests/add_002.phpt
+++ b/Zend/tests/add_002.phpt
@@ -10,8 +10,8 @@ $o->prop = "value";
try {
var_dump($a + $o);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6472a050bf9d 100644
--- a/Zend/tests/add_003.phpt
+++ b/Zend/tests/add_003.phpt
@@ -10,8 +10,8 @@ $o->prop = "value";
try {
var_dump($o + $a);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..dbdd26cad75a 100644
--- a/Zend/tests/add_004.phpt
+++ b/Zend/tests/add_004.phpt
@@ -7,8 +7,8 @@ $a = array(1,2,3);
try {
var_dump($a + 5);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..f51397cbec7c 100644
--- a/Zend/tests/add_006.phpt
+++ b/Zend/tests/add_006.phpt
@@ -14,8 +14,8 @@ $s4 = "25.68";
try {
$c = $i + $s1;
var_dump($c);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = $i + $s2;
var_dump($c);
@@ -29,8 +29,8 @@ var_dump($c);
try {
$c = $s1 + $i;
var_dump($c);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..fb3d5522d5f5 100644
--- a/Zend/tests/add_007.phpt
+++ b/Zend/tests/add_007.phpt
@@ -9,8 +9,8 @@ $s1 = "some string";
try {
var_dump($a + $s1);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..32c624eee2d3 100644
--- a/Zend/tests/arg_unpack/invalid_type.phpt
+++ b/Zend/tests/arg_unpack/invalid_type.phpt
@@ -9,29 +9,29 @@ function test(...$args) {
try {
test(...null);
-} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...42);
-} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new stdClass);
-} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(1, 2, 3, ..."foo", ...[4, 5]);
-} catch (Error $e) {
- echo $e::class . ": " . $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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..daf7d3c58a76 100644
--- a/Zend/tests/arg_unpack/non_integer_keys.phpt
+++ b/Zend/tests/arg_unpack/non_integer_keys.phpt
@@ -12,10 +12,10 @@ function gen() {
try {
foo(...gen());
-} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+ 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..3d1d1c866d58 100644
--- a/Zend/tests/arg_unpack/string_keys.phpt
+++ b/Zend/tests/arg_unpack/string_keys.phpt
@@ -9,10 +9,10 @@ set_error_handler(function($errno, $errstr) {
try {
var_dump(...new ArrayIterator([1, 2, "foo" => 3, 4]));
-} catch (Error $ex) {
- var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+ 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..25c5da8df29d 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try {
test(1, 2, ...gen(), ...[3, 4]);
-} catch (Exception $e) { var_dump($e->getMessage()); }
+} catch (Throwable $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..33ce9e7c35b3 100644
--- a/Zend/tests/array_literal_next_element_error.phpt
+++ b/Zend/tests/array_literal_next_element_error.phpt
@@ -7,18 +7,18 @@ $i = PHP_INT_MAX;
try {
$array = [$i => 42, new stdClass];
var_dump($array);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function test($x = [PHP_INT_MAX => 42, "foo"]) {}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3f031c082f95 100644
--- a/Zend/tests/array_unpack/already_occupied.phpt
+++ b/Zend/tests/array_unpack/already_occupied.phpt
@@ -8,26 +8,26 @@ Appending to an array via unpack may fail
$arr = [1, 2, 3];
try {
var_dump([PHP_INT_MAX-1 => 0, ...$arr]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump([PHP_INT_MAX-1 => 0, ...[1, 2, 3]]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
const ARR = [1, 2, 3];
function test($x = [PHP_INT_MAX-1 => 0, ...ARR]) {}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7a1f95552338 100644
--- a/Zend/tests/array_unpack/classes.phpt
+++ b/Zend/tests/array_unpack/classes.phpt
@@ -19,8 +19,8 @@ var_dump(C::$bar);
try {
var_dump(D::A);
-} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+ 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..099a928ffdd7 100644
--- a/Zend/tests/array_unpack/non_integer_keys.phpt
+++ b/Zend/tests/array_unpack/non_integer_keys.phpt
@@ -9,10 +9,10 @@ function gen() {
try {
[...gen()];
-} catch (Error $ex) {
- echo "Exception: " . $ex->getMessage() . "\n";
+} catch (Throwable $ex) {
+ 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..15e1d18d7e0f 100644
--- a/Zend/tests/arrow_functions/006.phpt
+++ b/Zend/tests/arrow_functions/006.phpt
@@ -16,23 +16,23 @@ $int_fn = fn(int $x): int => $x;
var_dump($int_fn($var));
try {
$int_fn("foo");
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$varargs = fn(?int... $args): array => $args;
var_dump($varargs(20, null, 30));
try {
$varargs(40, "foo");
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7b63b1ba1520 100644
--- a/Zend/tests/arrow_functions/007.phpt
+++ b/Zend/tests/arrow_functions/007.phpt
@@ -7,17 +7,17 @@ zend.assertions=1
try {
assert((fn() => false)());
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert((fn&(int... $args): ?bool => $args[0])(false));
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..cfe09ba6cc4c 100644
--- a/Zend/tests/arrow_functions/gh7900.phpt
+++ b/Zend/tests/arrow_functions/gh7900.phpt
@@ -10,17 +10,17 @@ $x = fn(): never => throw new \Exception('Here');
try {
var_dump($x());
-} catch (\Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert((fn(): never => 42) && false);
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..57aa6706de16 100644
--- a/Zend/tests/assert/bug70528.phpt
+++ b/Zend/tests/assert/bug70528.phpt
@@ -11,21 +11,21 @@ class Bar {}
$bar = "Bar";
try {
assert(new \stdClass instanceof $bar);
-} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(new \stdClass instanceof Bar);
-} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(new \stdClass instanceof \Foo\Bar);
-} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..e996b97dba41 100644
--- a/Zend/tests/assert/bug71922.phpt
+++ b/Zend/tests/assert/bug71922.phpt
@@ -10,12 +10,12 @@ try {
assert(0 && new class {
} && new class(42) extends stdclass {
});
-} catch (AssertionError $e) {
- echo "Assertion failure: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6701718daa8e 100644
--- a/Zend/tests/assert/expect_003.phpt
+++ b/Zend/tests/assert/expect_003.phpt
@@ -7,9 +7,9 @@ assert.exception=1
getMessage());
+} catch (Throwable $ex) {
+ 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..c89741d5b3d1 100644
--- a/Zend/tests/assert/expect_004.phpt
+++ b/Zend/tests/assert/expect_004.phpt
@@ -7,9 +7,9 @@ assert.exception=1
getMessage());
+} catch (Throwable $ex) {
+ 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..07747665c569 100644
--- a/Zend/tests/assert/expect_005.phpt
+++ b/Zend/tests/assert/expect_005.phpt
@@ -8,8 +8,8 @@ assert.exception=1
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());
+} catch (Throwable $ex) {
+ 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..5834b99d9dad 100644
--- a/Zend/tests/assert/expect_015.phpt
+++ b/Zend/tests/assert/expect_015.phpt
@@ -19,8 +19,8 @@ assert(0 && ($a = function () {
yield 1 => 2;
yield from $x;
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -68,8 +68,8 @@ assert(0 && ($a = function &(array &$a, ?X $b = null) use ($c,&$d) : ?X {
}
}
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -104,8 +104,8 @@ L0:
}
}
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -120,8 +120,8 @@ assert(0 && ($a = function &(?array &$a, X $b = null) use ($c,&$d) : X {
use T3;
}
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -137,8 +137,8 @@ assert(0 && ($a = function &(array &...$a) {
echo 3;
}
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -165,13 +165,13 @@ assert(0 && ($a = function (): ?static {
}
if ($a); else;
}));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..ad738aef482f 100644
--- a/Zend/tests/assert/expect_016.phpt
+++ b/Zend/tests/assert/expect_016.phpt
@@ -10,8 +10,8 @@ var_dump(assert(true));
ini_set("zend.assertions", 1);
try {
var_dump(assert(false));
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..7a927d0a65e3 100644
--- a/Zend/tests/assert/expect_018.phpt
+++ b/Zend/tests/assert/expect_018.phpt
@@ -14,14 +14,14 @@ var_dump(assert(true));
ini_set("zend.assertions", 1);
try {
var_dump(\assert(false));
-} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(\assert(true));
try {
var_dump(assert(false));
-} catch (\AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..0ee2a93a8b7b 100644
--- a/Zend/tests/assign_dim_obj_null_return.phpt
+++ b/Zend/tests/assign_dim_obj_null_return.phpt
@@ -9,61 +9,61 @@ function test() {
try {
var_dump($array[] = 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[[]] = 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[new stdClass] = 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true[123] = 456);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[] += 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[[]] += 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($array[new stdClass] += 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true[123] += 456);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true->foo = 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($true->foo += 123);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..3068e0ca48be 100644
--- a/Zend/tests/assign_op_type_error.phpt
+++ b/Zend/tests/assign_op_type_error.phpt
@@ -6,52 +6,52 @@ TypeError for compound assignment operations
$x = [];
try {
$x += "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x -= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x *= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x /= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x **= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x %= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x <<= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x >>= "1";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..622746ba0ee9 100644
--- a/Zend/tests/assign_property_null_object.phpt
+++ b/Zend/tests/assign_property_null_object.phpt
@@ -15,8 +15,8 @@ print "ok\n";
try {
$test->a()->a = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3fbbcefe337a 100644
--- a/Zend/tests/assign_ref_error_var_handling.phpt
+++ b/Zend/tests/assign_ref_error_var_handling.phpt
@@ -11,20 +11,20 @@ $var = 24;
$arr = [PHP_INT_MAX => "foo"];
try {
var_dump($arr[] =& $var);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(count($arr));
try {
var_dump($arr[] =& val());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..52541e28e06f 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 (Throwable $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..85e5dd6fbb66 100644
--- a/Zend/tests/ast/ast_serialize_backtick_literal.phpt
+++ b/Zend/tests/ast/ast_serialize_backtick_literal.phpt
@@ -7,10 +7,10 @@ zend.assertions=1
try {
assert(false && `echo -n ""`);
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..73426b0ded3b 100644
--- a/Zend/tests/ast/ast_serialize_floats.phpt
+++ b/Zend/tests/ast/ast_serialize_floats.phpt
@@ -6,21 +6,21 @@ zend.assertions=1
getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(!is_float(1.1));
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(!is_float(1234.5678));
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..88b9d0e00304 100644
--- a/Zend/tests/ast/gh21072.phpt
+++ b/Zend/tests/ast/gh21072.phpt
@@ -9,8 +9,8 @@ try {
public $p = (unset) C::class;
}
new C;
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
diff --git a/Zend/tests/ast/zend-pow-assign.phpt b/Zend/tests/ast/zend-pow-assign.phpt
index fd8bf8346cec..98ad319fc7a2 100644
--- a/Zend/tests/ast/zend-pow-assign.phpt
+++ b/Zend/tests/ast/zend-pow-assign.phpt
@@ -7,9 +7,9 @@ zend.assertions=1
try {
assert(false && ($a **= 2));
-} catch (AssertionError $e) {
- echo 'assert(): ', $e->getMessage(), ' failed', PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..17c6aaef1bd2 100644
--- a/Zend/tests/asymmetric_visibility/__set.phpt
+++ b/Zend/tests/asymmetric_visibility/__set.phpt
@@ -22,15 +22,15 @@ class Foo {
$foo = new Foo();
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBar('baz');
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ca065080bf98 100644
--- a/Zend/tests/asymmetric_visibility/__unset.phpt
+++ b/Zend/tests/asymmetric_visibility/__unset.phpt
@@ -22,8 +22,8 @@ class Foo {
function test($foo) {
try {
unset($foo->bar);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..aabf2a3df2c2 100644
--- a/Zend/tests/asymmetric_visibility/ast_printing.phpt
+++ b/Zend/tests/asymmetric_visibility/ast_printing.phpt
@@ -13,13 +13,13 @@ try {
public protected(set) string $baz;
}
} && false);
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..28c4e9c8c626 100644
--- a/Zend/tests/asymmetric_visibility/bug001.phpt
+++ b/Zend/tests/asymmetric_visibility/bug001.phpt
@@ -19,14 +19,14 @@ class D extends C {
$c = new D();
try {
unset($c->a);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..bca8864f29f1 100644
--- a/Zend/tests/asymmetric_visibility/bug002.phpt
+++ b/Zend/tests/asymmetric_visibility/bug002.phpt
@@ -19,14 +19,14 @@ class D extends C {
$c = new D();
try {
$c->a = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..af840222be71 100644
--- a/Zend/tests/asymmetric_visibility/bug003.phpt
+++ b/Zend/tests/asymmetric_visibility/bug003.phpt
@@ -13,16 +13,16 @@ class C {
$c = new C();
try {
$c->a = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($c->a);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4430f88f4f92 100644
--- a/Zend/tests/asymmetric_visibility/cpp_private.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_private.phpt
@@ -18,8 +18,8 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5cb6be2c99ac 100644
--- a/Zend/tests/asymmetric_visibility/cpp_protected.phpt
+++ b/Zend/tests/asymmetric_visibility/cpp_protected.phpt
@@ -24,8 +24,8 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9038f1d3186d 100644
--- a/Zend/tests/asymmetric_visibility/dim_add.phpt
+++ b/Zend/tests/asymmetric_visibility/dim_add.phpt
@@ -15,8 +15,8 @@ $foo = new Foo();
try {
$foo->bars[] = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/optimizer_shared_cache_slot.phpt b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
index 2e24ad1f8d03..96c08c840dc8 100644
--- a/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
+++ b/Zend/tests/asymmetric_visibility/optimizer_shared_cache_slot.phpt
@@ -14,8 +14,8 @@ class C extends P {
var_dump($this->prop);
try {
$this->prop = 'overwritten';
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($this->prop);
}
@@ -27,8 +27,8 @@ $c->test();
?>
--EXPECT--
string(7) "default"
-Cannot modify private(set) property P::$prop from scope C
+Error: Cannot modify private(set) property P::$prop from scope C
string(7) "default"
string(7) "default"
-Cannot modify private(set) property P::$prop from scope C
+Error: Cannot modify private(set) property P::$prop from scope C
string(7) "default"
diff --git a/Zend/tests/asymmetric_visibility/private.phpt b/Zend/tests/asymmetric_visibility/private.phpt
index 48e557c6e87d..bcdb33b39ffd 100644
--- a/Zend/tests/asymmetric_visibility/private.phpt
+++ b/Zend/tests/asymmetric_visibility/private.phpt
@@ -28,8 +28,8 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBar('baz');
@@ -37,8 +37,8 @@ var_dump($foo->bar);
try {
$foo->baz = 'baz2';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBaz('baz2');
@@ -47,15 +47,15 @@ var_dump($foo->baz);
$child = new FooChild();
try {
$child->modifyBar('baz');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9c79752c23c7 100644
--- a/Zend/tests/asymmetric_visibility/protected.phpt
+++ b/Zend/tests/asymmetric_visibility/protected.phpt
@@ -32,8 +32,8 @@ var_dump($foo->bar);
try {
$foo->bar = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$foo->setBarPrivate('baz');
@@ -44,8 +44,8 @@ var_dump($foo->bar);
try {
$foo->baz = 'baz';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d8ae18bb1bea 100644
--- a/Zend/tests/asymmetric_visibility/readonly.phpt
+++ b/Zend/tests/asymmetric_visibility/readonly.phpt
@@ -22,8 +22,8 @@ class C extends P {
$this->pDefault = 1;
try {
$this->pPrivate = 1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$this->pProtected = 1;
$this->pPublic = 1;
@@ -34,18 +34,18 @@ function test() {
$p = new ReflectionClass(P::class)->newInstanceWithoutConstructor();
try {
$p->pDefault = 1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->pPrivate = 1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$p->pProtected = 1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..34c0324b988e 100644
--- a/Zend/tests/asymmetric_visibility/reference.phpt
+++ b/Zend/tests/asymmetric_visibility/reference.phpt
@@ -17,8 +17,8 @@ $foo = new Foo();
try {
$bar = &$foo->bar;
$bar++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ba5c0e5ac2be 100644
--- a/Zend/tests/asymmetric_visibility/reference_2.phpt
+++ b/Zend/tests/asymmetric_visibility/reference_2.phpt
@@ -14,17 +14,17 @@ function test($c) {
try {
test(new C());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(new C());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4351e8796e5d 100644
--- a/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
+++ b/Zend/tests/asymmetric_visibility/scope_rebinding.phpt
@@ -18,19 +18,19 @@ $c = function () use ($foo) {
var_dump($foo->bar);
try {
$c();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
($c->bindTo(null, Bar::class))();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..1bba69bebd4e 100644
--- a/Zend/tests/asymmetric_visibility/static_props.phpt
+++ b/Zend/tests/asymmetric_visibility/static_props.phpt
@@ -29,8 +29,8 @@ function test() {
try {
C::$prop = 2;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
@@ -39,30 +39,30 @@ function test() {
try {
++C::$prop;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop++;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop += str_repeat('a', 10);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
$ref = &C::$prop;
$ref++;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
@@ -70,15 +70,15 @@ function test() {
$ref = 4;
C::$prop = &$ref;
$ref++;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(C::$prop);
try {
C::$prop2[] = 'foo';
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..039bdb84bb40 100644
--- a/Zend/tests/asymmetric_visibility/unset.phpt
+++ b/Zend/tests/asymmetric_visibility/unset.phpt
@@ -36,8 +36,8 @@ $foo = new FooChild();
$foo->setBar('bar');
try {
unset($foo->bar);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo->bar ?? 'unset');
@@ -52,16 +52,16 @@ var_dump($foo->bar ?? 'unset');
$foo->setSecret('beep');
try {
$foo->unsetSecret();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9c57c85a30a9 100644
--- a/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
+++ b/Zend/tests/asymmetric_visibility/unshared_rw_cache_slot.phpt
@@ -17,20 +17,20 @@ class C extends P {
$c = new C();
try {
$c->setBar(1);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->setBar(1);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..2d47a89e78b4 100644
--- a/Zend/tests/attributes/003_ast_nodes.phpt
+++ b/Zend/tests/attributes/003_ast_nodes.phpt
@@ -71,14 +71,14 @@ var_dump(count($attr));
try {
$attr[0]->getArguments();
-} catch (\Error $e) {
- var_dump($e->getMessage());
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$attr[0]->newInstance();
-} catch (\Error $e) {
- var_dump($e->getMessage());
+} catch (\Throwable $e) {
+ 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..4e0bd69ce3c2 100644
--- a/Zend/tests/attributes/005_objects.phpt
+++ b/Zend/tests/attributes/005_objects.phpt
@@ -30,8 +30,8 @@ $ref = new \ReflectionFunction(#[A1] function () { });
try {
$ref->getAttributes()[0]->newInstance();
-} catch (\ArgumentCountError $e) {
- var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -40,8 +40,8 @@ $ref = new \ReflectionFunction(#[A1([])] function () { });
try {
$ref->getAttributes()[0]->newInstance();
-} catch (\TypeError $e) {
- var_dump('ERROR 2', $e->getMessage());
+} catch (\Throwable $e) {
+ echo 'ERROR 2: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -50,8 +50,8 @@ $ref = new \ReflectionFunction(#[A2] function () { });
try {
$ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
- var_dump('ERROR 3', $e->getMessage());
+} catch (\Throwable $e) {
+ echo 'ERROR 3: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -66,8 +66,8 @@ $ref = new \ReflectionFunction(#[A3] function () { });
try {
$ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
- var_dump('ERROR 4', $e->getMessage());
+} catch (\Throwable $e) {
+ echo 'ERROR 4: ', $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -78,8 +78,8 @@ $ref = new \ReflectionFunction(#[A5] function () { });
try {
$ref->getAttributes()[0]->newInstance();
-} catch (\Error $e) {
- var_dump('ERROR 6', $e->getMessage());
+} catch (\Throwable $e) {
+ 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..badbe9f9a5b3 100644
--- a/Zend/tests/attributes/006_filter.phpt
+++ b/Zend/tests/attributes/006_filter.phpt
@@ -56,16 +56,16 @@ $ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(A1::class, 3);
-} catch (\Error $e) {
- var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+ echo 'ERROR 1: ', $e::class, ': ', $e->getMessage(), "\n";
}
$ref = new \ReflectionFunction(function () { });
try {
$ref->getAttributes(SomeMissingClass::class, \ReflectionAttribute::IS_INSTANCEOF);
-} catch (\Error $e) {
- var_dump('ERROR 2', $e->getMessage());
+} catch (\Throwable $e) {
+ 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..d3991ad9f1c8 100644
--- a/Zend/tests/attributes/013_class_scope.phpt
+++ b/Zend/tests/attributes/013_class_scope.phpt
@@ -46,8 +46,8 @@ $attr = $ref->getMethod('foo')->getAttributes()[0];
try {
$attr->getArguments();
-} catch (\Error $e) {
- var_dump('ERROR 1', $e->getMessage());
+} catch (\Throwable $e) {
+ 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..fbcb598d135a 100644
--- a/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
+++ b/Zend/tests/attributes/021_attribute_flags_type_is_validated.phpt
@@ -11,10 +11,10 @@ class Foo {}
try {
(new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d06b92aad79c 100644
--- a/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
+++ b/Zend/tests/attributes/022_attribute_flags_value_is_validated.phpt
@@ -11,10 +11,10 @@ class Foo { }
try {
var_dump((new ReflectionClass(Foo::class))->getAttributes()[0]->newInstance());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..10b2101d1747 100644
--- a/Zend/tests/attributes/023_ast_node_in_validation.phpt
+++ b/Zend/tests/attributes/023_ast_node_in_validation.phpt
@@ -11,10 +11,10 @@ class Bar { }
try {
var_dump((new ReflectionClass(Bar::class))->getAttributes()[0]->newInstance());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..43ff78e0720d 100644
--- a/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/has_runtime_errors.phpt
@@ -65,8 +65,8 @@ foreach ($cases as $r) {
var_dump($attributes);
try {
$attributes[1]->newInstance();
- } catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..7fd5ef63b404 100644
--- a/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/opcache_validator_errors.phpt
@@ -19,8 +19,8 @@ $attributes = $r->getAttributes();
var_dump($attributes);
try {
$attributes[1]->newInstance();
-} catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..57063a55fbaa 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_AllowDynamicProperties.phpt
@@ -32,8 +32,8 @@ foreach ($cases as $r) {
var_dump($attributes);
try {
$attributes[1]->newInstance();
- } catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..ad618c84aca7 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Attribute.phpt
@@ -32,8 +32,8 @@ foreach ($cases as $r) {
var_dump($attributes);
try {
$attributes[1]->newInstance();
- } catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..8e0e6f4fbf35 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_Deprecated.phpt
@@ -27,8 +27,8 @@ foreach ($cases as $r) {
var_dump($attributes);
try {
$attributes[1]->newInstance();
- } catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..3009315b6c4e 100644
--- a/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
+++ b/Zend/tests/attributes/delayed_target_validation/validator_NoDiscard.phpt
@@ -25,8 +25,8 @@ foreach ($cases as $r) {
var_dump($attributes);
try {
$attributes[1]->newInstance();
- } catch (Error $e) {
- echo get_class($e) . ": " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..97fdf986d287 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
@@ -20,17 +20,17 @@ class Clazz {
try {
Clazz::TEST;
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Clazz::TEST3;
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..6d12af0f2419 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
@@ -18,17 +18,17 @@ const TEST3 = 1;
try {
TEST;
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
TEST3;
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..e4d1c4807d74 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_001.phpt
@@ -14,8 +14,8 @@ function test() {
try {
test();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
eval(<<<'CODE'
@@ -27,8 +27,8 @@ CODE);
try {
test2();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Clazz {
@@ -41,8 +41,8 @@ class Clazz {
try {
$cls = new Clazz();
$cls->test();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$closure = #[\Deprecated("convert to exception")] function () {
@@ -51,8 +51,8 @@ $closure = #[\Deprecated("convert to exception")] function () {
try {
$closure();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Constructor {
@@ -64,8 +64,8 @@ class Constructor {
try {
new Constructor();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Destructor {
@@ -77,15 +77,15 @@ class Destructor {
try {
new Destructor();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..0b8395aaae61 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_002.phpt
@@ -12,10 +12,10 @@ function test() {}
try {
$x = test();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..00efe2b69637 100644
--- a/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
+++ b/Zend/tests/attributes/deprecated/functions/throwing_error_handler_003.phpt
@@ -12,10 +12,10 @@ function test($dummy) {}
try {
$x = test(new stdClass());
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..0a8d2f8bbe78 100644
--- a/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
+++ b/Zend/tests/attributes/nodiscard/throwing_error_handler_001.phpt
@@ -14,8 +14,8 @@ function test(): int {
try {
test();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
#[\NoDiscard]
@@ -25,11 +25,11 @@ function test2(): stdClass {
try {
test2();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..1959affaca6e 100644
--- a/Zend/tests/attributes/ossfuzz371445205.phpt
+++ b/Zend/tests/attributes/ossfuzz371445205.phpt
@@ -9,9 +9,9 @@ class Test1{}
$attr=(new ReflectionClass(Test1::class))->getAttributes()[0];
try {
$attr->newInstance();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5cf689047601 100644
--- a/Zend/tests/bind_static_exception.phpt
+++ b/Zend/tests/bind_static_exception.phpt
@@ -10,9 +10,9 @@ class Test {
try {
$new = new Test;
static $new;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c8b0c44c1806 100644
--- a/Zend/tests/bitwise_not_precision_exception.phpt
+++ b/Zend/tests/bitwise_not_precision_exception.phpt
@@ -7,9 +7,9 @@ set_error_handler(function($_, $msg) {
});
try {
var_dump(~INF);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d25fc7fcd5d7 100644
--- a/Zend/tests/bug26229.phpt
+++ b/Zend/tests/bug26229.phpt
@@ -19,10 +19,10 @@ try
var_dump($value);
}
}
-catch(Exception $e)
+catch(Throwable $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..b20d7f10923f 100644
--- a/Zend/tests/bug31098.phpt
+++ b/Zend/tests/bug31098.phpt
@@ -19,8 +19,8 @@ $simpleString = "Bogus String Text";
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;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo isset($simpleString[-20])?"bug\n":"ok\n";
echo isset($simpleString[0])?"ok\n":"bug\n";
@@ -30,15 +30,15 @@ echo isset($simpleString["17"])?"bug\n":"ok\n";
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;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..db04ef108ad5 100644
--- a/Zend/tests/bug31720.phpt
+++ b/Zend/tests/bug31720.phpt
@@ -6,10 +6,10 @@ $array = array('at least one element');
try {
array_walk($array, array($nonesuchvar,'show'));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..dadd5a51ef23 100644
--- a/Zend/tests/bug37811.phpt
+++ b/Zend/tests/bug37811.phpt
@@ -19,8 +19,8 @@ define("Baz", new stdClass);
var_dump(Baz);
try {
var_dump((string) Baz);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5a5c66f7216b 100644
--- a/Zend/tests/bug44660.phpt
+++ b/Zend/tests/bug44660.phpt
@@ -11,36 +11,36 @@ echo $a->p;
echo "\n--> direct assignment:\n";
try {
$a->p = $s;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> increment:\n";
try {
$a->p++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> reference assignment:\n";
try {
$a->p =& $s;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> reference assignment:\n";
try {
$s =& $a->p;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n--> indexed assignment:\n";
try {
$a->p[0] = $s;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..dbb4a1bce219 100644
--- a/Zend/tests/bug46106.phpt
+++ b/Zend/tests/bug46106.phpt
@@ -17,11 +17,11 @@ function test($x) {
$x = new ReflectionFunction('str_pad');
try {
test($x);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..41657a79d59b 100644
--- a/Zend/tests/bug47836.phpt
+++ b/Zend/tests/bug47836.phpt
@@ -6,14 +6,14 @@ Bug #47836 (array operator [] inconsistency when the array has PHP_INT_MAX index
$arr[PHP_INT_MAX] = 1;
try {
$arr[] = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..db53f2f78d89 100644
--- a/Zend/tests/bug49893.phpt
+++ b/Zend/tests/bug49893.phpt
@@ -6,8 +6,8 @@ class A {
function __destruct() {
try {
throw new Exception("2");
- } catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -20,10 +20,10 @@ class B {
}
try {
$b = new B();
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ 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..76ba011e743c 100644
--- a/Zend/tests/bug52041.phpt
+++ b/Zend/tests/bug52041.phpt
@@ -8,33 +8,33 @@ function foo() {
try {
foo()->a = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a += 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foo()->a->b += 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..959f637e956c 100644
--- a/Zend/tests/bug52355.phpt
+++ b/Zend/tests/bug52355.phpt
@@ -12,8 +12,8 @@ var_dump($foo);
try {
var_dump(1.0 / -0.0);
-} catch (\DivisionByZeroError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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..c5cb4375dfd3 100644
--- a/Zend/tests/bug52614.phpt
+++ b/Zend/tests/bug52614.phpt
@@ -54,8 +54,8 @@ var_dump($foo->a3);
try {
$foo->f4()->a = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f7573c0ba041 100644
--- a/Zend/tests/bug53432.phpt
+++ b/Zend/tests/bug53432.phpt
@@ -18,32 +18,32 @@ var_dump($str);
$str = '';
try {
var_dump($str['foo'] = 'a');
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[] = 'a');
-} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0] += 1);
-} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str);
$str = '';
try {
var_dump($str[0][0] = 'a');
-} catch (Error $e) {
- echo "Error: {$e->getMessage()}\n";
+} catch (Throwable $e) {
+ 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..7e723e06de10 100644
--- a/Zend/tests/bug63882.phpt
+++ b/Zend/tests/bug63882.phpt
@@ -11,10 +11,10 @@ $testobj2->x = $testobj2;
try {
var_dump($testobj1 == $testobj2);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a6a54fd4aa39 100644
--- a/Zend/tests/bug65784.phpt
+++ b/Zend/tests/bug65784.phpt
@@ -16,9 +16,9 @@ function foo1() {
try {
$foo = foo1();
var_dump($foo);
-} catch (Exception $e) {
+} catch (Throwable $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..c106fbe470b9 100644
--- a/Zend/tests/bug69017.phpt
+++ b/Zend/tests/bug69017.phpt
@@ -18,8 +18,8 @@ c1::$a1[] = 1;
c1::$a2[] = 1;
try {
c1::$a3[] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f20d0d1c0357 100644
--- a/Zend/tests/bug69315.phpt
+++ b/Zend/tests/bug69315.phpt
@@ -9,42 +9,42 @@ var_dump(function_exists("strlen"));
var_dump(is_callable("strlen"));
try {
var_dump(strlen("xxx"));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(defined("PHP_VERSION"));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(constant("PHP_VERSION"));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(call_user_func("strlen"));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string("xxx"));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(is_string());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..288f2f1eec82 100644
--- a/Zend/tests/bug70083.phpt
+++ b/Zend/tests/bug70083.phpt
@@ -15,14 +15,14 @@ function &noref() { $foo = 1; return $foo; }
$foo = new foo;
try {
$foo->i = &noref();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..94a660d4a4a2 100644
--- a/Zend/tests/bug70089.phpt
+++ b/Zend/tests/bug70089.phpt
@@ -7,29 +7,29 @@ function dummy($a) {
try {
chr(0)[0][] = 1;
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset(chr(0)[0][0]);
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
eval("function runtimetest(&\$a) {} ");
try {
runtimetest(chr(0)[0]);
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++chr(0)[0];
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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/bug70895.phpt b/Zend/tests/bug70895.phpt
index afbea1c91d76..c3b2edf957e4 100644
--- a/Zend/tests/bug70895.phpt
+++ b/Zend/tests/bug70895.phpt
@@ -5,21 +5,21 @@ Bug #70895 null ptr deref and segfault with crafted callable
try {
array_map("%n", 0);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i", 0);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_map("%n %i aoeu %f aoeu %p", 0);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3a41f4d767e5 100644
--- a/Zend/tests/bug70898.phpt
+++ b/Zend/tests/bug70898.phpt
@@ -8,9 +8,9 @@ function m($f,$a){
try {
echo implode(m("",m("",m("",m("",m("0000000000000000000000000000000000",("")))))));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..323428ac5d99 100644
--- a/Zend/tests/bug70914.phpt
+++ b/Zend/tests/bug70914.phpt
@@ -9,9 +9,9 @@ $db = new PDO('sqlite::memory:');
$st = $db->query('SELECT 1');
try {
$re = $st->fetchObject('%Z');
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..cb11c3e89532 100644
--- a/Zend/tests/bug70918.phpt
+++ b/Zend/tests/bug70918.phpt
@@ -4,44 +4,44 @@ Bug #70918 (Segfault using static outside of class scope)
getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
parent::x;
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::x;
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new static;
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
static::x();
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
static::$i;
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..cef48b222127 100644
--- a/Zend/tests/bug71196.phpt
+++ b/Zend/tests/bug71196.phpt
@@ -5,9 +5,9 @@ Bug #71196 (Memory leak with out-of-order live ranges)
try {
$a = "1";
[1, (y().$a.$a) . ($a.$a)];
-} catch (Error $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..46edce32a29b 100644
--- a/Zend/tests/bug71572.phpt
+++ b/Zend/tests/bug71572.phpt
@@ -6,29 +6,29 @@ Bug #71572: String offset assignment from an empty string inserts null byte
$str = "abc";
try {
var_dump($str[0] = "");
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($str[1] = "");
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($str[3] = "");
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($str[10] = "");
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..54d6d6ae88dc 100644
--- a/Zend/tests/bug72038.phpt
+++ b/Zend/tests/bug72038.phpt
@@ -6,14 +6,14 @@ Bug #72038 (Function calls with values to a by-ref parameter don't always throw
try {
test($foo = new stdClass);
var_dump($foo);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test($bar = 2);
var_dump($bar);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..01cf33588248 100644
--- a/Zend/tests/bug72107.phpt
+++ b/Zend/tests/bug72107.phpt
@@ -8,9 +8,9 @@ function test($a) {
}
try {
test(1);
-} catch (\Error $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..91509fb227f1 100644
--- a/Zend/tests/bug74084.phpt
+++ b/Zend/tests/bug74084.phpt
@@ -8,30 +8,30 @@ $$A += $$B['a'] = &$$C;
unset($$A);
try {
$$A -= $$B['a'] = &$$C;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A *= $$B['a'] = &$$C;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A /= $$B['a'] = &$$C;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($$A);
try {
$$A **= $$B['a'] = &$$C;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a0372c4798ab 100644
--- a/Zend/tests/bug75218.phpt
+++ b/Zend/tests/bug75218.phpt
@@ -6,8 +6,8 @@ Bug #75218: Change remaining uncatchable fatal errors for parsing into ParseErro
function try_eval($code) {
try {
eval($code);
- } catch (CompileError $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..454257ca44bc 100644
--- a/Zend/tests/bug75252.phpt
+++ b/Zend/tests/bug75252.phpt
@@ -12,17 +12,17 @@ CODE;
try {
eval($code);
-} catch (ParseError $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
eval($code);
-} catch (ParseError $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..56db3edb2669 100644
--- a/Zend/tests/bug75921.phpt
+++ b/Zend/tests/bug75921.phpt
@@ -5,63 +5,63 @@ Bug #75921: Inconsistent error when creating stdObject from empty variable
try {
$null->a = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a['hello'] = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a->b = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a['hello']->b = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($null);
unset($null);
try {
$null->a->b['hello'] = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..37a1e009f51c 100644
--- a/Zend/tests/bug78154.phpt
+++ b/Zend/tests/bug78154.phpt
@@ -7,8 +7,8 @@ namespace {
try {
var_dump(similar_text('a', 'a', $c=0x44444444));
var_dump($c);
- } catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..b5aa2d0bb542 100644
--- a/Zend/tests/bug78182.phpt
+++ b/Zend/tests/bug78182.phpt
@@ -6,11 +6,11 @@ $varName = 'var';
$propName = 'prop';
try {
$$varName->$propName =& $$varName;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4f2d2e9d1b98 100644
--- a/Zend/tests/bug78531.phpt
+++ b/Zend/tests/bug78531.phpt
@@ -4,34 +4,34 @@ Bug #78531 (Crash when using undefined variable as object)
a += 5;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x = ++$u2->a;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x = $u3->a++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$u4->a->a += 5;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9ca4c2a14a0c 100644
--- a/Zend/tests/bug78810.phpt
+++ b/Zend/tests/bug78810.phpt
@@ -10,16 +10,16 @@ class Test {
$test = new Test;
try {
$test->i++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->i += 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f0a35b66964b 100644
--- a/Zend/tests/bug78926.phpt
+++ b/Zend/tests/bug78926.phpt
@@ -11,12 +11,12 @@ spl_autoload_register(function($class) {
try {
class B extends A {}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5de37578fa79 100644
--- a/Zend/tests/bug79599.phpt
+++ b/Zend/tests/bug79599.phpt
@@ -13,15 +13,15 @@ function test2(){
}
try{
test1();
-}catch(\Exception $e){
- var_dump($e->getMessage());
+}catch(\Throwable $e){
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try{
test2();
-}catch(\Exception $e){
- var_dump($e->getMessage());
+}catch(\Throwable $e){
+ 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..4e74631855ed 100644
--- a/Zend/tests/bug79947.phpt
+++ b/Zend/tests/bug79947.phpt
@@ -6,12 +6,12 @@ $array = [];
$key = [];
try {
$array[$key] += [$key];
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6ca8623f8328 100644
--- a/Zend/tests/bug80972.phpt
+++ b/Zend/tests/bug80972.phpt
@@ -19,8 +19,8 @@ try {
echo 'Float casted to string compile', \PHP_EOL;
$string[(string) 10e120] = 'E';
var_dump($string);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
/* 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(), "\n";
}
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..12771d287170 100644
--- a/Zend/tests/call_to_abstract_method_args.phpt
+++ b/Zend/tests/call_to_abstract_method_args.phpt
@@ -9,18 +9,18 @@ abstract class Test {
try {
Test::method(new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = Test::method(new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..99da008a90c1 100644
--- a/Zend/tests/call_to_deprecated_function_args.phpt
+++ b/Zend/tests/call_to_deprecated_function_args.phpt
@@ -11,35 +11,35 @@ set_error_handler(function($code, $msg) {
try {
zend_test_deprecated(new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$ret = zend_test_deprecated(new stdClass());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$fn = 'zend_test_deprecated';
$fn(new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ret = new stdClass;
try {
$fn = 'zend_test_deprecated';
$ret = $fn(new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e52301a70d1d 100644
--- a/Zend/tests/call_user_functions/call_user_func_001.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_001.phpt
@@ -24,18 +24,18 @@ namespace testing {
$class = __NAMESPACE__ .'\foo';
try {
call_user_func(array(new $class, 'priv'), 'foobar');
- } catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array(new $class, 'prot'), 'foobar');
- } catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ 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..9d8f5ffaf344 100644
--- a/Zend/tests/call_user_functions/call_user_func_002.phpt
+++ b/Zend/tests/call_user_functions/call_user_func_002.phpt
@@ -9,33 +9,33 @@ spl_autoload_register(function ($class) {
try {
call_user_func(array('foo', 'bar'));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array('', 'bar'));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($foo, 'bar'));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($foo, ''));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0f1d34d21a6f 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
@@ -8,8 +8,8 @@ $array = [1, 2, 3];
try {
$len = [];
call_user_func_array('var_dump', array_slice($array, 0, $len));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6df84210c5ce 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
@@ -9,15 +9,15 @@ $array = [1, 2, 3];
try {
$len = [];
call_user_func_array('var_dump', array_slice($array, 0, $len));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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..dee17a371a46 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
@@ -10,9 +10,9 @@ class drv {
$drv = new drv;
try {
call_user_func_array(array($drv, 'func'), null);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b8370fcafbd5 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
@@ -7,11 +7,11 @@ function test(Type &$ref) {
}
try {
call_user_func('test', 0);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8322c433d67e 100644
--- a/Zend/tests/callable_param_exception_leak.phpt
+++ b/Zend/tests/callable_param_exception_leak.phpt
@@ -7,9 +7,9 @@ spl_autoload_register(function ($class) {
});
try {
array_map('A::b', []);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3d51aa382b9d 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
@@ -5,16 +5,16 @@ Cannot access self::class when no class scope is active
try {
var_dump(self::class);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump([self::class]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8d6627aed210 100644
--- a/Zend/tests/class_name/class_on_object.phpt
+++ b/Zend/tests/class_name/class_on_object.phpt
@@ -16,8 +16,8 @@ function test() {
}
try {
test();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f7ff1aaf5820 100644
--- a/Zend/tests/clone/ast.phpt
+++ b/Zend/tests/clone/ast.phpt
@@ -8,87 +8,87 @@ $x = new stdClass();
try {
assert(false && $y = clone $x);
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x, ));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x, [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x, $array));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x, $array, $extraParameter, $trailingComma, ));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone(object: $x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone($x, withProperties: [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone(object: $x));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone(object: $x, [ "foo" => $foo, "bar" => $bar ]));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone(...["object" => $x, "withProperties" => [ "foo" => $foo, "bar" => $bar ]]));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && $y = clone(...));
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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/closures/bug79778.phpt b/Zend/tests/closures/bug79778.phpt
index fa2e2771dcec..4da0bd4ad0d8 100644
--- a/Zend/tests/closures/bug79778.phpt
+++ b/Zend/tests/closures/bug79778.phpt
@@ -11,8 +11,8 @@ print_r($closure1);
try {
$closure1();
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..073c72836de2 100644
--- a/Zend/tests/closures/closure_015.phpt
+++ b/Zend/tests/closures/closure_015.phpt
@@ -6,16 +6,16 @@ Closure 015: converting to string/unicode
$x = function() { return 1; };
try {
print (string) $x;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
print $x;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..63b836a35cfc 100644
--- a/Zend/tests/closures/closure_021.phpt
+++ b/Zend/tests/closures/closure_021.phpt
@@ -13,10 +13,10 @@ $foo = function() {
try {
$foo();
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..e6ae5063a84c 100644
--- a/Zend/tests/closures/closure_031.phpt
+++ b/Zend/tests/closures/closure_031.phpt
@@ -10,8 +10,8 @@ $foo = function() {
};
try {
var_dump($foo->a);
-} catch (Error $ex) {
- echo "Error: {$ex->getMessage()}\n";
+} catch (Throwable $ex) {
+ 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..82d4aa245c77 100644
--- a/Zend/tests/closures/closure_040.phpt
+++ b/Zend/tests/closures/closure_040.phpt
@@ -26,14 +26,14 @@ $cas = $a->getStaticIncrementor();
try {
$ca->bindTo($a, array());
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4b4620c4aa54 100644
--- a/Zend/tests/closures/closure_059.phpt
+++ b/Zend/tests/closures/closure_059.phpt
@@ -19,21 +19,21 @@ call_user_func(array($f,"__invoke"), $a);
try {
$f($b);
-} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$f->__invoke($b);
-} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func(array($f,"__invoke"), $b);
-} catch (Error $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..12a94ac19269 100644
--- a/Zend/tests/closures/closure_array_key_error.phpt
+++ b/Zend/tests/closures/closure_array_key_error.phpt
@@ -5,10 +5,10 @@ Trying to use lambda as array key
try {
var_dump(array(function() { } => 1));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4ad86277061b 100644
--- a/Zend/tests/closures/closure_array_offset_error.phpt
+++ b/Zend/tests/closures/closure_array_offset_error.phpt
@@ -5,10 +5,10 @@ Trying to use lambda in array offset
try {
$test[function(){}] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..046a1e371fa6 100644
--- a/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
+++ b/Zend/tests/closures/closure_const_expr/attributes_ast_printing.phpt
@@ -13,8 +13,8 @@ try {
})]
function () { }
);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -25,17 +25,17 @@ try {
})]
class {}
);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ae54c6182c69 100644
--- a/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
+++ b/Zend/tests/closures/closure_from_callable_non_static_statically.phpt
@@ -11,10 +11,10 @@ class A {
try {
$fn = Closure::fromCallable(['A', 'method']);
$fn();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e5af665e129f 100644
--- a/Zend/tests/closures/closure_get_current.phpt
+++ b/Zend/tests/closures/closure_get_current.phpt
@@ -23,8 +23,8 @@ function fail() {
try {
fail();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function foo() {
@@ -33,8 +33,8 @@ function foo() {
try {
foo(...)();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..55918966fcc3 100644
--- a/Zend/tests/closures/closure_instantiate.phpt
+++ b/Zend/tests/closures/closure_instantiate.phpt
@@ -8,14 +8,14 @@ Mark Baker mark@lange.demon.co.uk at the PHPNW2017 Conference for PHP Testfest 2
try {
// Closures should be instantiatable using new
$x = new Closure();
-} catch (Exception $e) {
+} catch (Throwable $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(), "\n";
} catch (Throwable $e) {
// This is the message that we should see for a caught error
- echo 'ERROR: ', $e->getMessage();
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..2c0d469d88ab 100644
--- a/Zend/tests/closures/closure_write_prop.phpt
+++ b/Zend/tests/closures/closure_write_prop.phpt
@@ -13,10 +13,10 @@ class A {
$a = new A;
try {
$c = $a->getFn()->b = new stdClass;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ef466865ac12 100644
--- a/Zend/tests/coalesce/assign_coalesce_002.phpt
+++ b/Zend/tests/coalesce/assign_coalesce_002.phpt
@@ -20,8 +20,8 @@ function do_throw($msg) {
$ary = [];
try {
$ary[id($foo)] ??= do_throw("ex1");
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($ary);
@@ -46,8 +46,8 @@ class Dtor {
$ary = new AA;
try {
$ary[new Dtor][id($foo)] ??= $bar;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($foo);
@@ -65,20 +65,20 @@ class AA2 implements ArrayAccess {
$ary = ["foo" => new AA2];
try {
$ary[id($foo)][new Dtor] ??= $bar;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..056394e8ef84 100644
--- a/Zend/tests/compound_assign_with_numeric_strings.phpt
+++ b/Zend/tests/compound_assign_with_numeric_strings.phpt
@@ -11,8 +11,8 @@ $n = "-1";
try {
$n <<= $n;
var_dump($n);
-} catch (ArithmeticError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$n = "65";
@@ -23,16 +23,16 @@ $n = "-1";
try {
$n >>= $n;
var_dump($n);
-} catch (ArithmeticError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$n = "0";
try{
$n %= $n;
var_dump($n);
-} catch (DivisionByZeroError $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..5a8ecaa908ed 100644
--- a/Zend/tests/constant_arrays.phpt
+++ b/Zend/tests/constant_arrays.phpt
@@ -33,8 +33,8 @@ $recursive[0] = &$recursive;
try {
define('RECURSION', $recursive);
-} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..e569cfc5a92b 100644
--- a/Zend/tests/constants/008.phpt
+++ b/Zend/tests/constants/008.phpt
@@ -5,8 +5,8 @@ define() tests
try {
var_dump(define(array(1,2,3,4,5), 1));
-} catch (TypeError $e) {
- echo "TypeError: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..569144e05263 100644
--- a/Zend/tests/constants/018.phpt
+++ b/Zend/tests/constants/018.phpt
@@ -5,8 +5,8 @@ constant() tests
try {
var_dump(constant(""));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b8f39508a86a 100644
--- a/Zend/tests/constants/bug44827.phpt
+++ b/Zend/tests/constants/bug44827.phpt
@@ -5,17 +5,17 @@ Bug #44827 (define() allows :: in constant names)
try {
define('foo::bar', 1);
-} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
define('::', 1);
-} catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..ff104ece7a6b 100644
--- a/Zend/tests/constants/bug51791.phpt
+++ b/Zend/tests/constants/bug51791.phpt
@@ -8,10 +8,10 @@ class A {
}
try {
constant('A::B1');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c5ed2395a393 100644
--- a/Zend/tests/constants/gh10709.phpt
+++ b/Zend/tests/constants/gh10709.phpt
@@ -12,8 +12,8 @@ spl_autoload_register(function ($class) {
try {
new B();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/constants/gh10709_2.phpt b/Zend/tests/constants/gh10709_2.phpt
index 723fa29cc94b..a5a36bce6944 100644
--- a/Zend/tests/constants/gh10709_2.phpt
+++ b/Zend/tests/constants/gh10709_2.phpt
@@ -14,8 +14,8 @@ spl_autoload_register(function ($class) {
try {
var_dump(new B());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6823d38137bb 100644
--- a/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
+++ b/Zend/tests/constexpr/constant_expressions_exceptions_002.phpt
@@ -4,11 +4,11 @@ Constant Expressions with unsupported operands 002
getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+ 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..7cd5611d2235 100644
--- a/Zend/tests/constexpr/new.phpt
+++ b/Zend/tests/constexpr/new.phpt
@@ -5,8 +5,8 @@ new in constant expressions
try {
eval('static $a = new DoesNotExist;');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
static $b = new stdClass;
@@ -14,8 +14,8 @@ var_dump($b);
try {
eval('static $c = new stdClass([] + 0);');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test {
@@ -24,8 +24,8 @@ class Test {
try {
eval('static $d = new Test(new stdClass, [] + 0);');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
static $e = new Test(new stdClass, 42);
@@ -40,17 +40,17 @@ class Test2 {
try {
eval('static $f = new Test2();');
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3ff3ab6679f0 100644
--- a/Zend/tests/constexpr/new_named_params.phpt
+++ b/Zend/tests/constexpr/new_named_params.phpt
@@ -18,8 +18,8 @@ var_dump($c);
try {
eval('static $d = new Vec(x: 0.0, x: 1.0);');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..80aa36b5b0d7 100644
--- a/Zend/tests/constexpr/new_self_parent.phpt
+++ b/Zend/tests/constexpr/new_self_parent.phpt
@@ -19,14 +19,14 @@ B::method();
try {
invalid();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
B::invalid();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..747c42167c10 100644
--- a/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
+++ b/Zend/tests/ctor_promotion/ctor_promotion_basic.phpt
@@ -12,10 +12,10 @@ $point = new Point(1, 2, 3);
// Check that properties really are typed.
try {
$point->x = "foo";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0de52bc2ecb2 100644
--- a/Zend/tests/div_002.phpt
+++ b/Zend/tests/div_002.phpt
@@ -8,8 +8,8 @@ $b = array(1);
try {
var_dump($a / $b);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..519a8bff42e2 100644
--- a/Zend/tests/div_by_zero_compound_refcounted.phpt
+++ b/Zend/tests/div_by_zero_compound_refcounted.phpt
@@ -6,11 +6,11 @@ $h = "1";
$h .= "2";
try {
$h /= 0;
-} catch (DivisionByZeroError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..1c3bcf0a2bf0 100644
--- a/Zend/tests/div_by_zero_compound_with_conversion.phpt
+++ b/Zend/tests/div_by_zero_compound_with_conversion.phpt
@@ -5,10 +5,10 @@ Division by zero in compound operator with type coercion
$x = 42;
try {
$$x /= 0;
-} catch (DivisionByZeroError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..46f57d0d7a95 100644
--- a/Zend/tests/dynamic_call/bug48770_2.phpt
+++ b/Zend/tests/dynamic_call/bug48770_2.phpt
@@ -25,14 +25,14 @@ class B extends A {
try {
call_user_func_array(array($this, 'parent::func22'), array($str));
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func_array(array($this, 'parent::inexistent'), array($str));
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
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..6f95117d072e 100644
--- a/Zend/tests/dynamic_call/bug48770_3.phpt
+++ b/Zend/tests/dynamic_call/bug48770_3.phpt
@@ -22,8 +22,8 @@ class B extends A {
try {
call_user_func_array(array($this, 'self::inexistent'), array($str));
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
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..e3d717b62877 100644
--- a/Zend/tests/dynamic_call/bug68475.phpt
+++ b/Zend/tests/dynamic_call/bug68475.phpt
@@ -36,16 +36,16 @@ $callback(...$args);
$callback = 'TestClass::undefinedMethod';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Reference undefined class.
$callback = 'UndefinedClass::testMethod';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..e651b54a8b72 100644
--- a/Zend/tests/dynamic_call/dynamic_call_005.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_005.phpt
@@ -9,28 +9,28 @@ function test_calls($func) {
try {
array_map($func, [['i' => new stdClass]]);
var_dump($i);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func(['i' => new stdClass]);
var_dump($i);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func($func, ['i' => new stdClass]);
var_dump($i);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..b1948e340add 100644
--- a/Zend/tests/dynamic_call/dynamic_call_006.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_006.phpt
@@ -7,52 +7,52 @@ function test() {
try {
$func = 'extract';
$func(['a' => 'b']);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'compact';
$func(['a']);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'get_defined_vars';
$func();
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_get_args';
$func();
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_get_arg';
$func(1);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$func = 'func_num_args';
$func();
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..5d99ba5d5352 100644
--- a/Zend/tests/dynamic_call/dynamic_call_007.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_007.phpt
@@ -7,8 +7,8 @@ function test() {
$i = 1;
try {
array_map('extract', [['i' => new stdClass]]);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..97c21e69a0a2 100644
--- a/Zend/tests/dynamic_call/dynamic_call_008.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_008.phpt
@@ -6,12 +6,12 @@ Don't optimize dynamic call to non-dynamic one if it drops the warning
function test() {
try {
((string) 'extract')(['a' => 42]);
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..03851cb77940 100644
--- a/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_freeing.phpt
@@ -6,23 +6,23 @@ Freeing of function "name" when dynamic call fails
try {
$bar = "bar";
("foo" . $bar)();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$bar = ["bar"];
(["foo"] + $bar)();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new stdClass)();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f2ff0faa1dee 100644
--- a/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
+++ b/Zend/tests/dynamic_call/dynamic_call_non_static.phpt
@@ -16,15 +16,15 @@ class Foo {
$x = new Foo;
try {
$x->test1();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$x->test2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ebfc7f4059a4 100644
--- a/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
+++ b/Zend/tests/dynamic_call/dynamic_fully_qualified_call.phpt
@@ -6,10 +6,10 @@ Crash when using dynamic call syntax with fully qualified name in a namespace
namespace Foo;
try {
('\bar')();
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..f421f6ffa67c 100644
--- a/Zend/tests/enum/ast-dumper.phpt
+++ b/Zend/tests/enum/ast-dumper.phpt
@@ -22,13 +22,13 @@ try {
return false;
})());
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..11c9f68214b8 100644
--- a/Zend/tests/enum/backed-duplicate-int.phpt
+++ b/Zend/tests/enum/backed-duplicate-int.phpt
@@ -10,31 +10,31 @@ enum Foo: int {
try {
var_dump(Foo::Bar);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::Bar);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from(42));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::tryFrom('bar'));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d7ae7b309df4 100644
--- a/Zend/tests/enum/backed-duplicate-string.phpt
+++ b/Zend/tests/enum/backed-duplicate-string.phpt
@@ -12,31 +12,31 @@ enum Suit: string {
try {
var_dump(Suit::Hearts);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::Hearts);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::from(42));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Suit::tryFrom('bar'));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..21584621a09d 100644
--- a/Zend/tests/enum/backed-from-invalid-int.phpt
+++ b/Zend/tests/enum/backed-from-invalid-int.phpt
@@ -10,10 +10,10 @@ enum Foo: int {
try {
var_dump(Foo::from(2));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..10949c80cad0 100644
--- a/Zend/tests/enum/backed-from-invalid-string.phpt
+++ b/Zend/tests/enum/backed-from-invalid-string.phpt
@@ -12,10 +12,10 @@ enum Suit: string {
try {
var_dump(Suit::from('A'));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..0d1eeab4297f 100644
--- a/Zend/tests/enum/backed-from-invalid-type.phpt
+++ b/Zend/tests/enum/backed-from-invalid-type.phpt
@@ -12,8 +12,8 @@ enum Suit: string {
try {
var_dump(Suit::from(42));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
enum Foo: int {
@@ -23,12 +23,12 @@ enum Foo: int {
try {
var_dump(Foo::from('H'));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6864e51c5698 100644
--- a/Zend/tests/enum/backed-mismatch.phpt
+++ b/Zend/tests/enum/backed-mismatch.phpt
@@ -9,26 +9,26 @@ enum Foo: int {
try {
var_dump(Foo::Bar);
-} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::Bar);
-} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from(42));
-} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::from('bar'));
-} catch (Error $e) {
- echo get_class($e), ': ', $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..abef7cebd94d 100644
--- a/Zend/tests/enum/enum-as-params.phpt
+++ b/Zend/tests/enum/enum-as-params.phpt
@@ -19,17 +19,17 @@ takesBaz(Baz::Qux);
try {
takesBaz(Foo::Bar);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
takesFoo(Baz::Qux);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..c58cdb302da2 100644
--- a/Zend/tests/enum/internal_enums.phpt
+++ b/Zend/tests/enum/internal_enums.phpt
@@ -33,8 +33,8 @@ var_dump(unserialize($s) === $foo);
function test_int_enum(int|string $case) {
try {
var_dump(ZendTestIntEnum::from($case));
- } catch (\Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..f98945f72ee4 100644
--- a/Zend/tests/enum/internal_enums_strict_types.phpt
+++ b/Zend/tests/enum/internal_enums_strict_types.phpt
@@ -11,18 +11,18 @@ var_dump(ZendTestStringEnum::from("Test2"));
try {
var_dump(ZendTestStringEnum::from(42));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(ZendTestStringEnum::tryFrom(43));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9328ea99dd7d 100644
--- a/Zend/tests/enum/json_encode.phpt
+++ b/Zend/tests/enum/json_encode.phpt
@@ -34,8 +34,8 @@ function test($value) {
try {
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";
+ } catch (Throwable $e) {
+ 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..ad2b42793b76 100644
--- a/Zend/tests/enum/no-clone-internal.phpt
+++ b/Zend/tests/enum/no-clone-internal.phpt
@@ -7,10 +7,10 @@ zend_test
try {
var_dump(clone ZendTestIntEnum::Foo);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..f5e3573bf440 100644
--- a/Zend/tests/enum/no-clone.phpt
+++ b/Zend/tests/enum/no-clone.phpt
@@ -9,10 +9,10 @@ enum Foo {
try {
var_dump(clone Foo::Bar);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..1c9eae019cf2 100644
--- a/Zend/tests/enum/no-dynamic-properties-internal.phpt
+++ b/Zend/tests/enum/no-dynamic-properties-internal.phpt
@@ -9,10 +9,10 @@ $bar = ZendTestUnitEnum::Bar;
try {
$bar->baz = 'Baz';
-} catch (\Error $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..3654f1a33c6c 100644
--- a/Zend/tests/enum/no-dynamic-properties.phpt
+++ b/Zend/tests/enum/no-dynamic-properties.phpt
@@ -11,10 +11,10 @@ $bar = Foo::Bar;
try {
$bar->baz = 'Baz';
-} catch (\Error $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..c9e0fae4632e 100644
--- a/Zend/tests/enum/no-new-through-reflection.phpt
+++ b/Zend/tests/enum/no-new-through-reflection.phpt
@@ -7,10 +7,10 @@ enum Foo {}
try {
(new \ReflectionClass(Foo::class))->newInstanceWithoutConstructor();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6e39f95b4936 100644
--- a/Zend/tests/enum/no-new.phpt
+++ b/Zend/tests/enum/no-new.phpt
@@ -7,10 +7,10 @@ enum Foo {}
try {
new Foo();
-} catch (\Error $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..748b33b69f3c 100644
--- a/Zend/tests/enum/no-pass-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-pass-properties-by-ref.phpt
@@ -14,13 +14,13 @@ function setBarValueByRef(&$bar, $value) {
try {
$bar = Foo::Bar;
$value = setBarValueByRef($bar->value, 1);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..578643bf2736 100644
--- a/Zend/tests/enum/no-return-properties-by-ref.phpt
+++ b/Zend/tests/enum/no-return-properties-by-ref.phpt
@@ -15,13 +15,13 @@ function &getBarValueByRef() {
try {
$value = &getBarValueByRef();
$value = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..e73e1ce2dd91 100644
--- a/Zend/tests/enum/no-unset-propertes.phpt
+++ b/Zend/tests/enum/no-unset-propertes.phpt
@@ -14,24 +14,24 @@ enum IntFoo: int {
$foo = Foo::Bar;
try {
unset($foo->name);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$intFoo = IntFoo::Bar;
try {
unset($intFoo->name);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($intFoo->value);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..574095207f7c 100644
--- a/Zend/tests/enum/no-write-properties-cache-slot.phpt
+++ b/Zend/tests/enum/no-write-properties-cache-slot.phpt
@@ -15,13 +15,13 @@ enum Test {
try {
Test::A->modify();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3f04caddad54 100644
--- a/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
+++ b/Zend/tests/enum/no-write-properties-through-foreach-reference.phpt
@@ -10,13 +10,13 @@ enum Foo: int {
try {
$bar = Foo::Bar;
foreach ([1] as &$bar->value) {}
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..7166b4037631 100644
--- a/Zend/tests/enum/no-write-properties-through-references.phpt
+++ b/Zend/tests/enum/no-write-properties-through-references.phpt
@@ -11,13 +11,13 @@ try {
$bar = Foo::Bar;
$value = &$bar->value;
$value = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..f64360125427 100644
--- a/Zend/tests/enum/no-write-properties.phpt
+++ b/Zend/tests/enum/no-write-properties.phpt
@@ -14,36 +14,36 @@ enum IntFoo: int {
$bar = Foo::Bar;
try {
$bar->name = 'Baz';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$bar->value = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$intBar = IntFoo::Bar;
try {
$intBar->name = 'Baz';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$intBar->value = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$intBar->value2 = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6b9a5604d698 100644
--- a/Zend/tests/errmsg/bug43344_1.phpt
+++ b/Zend/tests/errmsg/bug43344_1.phpt
@@ -18,28 +18,28 @@ function f3($a=array(bar=>0)) {
try {
echo bar."\n";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f1()."\n";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f2()."\n";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo f3()."\n";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..80cd072f5409 100644
--- a/Zend/tests/errmsg/errmsg_020.phpt
+++ b/Zend/tests/errmsg/errmsg_020.phpt
@@ -7,10 +7,10 @@ disable_functions=phpinfo
try {
phpinfo();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..24011a7caa5a 100644
--- a/Zend/tests/error_reporting/bug72162.phpt
+++ b/Zend/tests/error_reporting/bug72162.phpt
@@ -7,9 +7,9 @@ $var11 = new StdClass();
try {
$var16 = error_reporting($var11);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..7ff1ad36ff6d 100644
--- a/Zend/tests/exception_set_previous_leak.phpt
+++ b/Zend/tests/exception_set_previous_leak.phpt
@@ -11,10 +11,10 @@ try {
} finally {
throw $e;
}
-} catch (Exception $e2) {
- echo $e2->getMessage(), "\n";
+} catch (Throwable $e2) {
+ 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..2db7364f476b 100644
--- a/Zend/tests/exception_stream_wrapper.phpt
+++ b/Zend/tests/exception_stream_wrapper.phpt
@@ -20,8 +20,8 @@ class Loader {
stream_wrapper_register('abc', 'Loader');
try {
require 'abc://';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c96ffcfa1cb2 100644
--- a/Zend/tests/exceptions/bug26698.phpt
+++ b/Zend/tests/exceptions/bug26698.phpt
@@ -24,9 +24,9 @@ class Proxy
$res = new ObjectOne();
$this->three($res->getNone());
}
- catch(Exception $e)
+ catch(Throwable $e)
{
- echo 'Caught: '.$e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -37,9 +37,9 @@ class Proxy
$res = new ObjectOne();
$this->three(1, $res->getNone());
}
- catch(Exception $e)
+ catch(Throwable $e)
{
- echo 'Caught: '.$e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -50,9 +50,9 @@ class Proxy
$res = new ObjectOne();
$this->three(1, 2, $res->getNone());
}
- catch(Exception $e)
+ catch(Throwable $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/bug47771.phpt b/Zend/tests/exceptions/bug47771.phpt
index c4350b9d95d3..edf1f2e79064 100644
--- a/Zend/tests/exceptions/bug47771.phpt
+++ b/Zend/tests/exceptions/bug47771.phpt
@@ -22,8 +22,8 @@ try {
$T =new Test(throw_exc());
-} catch( Exception $e) {
- echo 'Exception: ' . $e->getMessage() . "\n";
+} catch( Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/Zend/tests/exceptions/bug48428.phpt b/Zend/tests/exceptions/bug48428.phpt
index 0cda84dea4ee..85e98713d1d4 100644
--- a/Zend/tests/exceptions/bug48428.phpt
+++ b/Zend/tests/exceptions/bug48428.phpt
@@ -5,9 +5,9 @@ Bug #48428 (crash when exception is thrown while passing function arguments)
try {
function x() { throw new Exception("ERROR"); }
x(x());
-} catch(Exception $e) {
- echo($e -> getMessage());
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ERROR
+Exception: ERROR
diff --git a/Zend/tests/exceptions/bug50383.phpt b/Zend/tests/exceptions/bug50383.phpt
index 2f72ea51f853..ee97a7bca9bb 100644
--- a/Zend/tests/exceptions/bug50383.phpt
+++ b/Zend/tests/exceptions/bug50383.phpt
@@ -22,21 +22,21 @@ function thrower2() {
try {
thrower();
-} catch(Exception $e) {
- print $e->getMessage();
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage();
print_r($e->getTrace());
}
try {
thrower2();
-} catch (Exception $e) {
- print $e->getMessage();
+} catch (Throwable $e) {
+ 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..1fde070b7069 100644
--- a/Zend/tests/exceptions/bug53511.phpt
+++ b/Zend/tests/exceptions/bug53511.phpt
@@ -12,8 +12,8 @@ function test() {
$e = new Foo();
try {
throw new Exception("ops 2");
- } catch (Exception $e) {
- echo $e->getMessage()."\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
diff --git a/Zend/tests/exceptions/bug54043.phpt b/Zend/tests/exceptions/bug54043.phpt
index c6e08b75f9ee..15c481456a6e 100644
--- a/Zend/tests/exceptions/bug54043.phpt
+++ b/Zend/tests/exceptions/bug54043.phpt
@@ -8,13 +8,13 @@ $timeZone = new DateTimeZone('UTC');
try {
$dateTime = new DateTime($time, $timeZone);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..6ecfc26e7dd6 100644
--- a/Zend/tests/exceptions/bug60569.phpt
+++ b/Zend/tests/exceptions/bug60569.phpt
@@ -5,10 +5,11 @@ Bug #60569 (Nullbyte truncates Exception $message.)
try {
$msg = "Some error \x00 message";
throw new Exception($msg);
-} catch(Exception $e) {
- var_dump($e->getMessage(), $msg);
+} catch(Throwable $e) {
+ 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..7b795518a56a 100644
--- a/Zend/tests/exceptions/exception_001.phpt
+++ b/Zend/tests/exceptions/exception_001.phpt
@@ -8,29 +8,29 @@ try {
try {
try {
throw new Exception();
- } catch (Exception $e) {
- var_dump($e->getMessage());
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
- } catch (Exception $e) {
- var_dump($e->getMessage());
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
- } catch (Exception $e) {
- var_dump($e->getMessage());
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
throw $e;
}
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..f643ea4324ab 100644
--- a/Zend/tests/exceptions/exception_013.phpt
+++ b/Zend/tests/exceptions/exception_013.phpt
@@ -8,30 +8,28 @@ class C {
try {
var_dump(C::$a);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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..f9b69cf3aa8f 100644
--- a/Zend/tests/exceptions/exception_014.phpt
+++ b/Zend/tests/exceptions/exception_014.phpt
@@ -9,14 +9,14 @@ class C {
$x = new C;
try {
var_dump($x->p);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+ 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..e98fd4873760 100644
--- a/Zend/tests/exceptions/exception_015.phpt
+++ b/Zend/tests/exceptions/exception_015.phpt
@@ -5,14 +5,14 @@ Exceptions on improper access to string
$s = "ABC";
try {
$s[] = "D";
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+ 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..dedae5e179f1 100644
--- a/Zend/tests/exceptions/exception_016.phpt
+++ b/Zend/tests/exceptions/exception_016.phpt
@@ -4,14 +4,14 @@ Exceptions on improper usage of $this
foo();
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . " in " , $e->getFile() . " on line " . $e->getLine() . "\n";
+} catch (Throwable $e) {
+ 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..26fb7a8d1694 100644
--- a/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
+++ b/Zend/tests/exceptions/exception_during_by_reference_magic_get.phpt
@@ -14,10 +14,10 @@ $test = new Test;
$y = 5;
try {
$test->x =& $y;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..444416679714 100644
--- a/Zend/tests/exceptions/exception_during_include_stat.phpt
+++ b/Zend/tests/exceptions/exception_during_include_stat.phpt
@@ -15,28 +15,28 @@ set_include_path('test://foo:test://bar');
try {
require_once 'doesnt_exist.php';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
require 'doesnt_exist.php';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
include_once 'doesnt_exist.php';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
include 'doesnt_exist.php';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5a559fff5b15 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $badStr . $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $str .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($str);
try { $x = $num . $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $badStr . $num; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = $num .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($num);
try { $x = $badStr .= $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($badStr);
try { $x = $badStr .= $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($badStr);
try { $x = "x$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$badStr}x"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "$str$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "$badStr$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "x$badStr$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "x$str$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$str}x$badStr"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = "{$badStr}x$str"; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = (string) $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = include $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { echo $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
${""} = 42;
try { unset(${$badStr}); }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump(${""});
unset(${""});
try { $x = ${$badStr}; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { $x = isset(${$badStr}); }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
$obj = new stdClass;
try { $x = $obj->{$badStr} = $str; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($obj);
try { $str[0] = $badStr; }
-catch (Exception $e) { echo $e->getMessage(), "\n"; }
+catch (Throwable $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 (Throwable $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..4ff3c5f189fc 100644
--- a/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
+++ b/Zend/tests/exceptions/exception_handler/exception_handler_004.phpt
@@ -5,16 +5,16 @@ exception handler tests - 4
try {
set_exception_handler("fo");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
set_exception_handler(array("", ""));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..e23e9ca55f96 100644
--- a/Zend/tests/exit/die_string_cast_exception.phpt
+++ b/Zend/tests/exit/die_string_cast_exception.phpt
@@ -5,10 +5,10 @@ Bug #79777: String cast exception during die should be handled gracefully
try {
die(new stdClass);
-} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..448dc90ace29 100644
--- a/Zend/tests/exit_finally_2.phpt
+++ b/Zend/tests/exit_finally_2.phpt
@@ -14,8 +14,8 @@ try {
throw new Exception("Finally exception");
}
echo "Not executed\n";
-} catch (Exception $e) {
- echo "Caught {$e->getMessage()}\n";
+} catch (Throwable $e) {
+ 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..95ecfe4d2b05 100644
--- a/Zend/tests/fe_fetch_dtor_exception.phpt
+++ b/Zend/tests/fe_fetch_dtor_exception.phpt
@@ -13,10 +13,10 @@ try {
foreach ([1, 2] as $v) {
var_dump($v);
}
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7ddfc9378cdd 100644
--- a/Zend/tests/fe_fetch_op2_live_range.phpt
+++ b/Zend/tests/fe_fetch_op2_live_range.phpt
@@ -4,9 +4,9 @@ FE_FETCH op2 is a def and needs special live range handling
func()[]) {}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a55541b6acbf 100644
--- a/Zend/tests/fibers/catch.phpt
+++ b/Zend/tests/fibers/catch.phpt
@@ -6,8 +6,8 @@ Catch exception thrown into fiber
$fiber = new Fiber(function () {
try {
Fiber::suspend('test');
- } catch (Exception $exception) {
- var_dump($exception->getMessage());
+ } catch (Throwable $exception) {
+ 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..a8b4fd02a634 100644
--- a/Zend/tests/fibers/fiber-error-construct.phpt
+++ b/Zend/tests/fibers/fiber-error-construct.phpt
@@ -5,10 +5,10 @@ FiberError cannot be constructed in user code
try {
new FiberError;
-} catch (Error $exception) {
- echo $exception->getMessage(), "\n";
+} catch (Throwable $exception) {
+ 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..a46b00d27cb9 100644
--- a/Zend/tests/fibers/get-return-after-throwing.phpt
+++ b/Zend/tests/fibers/get-return-after-throwing.phpt
@@ -7,15 +7,15 @@ $fiber = new Fiber(fn() => throw new Exception('test'));
try {
$fiber->start();
-} catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+} catch (Throwable $exception) {
+ 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..2f9f9b4f9c84 100644
--- a/Zend/tests/fibers/gh10249.phpt
+++ b/Zend/tests/fibers/gh10249.phpt
@@ -8,10 +8,10 @@ ini_set("fiber.stack_size", "");
$fiber = new Fiber($callback);
try {
$fiber->start();
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..0181606412b8 100644
--- a/Zend/tests/fibers/gh20483.phpt
+++ b/Zend/tests/fibers/gh20483.phpt
@@ -8,9 +8,9 @@ $callback = function () {};
$fiber = new Fiber($callback);
try {
$fiber->start();
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..a00484feb3fa 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
@@ -15,13 +15,13 @@ try {
$fiber->start();
})();
-} catch (FiberError $exception) {
- echo $exception->getMessage(), "\n";
+} catch (Throwable $exception) {
+ 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..c4ab9ef3f640 100644
--- a/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
+++ b/Zend/tests/fibers/unfinished-fiber-with-throw-in-finally.phpt
@@ -19,16 +19,16 @@ $fiber = new Fiber(function (): void {
echo "inner finally\n";
throw new \Exception("finally exception");
}
- } catch (Exception $exception) {
- echo $exception->getMessage(), "\n";
+ } catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
} finally {
echo "outer finally\n";
}
try {
echo Fiber::suspend();
- } catch (FiberError $exception) {
- echo $exception->getMessage(), "\n";
+ } catch (Throwable $exception) {
+ 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..8d2e3d00bb45 100644
--- a/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
+++ b/Zend/tests/first_class_callable/constexpr/attributes_ast_printing.phpt
@@ -11,8 +11,8 @@ try {
#[Attr(strrev(...))]
function () { }
);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
@@ -21,13 +21,13 @@ try {
new #[Attr(strrev(...))]
class {}
);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..30bd7011c4e3 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
@@ -21,11 +21,11 @@ function foo(Closure $c = Foo::myMethod(...)) {
try {
foo();
-} catch (ErrorException $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..545be8944a42 100644
--- a/Zend/tests/first_class_callable/first_class_callable_015.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_015.phpt
@@ -14,11 +14,11 @@ $fn = test(...);
do_weak_call($fn);
try {
do_strict_call($fn);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..78cff4b9d0f3 100644
--- a/Zend/tests/first_class_callable/first_class_callable_assert.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_assert.phpt
@@ -9,17 +9,17 @@ $assert = assert(...);
$assert(1 == 1.0, "Message 1");
try {
$assert(1 == 2.0, "Message 2");
-} catch (\AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && strlen(...));
-} catch (\AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..4e7503027b14 100644
--- a/Zend/tests/first_class_callable/first_class_callable_errors.phpt
+++ b/Zend/tests/first_class_callable/first_class_callable_errors.phpt
@@ -12,46 +12,46 @@ class Test {
try {
$fn = 123;
$fn(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
does_not_exist(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
stdClass::doesNotExist(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new stdClass)->doesNotExist(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
[new stdClass, 'doesNotExist'](...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::privateMethod(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::instanceMethod(...);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..73999b398473 100644
--- a/Zend/tests/foreach/foreach_003.phpt
+++ b/Zend/tests/foreach/foreach_003.phpt
@@ -30,42 +30,42 @@ foreach(['rewind', 'valid', 'key', 'current', 'next'] as $trap) {
try {
// IS_CV
foreach ($obj as $key => $val) echo "$val\n";
- } catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($obj);
try {
// IS_VAR
foreach (new IT(3, $trap) as $key => $val) echo "$val\n";
- } catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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";
+ } catch (Throwable $e) {
+ 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..5fcf5e006278 100644
--- a/Zend/tests/frameless_undefined_var.phpt
+++ b/Zend/tests/frameless_undefined_var.phpt
@@ -10,9 +10,9 @@ function test() {
}
try {
test();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..1401292bb126 100644
--- a/Zend/tests/func_arg_fetch_optimization.phpt
+++ b/Zend/tests/func_arg_fetch_optimization.phpt
@@ -7,9 +7,9 @@ function test($x) {
}
try {
test([]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5e56aa415603 100644
--- a/Zend/tests/func_get_arg_basic.phpt
+++ b/Zend/tests/func_get_arg_basic.phpt
@@ -6,50 +6,50 @@ func_get_arg() tests
function test1() {
try {
var_dump(func_get_arg(-10));
- } catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(0));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(1));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
function test2($a) {
try {
var_dump(func_get_arg(0));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(1));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
function test3($a, $b) {
try {
var_dump(func_get_arg(0));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(1));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(2));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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);
@@ -75,13 +75,13 @@ class test {
static function test1($a) {
try {
var_dump(func_get_arg(0));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(func_get_arg(1));
- } catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -89,33 +89,33 @@ class test {
test::test1(1);
try {
var_dump(func_get_arg(1));
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..e08eaa2ef75a 100644
--- a/Zend/tests/func_get_arg_invalid.phpt
+++ b/Zend/tests/func_get_arg_invalid.phpt
@@ -5,8 +5,8 @@ func_get_arg() invalid usage
try {
var_dump(func_get_arg(1));
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function bar() {
@@ -19,11 +19,11 @@ function foo() {
try {
foo(1,2);
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..0c61755a8758 100644
--- a/Zend/tests/func_get_args.phpt
+++ b/Zend/tests/func_get_args.phpt
@@ -5,10 +5,10 @@ Testing func_get_args() throws error when called from the global scope
try {
func_get_args();
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..a6278cdb067b 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);
@@ -43,8 +43,8 @@ test::test1(1);
try {
var_dump(func_get_args());
-} catch (\Error $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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..c0293f8d1b59 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);
@@ -43,8 +43,8 @@ test::test1(1);
try {
func_num_args();
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..b286298178ad 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal.phpt
@@ -4,9 +4,9 @@ Call internal function with incorrect number of arguments
getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c2b63e6664f8 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_internal_strict.phpt
@@ -5,20 +5,16 @@ Call internal function with incorrect number of arguments with strict types
declare(strict_types=1);
try {
substr("foo");
-} catch (ArgumentCountError $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_diff();
-} catch (ArgumentCountError $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ddfd342d41d6 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland.phpt
@@ -5,41 +5,33 @@ Call userland function with incorrect number of arguments
try {
function foo($bar) { }
foo();
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
function bar($foo, $bar) { }
bar(1);
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function bat(int $foo, string $bar) { }
try {
bat(123);
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bat("123");
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..d8703181bf60 100644
--- a/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
+++ b/Zend/tests/function_arguments/argument_count_incorrect_userland_strict.phpt
@@ -6,50 +6,40 @@ declare(strict_types=1);
try {
function foo($bar) { }
foo();
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
function bar($foo, $bar) { }
bar(1);
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function bat(int $foo, string $bar) { }
try {
bat(123);
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bat("123");
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bat(123, 456);
-} catch (\Error $e) {
- echo get_class($e) . PHP_EOL;
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..1fe2b6fef4cd 100644
--- a/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
+++ b/Zend/tests/function_arguments/sensitive_parameter_correctly_captures_original.phpt
@@ -14,8 +14,8 @@ function test(
try {
test('foo', 'bar', 'baz');
echo 'Not reached';
-} catch (Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
$testFrame = $e->getTrace()[0];
var_dump($testFrame['function']);
var_dump(count($testFrame['args']));
@@ -36,8 +36,8 @@ function test2(
try {
test2('foo', 'variadic1', 'variadic2', 'variadic3');
echo 'Not reached';
-} catch (Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
$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..eb602deaa723 100644
--- a/Zend/tests/function_arguments/variadic_argument_type_error.phpt
+++ b/Zend/tests/function_arguments/variadic_argument_type_error.phpt
@@ -7,17 +7,17 @@ function foo($foo, int ...$bar) {}
try {
foo(1, []);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
foo(1, 1, 1, []);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..36f3f898d95c 100644
--- a/Zend/tests/gc/bug54305.phpt
+++ b/Zend/tests/gc/bug54305.phpt
@@ -11,9 +11,9 @@ abstract class AbstractClass {
$methodWithArgs = new ReflectionMethod('TestClass', 'methodWithArgs');
try {
echo $methodWithArgs++;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a03bda77fbc9 100644
--- a/Zend/tests/gc/bug80072.phpt
+++ b/Zend/tests/gc/bug80072.phpt
@@ -6,12 +6,12 @@ Bug #80072: Cyclic unserialize in TMPVAR operand may leak
try {
$s = 'O:8:"stdClass":1:{s:1:"x";r:1;}';
unserialize($s) % gc_collect_cycles();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3b127a6ce510 100644
--- a/Zend/tests/generators/bug79927.phpt
+++ b/Zend/tests/generators/bug79927.phpt
@@ -11,8 +11,8 @@ $generator->next();
$generator->next();
try {
$generator->rewind();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/dynamic_properties.phpt b/Zend/tests/generators/dynamic_properties.phpt
index 08ceb7f581c6..6fb6bcefbf38 100644
--- a/Zend/tests/generators/dynamic_properties.phpt
+++ b/Zend/tests/generators/dynamic_properties.phpt
@@ -10,10 +10,10 @@ function gen() {
$gen = gen();
try {
$gen->prop = new stdClass;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e912376c056d 100644
--- a/Zend/tests/generators/errors/count_error.phpt
+++ b/Zend/tests/generators/errors/count_error.phpt
@@ -9,10 +9,10 @@ $gen = gen();
try {
count($gen);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..c1a62dd75751 100644
--- a/Zend/tests/generators/errors/resume_running_generator_error.phpt
+++ b/Zend/tests/generators/errors/resume_running_generator_error.phpt
@@ -7,8 +7,8 @@ function gen() {
$gen = yield;
try {
$gen->next();
- } catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..885251f58381 100644
--- a/Zend/tests/generators/generator_throwing_during_function_call.phpt
+++ b/Zend/tests/generators/generator_throwing_during_function_call.phpt
@@ -19,8 +19,8 @@ var_dump($gen->current());
try {
$gen->next();
-} catch (Exception $e) {
- echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+} catch (Throwable $e) {
+ 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..48cdfa9eda82 100644
--- a/Zend/tests/generators/generator_throwing_exception.phpt
+++ b/Zend/tests/generators/generator_throwing_exception.phpt
@@ -15,8 +15,8 @@ var_dump($gen->current());
try {
$gen->next();
-} catch (Exception $e) {
- echo 'Caught exception with message "', $e->getMessage(), '"', "\n";
+} catch (Throwable $e) {
+ 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..d1b8bb6798d8 100644
--- a/Zend/tests/generators/generator_with_type_check_2.phpt
+++ b/Zend/tests/generators/generator_with_type_check_2.phpt
@@ -5,18 +5,18 @@ Generator wit type check
function gen(array $a) { yield; }
try {
gen(42);
-} catch (TypeError $e) {
- echo $e->getMessage()."\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foreach (gen(42) as $val) {
var_dump($val);
}
-} catch (TypeError $e) {
- echo $e->getMessage()."\n";
+} catch (Throwable $e) {
+ 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 8ced4d0008b5..4892075f4d77 100644
--- a/Zend/tests/generators/get_return_and_finally.phpt
+++ b/Zend/tests/generators/get_return_and_finally.phpt
@@ -30,19 +30,19 @@ try {
// This will throw an exception (from the finally)
// during auto-priming, so fails
var_dump($gen->getReturn());
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
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..9db84883e274 100644
--- a/Zend/tests/generators/get_return_errors.phpt
+++ b/Zend/tests/generators/get_return_errors.phpt
@@ -13,8 +13,8 @@ $gen = gen1();
try {
// Generator hasn't reached the "return" yet
$gen->getReturn();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen2() {
@@ -26,14 +26,14 @@ function gen2() {
$gen = gen2();
try {
$gen->next();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen3() {
@@ -46,8 +46,8 @@ $gen = gen3();
try {
// Generator throws during auto-priming of getReturn() call
$gen->getReturn();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function gen4() {
@@ -58,22 +58,22 @@ function gen4() {
$gen = gen4();
try {
$gen->throw(new Exception("gen4() throw"));
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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 d1c07dc9de66..7bd6f1ce3890 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";
}
}
@@ -27,10 +27,10 @@ test("object", new stdClass);
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
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 c58e00dc09b1..d5eee0cfaad3 100644
--- a/Zend/tests/generators/gh11028_3.phpt
+++ b/Zend/tests/generators/gh11028_3.phpt
@@ -14,9 +14,9 @@ function generator() {
try {
var_dump([...generator()]);
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
-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..5cef784dfce4 100644
--- a/Zend/tests/generators/throw_into_yield_from_array.phpt
+++ b/Zend/tests/generators/throw_into_yield_from_array.phpt
@@ -19,8 +19,8 @@ function test($g) {
var_dump($g->current());
try {
$g->throw(new Exception("Exception!"));
- } catch (Exception $e) {
- echo "{$e->getMessage()}\n";
+ } catch (Throwable $e) {
+ 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..7b1d21afbe77 100644
--- a/Zend/tests/generators/yield_from_non_iterable.phpt
+++ b/Zend/tests/generators/yield_from_non_iterable.phpt
@@ -9,10 +9,10 @@ function gen() {
try {
gen()->current();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..2ae43e9ad592 100644
--- a/Zend/tests/generators/yield_from_valid_exception.phpt
+++ b/Zend/tests/generators/yield_from_valid_exception.phpt
@@ -17,8 +17,8 @@ function gen() {
try {
// the fact that the yield from result is used is relevant.
var_dump(yield from new FooBar);
- } catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..d9a6a090e305 100644
--- a/Zend/tests/get_called_class_001.phpt
+++ b/Zend/tests/get_called_class_001.phpt
@@ -5,10 +5,10 @@ Calling get_called_class() outside a class
try {
var_dump(get_called_class());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..bcdfeb22df91 100644
--- a/Zend/tests/get_class_basic.phpt
+++ b/Zend/tests/get_class_basic.phpt
@@ -11,8 +11,8 @@ class foo {
{
try {
var_dump(get_class(null));
- } catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -28,8 +28,8 @@ set_error_handler(function ($severity, $message, $file, $line) {
});
try {
$f1->bar();
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
set_error_handler(null);
@@ -37,13 +37,13 @@ $f2->bar();
try {
var_dump(get_class());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(get_class("qwerty"));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ff9a308f4b6e 100644
--- a/Zend/tests/get_class_vars/get_class_vars_001.phpt
+++ b/Zend/tests/get_class_vars/get_class_vars_001.phpt
@@ -21,8 +21,8 @@ var_dump(get_class_vars('B'));
try {
get_class_vars("Unknown");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3d7f997734a2 100644
--- a/Zend/tests/get_parent_class_basic.phpt
+++ b/Zend/tests/get_parent_class_basic.phpt
@@ -27,8 +27,8 @@ set_error_handler(function ($severity, $message, $file, $line) {
});
try {
$foo->test();
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
set_error_handler(null);
@@ -44,40 +44,40 @@ var_dump(get_parent_class("i"));
try {
get_parent_class("");
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class("[[[[");
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class(" ");
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
var_dump(get_parent_class(new stdclass));
try {
get_parent_class(array());
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
get_parent_class(1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..44f62b7dcd53 100644
--- a/Zend/tests/gh10169.phpt
+++ b/Zend/tests/gh10169.phpt
@@ -19,19 +19,19 @@ class B
$a = new A();
try {
$a->prop = new B();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$a = new A();
$a->prop = '';
try {
$a->prop = new B();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/gh10497_non_object.phpt b/Zend/tests/gh10497_non_object.phpt
index 546e9718443d..837fdf827c4b 100644
--- a/Zend/tests/gh10497_non_object.phpt
+++ b/Zend/tests/gh10497_non_object.phpt
@@ -5,20 +5,20 @@ GH-10497: Writing to a property of a non-object constant reports a runtime error
try {
TRUE->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
NULL->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
PHP_INT_MAX->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class C {
@@ -33,47 +33,47 @@ class C {
try {
C::INT->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
C::STR->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
C::ARR->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
C::fromSelf();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Other write contexts: compound assignment, unset() and by-reference arguments.
try {
C::INT->prop++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
C::INT->prop .= 'x';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function byRef(&$v) {}
try {
byRef(C::INT->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// As for plain variables, unsetting a property of a non-object is a silent no-op.
@@ -85,27 +85,27 @@ var_dump(isset(C::INT->prop));
try {
__COMPILER_HALT_OFFSET__->prop = 1;
-} catch (Error $e) {
- echo $e::class, $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
__halt_compiler();
?>
--EXPECT--
-Attempt to assign property "prop" on true
-Attempt to assign property "prop" on null
-Attempt to assign property "prop" on int
-Attempt to assign property "prop" on int
-Attempt to assign property "prop" on string
-Attempt to assign property "prop" on array
-Attempt to assign property "prop" on int
-Attempt to increment/decrement property "prop" on int
-Attempt to assign property "prop" on int
-Attempt to modify property "prop" on int
+Error: Attempt to assign property "prop" on true
+Error: Attempt to assign property "prop" on null
+Error: Attempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on string
+Error: Attempt to assign property "prop" on array
+Error: Attempt to assign property "prop" on int
+Error: Attempt to increment/decrement property "prop" on int
+Error: Attempt to assign property "prop" on int
+Error: Attempt to modify property "prop" on int
unset() did not error
bool(true)
int(5)
string(3) "str"
bool(false)
-ErrorAttempt to assign property "prop" on int
+Error: Attempt to assign property "prop" on int
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..84fb628525d8 100644
--- a/Zend/tests/gh12102_1.phpt
+++ b/Zend/tests/gh12102_1.phpt
@@ -7,8 +7,8 @@ function test() {
byVal(func_get_args()[0]);
try {
byRef(func_get_args()[0]);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..99c51d5188c4 100644
--- a/Zend/tests/gh12102_3.phpt
+++ b/Zend/tests/gh12102_3.phpt
@@ -7,8 +7,8 @@ function test() {
byVal(C[0]);
try {
byRef(C[0]);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..fb416cae26a3 100644
--- a/Zend/tests/gh17162.phpt
+++ b/Zend/tests/gh17162.phpt
@@ -13,9 +13,9 @@ $box = [new Test];
// but any function that uses zend_try_array_init() would work.
try {
getimagesize("dummy", $box);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..385ab0f99edb 100644
--- a/Zend/tests/gh18736.phpt
+++ b/Zend/tests/gh18736.phpt
@@ -15,10 +15,10 @@ function &test(): int {
try {
$x = &test();
var_dump($x);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f3f7fab3f1fe 100644
--- a/Zend/tests/gh19304.phpt
+++ b/Zend/tests/gh19304.phpt
@@ -9,10 +9,10 @@ $foo = new class {
try {
$foo->v = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..630d7ce2e8b0 100644
--- a/Zend/tests/gh19326.phpt
+++ b/Zend/tests/gh19326.phpt
@@ -25,12 +25,12 @@ $fiber->start();
try {
$b->throw(new Exception('test'));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..9042b4139abf 100644
--- a/Zend/tests/gh19719.phpt
+++ b/Zend/tests/gh19719.phpt
@@ -12,10 +12,10 @@ function takesInt(int $x) {}
try {
takesInt('42');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/gh23088.phpt b/Zend/tests/gh23088.phpt
index 59153a1f2ba3..a979f47d7848 100644
--- a/Zend/tests/gh23088.phpt
+++ b/Zend/tests/gh23088.phpt
@@ -24,17 +24,17 @@ for ($i = 0; $i < 20000; $i++) {
try {
var_dump($a == $b);
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($a === $b);
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Maximum call stack size reached during comparison
-Maximum call stack size reached during comparison
+Error: Maximum call stack size reached during comparison
+Error: Maximum call stack size reached during comparison
diff --git a/Zend/tests/gh23121.phpt b/Zend/tests/gh23121.phpt
index 158794ba04e3..b1a6503a8913 100644
--- a/Zend/tests/gh23121.phpt
+++ b/Zend/tests/gh23121.phpt
@@ -10,27 +10,27 @@ var_dump(is_callable($sxe));
try {
$sxe();
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func($sxe);
-} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
libxml_set_external_entity_loader($sxe);
-} catch (TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(libxml_get_external_entity_loader());
?>
--EXPECT--
bool(false)
-Object of type SimpleXMLElement is not callable
-call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given
-libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, no array or string given
+Error: Object of type SimpleXMLElement is not callable
+TypeError: call_user_func(): Argument #1 ($callback) must be a valid callback, no array or string given
+TypeError: libxml_set_external_entity_loader(): Argument #1 ($resolver_function) must be a valid callback or null, no array or string given
NULL
diff --git a/Zend/tests/gh418106144.phpt b/Zend/tests/gh418106144.phpt
index 9357b0a179b1..c2d689c7ec13 100644
--- a/Zend/tests/gh418106144.phpt
+++ b/Zend/tests/gh418106144.phpt
@@ -11,10 +11,10 @@ function test($y=new Foo>''){
}
try {
test();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b306eb884c76 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_001.phpt
@@ -17,10 +17,10 @@ $foo = new Foo();
try {
$foo->foo()->baz ??= 1;
-} catch (Exception $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..e4516a1eece1 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_002.phpt
@@ -15,10 +15,10 @@ $foo = new Foo();
try {
$foo->foo()->prop ??= 'foo';
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..3aa8d89fb318 100644
--- a/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
+++ b/Zend/tests/ghsa-rwp7-7vc6-8477_003.phpt
@@ -13,10 +13,10 @@ function newFoo() {
try {
newFoo()->prop ??= 'foo';
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..25ea7cc4c786 100644
--- a/Zend/tests/global_to_string_exception.phpt
+++ b/Zend/tests/global_to_string_exception.phpt
@@ -5,10 +5,10 @@ To string conversion failure in global
try {
global ${new stdClass};
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..2a78387f4c63 100644
--- a/Zend/tests/illegal_offset_unset_isset_empty.phpt
+++ b/Zend/tests/illegal_offset_unset_isset_empty.phpt
@@ -6,22 +6,22 @@ Using unset(), isset(), empty() with an illegal array offset throws
$ary = [];
try {
unset($ary[[]]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset($ary[[]]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
empty($ary[[]]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..1384661d25c5 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
@@ -13,64 +13,64 @@ $nf = new NumericCastableNoOperations(58.3);
/* Check normal arithmetic */
try {
var_dump($l - 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($f - 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($nl - 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($nf - 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
/* Decrement */
try {
$l--;
var_dump($l);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$f--;
var_dump($f);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$nl--;
var_dump($nl);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$nf--;
var_dump($nf);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..3ebad74c0a00 100644
--- a/Zend/tests/in-de-crement/incdec_bool_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_bool_exception.phpt
@@ -11,18 +11,18 @@ $values = [false, true];
foreach ($values as $value) {
try {
$value++;
- } catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$value--;
- } catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
?>
--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..c6a1891c991a 100644
--- a/Zend/tests/in-de-crement/incdec_strings_exception.phpt
+++ b/Zend/tests/in-de-crement/incdec_strings_exception.phpt
@@ -28,48 +28,48 @@ $values = [
foreach ($values as $value) {
try {
$value++;
- } catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($value);
try {
$value--;
- } catch (\Exception $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..9b99b9baa45d 100644
--- a/Zend/tests/in-de-crement/incdec_types.phpt
+++ b/Zend/tests/in-de-crement/incdec_types.phpt
@@ -9,13 +9,13 @@ $types = [[], new stdClass(), fopen(__FILE__, 'r')];
foreach ($types as $type) {
try {
$type++;
- } catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$type--;
- } catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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..8ee4cd33856a 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
@@ -13,64 +13,64 @@ $nf = new NumericCastableNoOperations(58.3);
/* Check normal arithmetic */
try {
var_dump($l + 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($f + 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($nl + 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($nf + 1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
/* Decrement */
try {
$l++;
var_dump($l);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$f++;
var_dump($f);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$nl++;
var_dump($nl);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$nf++;
var_dump($nf);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..cfa5cca2dd50 100644
--- a/Zend/tests/in-de-crement/object_cannot_incdec.phpt
+++ b/Zend/tests/in-de-crement/object_cannot_incdec.phpt
@@ -7,39 +7,39 @@ $o = new Foo;
try {
$o++;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
$o--;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
++$o;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
--$o;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
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..370fe8603fd9 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
@@ -7,39 +7,39 @@ $o = new Foo;
try {
$y = $o++;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
$y = $o--;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
$y = ++$o;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
var_dump($o);
}
try {
$y = --$o;
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
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..96b50d1022f2 100644
--- a/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
+++ b/Zend/tests/in-de-crement/oss_fuzz_63802.phpt
@@ -21,14 +21,14 @@ foreach (['pre', 'post'] as $prePost) {
foreach (['inc', 'dec'] as $incDec) {
try {
$foo->{$prePost . ucfirst($incDec)}();
- } catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..8b8b0a1fe71f 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
@@ -14,12 +14,12 @@ unset($c->a);
try {
(++$c->a);
-} catch (\TypeError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($c->a);
?>
--EXPECT--
-Cannot increment stdClass
+TypeError: Cannot increment stdClass
object(stdClass)#2 (0) {
}
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..acb1ab10874b 100644
--- a/Zend/tests/indexing_001.phpt
+++ b/Zend/tests/indexing_001.phpt
@@ -9,8 +9,8 @@ $testvalues=array(null, 0, 1, true, false,'',' ',0.1,array());
foreach ($testvalues as $testvalue) {
try {
$testvalue['foo']=$array;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($testvalue);
}
@@ -21,8 +21,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
foreach ($testvalues as $testvalue) {
try {
$testvalue['foo']=&$array;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($testvalue);
}
@@ -33,8 +33,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
foreach ($testvalues as $testvalue) {
try {
$testvalue[]=$array;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump ($testvalue);
}
@@ -45,8 +45,8 @@ $testvalues=array(null, 0, 1, true, false,0.1,array());
foreach ($testvalues as $testvalue) {
try {
$testvalue[]=&$array;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..c1992a289082 100644
--- a/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_array_004.phpt
@@ -23,8 +23,8 @@ $arr = array('foo', 'abc');
try {
$arr();
}
-catch (Exception $e) {
- echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr = array('foo', '123');
@@ -32,8 +32,8 @@ $arr = array('foo', '123');
try {
$arr();
}
-catch (Exception $e) {
- echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -45,8 +45,8 @@ $arr = array($foo, 'abc');
try {
$arr();
}
-catch (Exception $e) {
- echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -56,16 +56,16 @@ $arr = array($foo, '123');
try {
$arr();
}
-catch (Exception $e) {
- echo $e->getMessage(), "\n";
+catch (Throwable $e) {
+ 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..2c5c22a29ada 100644
--- a/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
+++ b/Zend/tests/indirect_function_call/indirect_call_string_002.phpt
@@ -22,65 +22,65 @@ $callback();
$callback = ['', 'method'];
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test Class::method syntax with empty class name
$callback = '::method';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test array syntax with empty class and method name
$callback = ['', ''];
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test Class::method syntax with empty class and method name
$callback = '::';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test string ending in single colon
$callback = 'Class:';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test string beginning in single colon
$callback = ':method';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Test single colon
$callback = ':';
try {
$callback();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..394e0277919f 100644
--- a/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
+++ b/Zend/tests/indirect_function_call/indirect_method_call_001.phpt
@@ -11,10 +11,10 @@ class foo {
try {
$X = (new foo)->Inexistent(3);
-} catch (Exception $e) {
- var_dump($e->getMessage()); // foobar
+} catch (Throwable $e) {
+ 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..a7575fe15543 100644
--- a/Zend/tests/init_array_illegal_offset_type.phpt
+++ b/Zend/tests/init_array_illegal_offset_type.phpt
@@ -7,9 +7,9 @@ function test() {
}
try {
test();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..27a3c521aa5f 100644
--- a/Zend/tests/int_static_prop_name.phpt
+++ b/Zend/tests/int_static_prop_name.phpt
@@ -16,20 +16,20 @@ var_dump(${(int) $n});
try {
var_dump(Foo::${42});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) 42});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(Foo::${(int) $n});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..cf102c14e985 100644
--- a/Zend/tests/invalid_parent_const_ref_leak.phpt
+++ b/Zend/tests/invalid_parent_const_ref_leak.phpt
@@ -9,10 +9,10 @@ class A {
try {
A::B;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f74498b7c479 100644
--- a/Zend/tests/isset/isset_array.phpt
+++ b/Zend/tests/isset/isset_array.phpt
@@ -24,14 +24,14 @@ var_dump(isset($array[STDIN]));
try {
isset($array[[]]);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
isset($array[new stdClass()]);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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/lazy_objects/rfc/rfc_example_006.phpt b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
index c46756718649..15cf5fdad65c 100644
--- a/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
+++ b/Zend/tests/lazy_objects/rfc/rfc_example_006.phpt
@@ -32,8 +32,8 @@ var_dump($object2);
try {
var_dump($object1->propB);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..06b7689900b6 100644
--- a/Zend/tests/lazy_objects/typed_properties_001.phpt
+++ b/Zend/tests/lazy_objects/typed_properties_001.phpt
@@ -20,14 +20,14 @@ $test = $reflector->newLazyProxy(function () {
$ref = "foobar";
try {
$test->$name =& $ref;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d5d70f0a3c1a 100644
--- a/Zend/tests/live_range_phi_leak.phpt
+++ b/Zend/tests/live_range_phi_leak.phpt
@@ -11,9 +11,9 @@ function test($k) {
}
try {
test(new stdClass);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7e1c48790800 100644
--- a/Zend/tests/magic_methods/bug26166.phpt
+++ b/Zend/tests/magic_methods/bug26166.phpt
@@ -40,8 +40,8 @@ class NoneTest
$o = new NoneTest;
try {
echo $o;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "===THROW===\n";
@@ -56,14 +56,14 @@ class ErrorTest
$o = new ErrorTest;
try {
echo $o;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6722ea397186 100644
--- a/Zend/tests/magic_methods/bug45186.phpt
+++ b/Zend/tests/magic_methods/bug45186.phpt
@@ -33,8 +33,8 @@ call_user_func(array('BAR','x'));
call_user_func('BAR::www');
try {
call_user_func('self::y');
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..bea4427ade40 100644
--- a/Zend/tests/magic_methods/bug45186_2.phpt
+++ b/Zend/tests/magic_methods/bug45186_2.phpt
@@ -28,13 +28,13 @@ $x->test();
call_user_func(array('BAR','x'));
try {
call_user_func('BAR::www');
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func('self::y');
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d27ea5e18d53 100644
--- a/Zend/tests/magic_methods/bug76667.phpt
+++ b/Zend/tests/magic_methods/bug76667.phpt
@@ -18,12 +18,12 @@ class T {
$x = new T;
try {
$x->x = 1;
-} catch (\DivisionByZeroError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..32ec8bcac38a 100644
--- a/Zend/tests/match/043.phpt
+++ b/Zend/tests/match/043.phpt
@@ -8,8 +8,8 @@ class Beep {}
function test(mixed $var) {
try {
match($var) {};
- } catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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..77b6e58d7a34 100644
--- a/Zend/tests/match/045.phpt
+++ b/Zend/tests/match/045.phpt
@@ -10,9 +10,9 @@ function test() {
}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..008b83fbc1a0 100644
--- a/Zend/tests/match/048.phpt
+++ b/Zend/tests/match/048.phpt
@@ -10,8 +10,8 @@ class Beep {}
function test(mixed $var) {
try {
match($var) {};
- } catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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..23933003d5bb 100644
--- a/Zend/tests/match/049.phpt
+++ b/Zend/tests/match/049.phpt
@@ -10,8 +10,8 @@ class Beep {}
function test(mixed $var) {
try {
match($var) {};
- } catch (UnhandledMatchError $e) {
- print $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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..e3238f034937 100644
--- a/Zend/tests/match/unmatched_enum.phpt
+++ b/Zend/tests/match/unmatched_enum.phpt
@@ -12,10 +12,10 @@ try {
match (Foo::Bar) {
Foo::Baz => 42,
};
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4463d97263a2 100644
--- a/Zend/tests/methods-on-non-objects-call-user-func.phpt
+++ b/Zend/tests/methods-on-non-objects-call-user-func.phpt
@@ -5,9 +5,9 @@ call_user_func() in combination with "Call to a member function method() on a no
$comparator = null;
try {
var_dump(call_user_func([$comparator, 'compare'], 1, 2));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5e7c02e7a1c0 100644
--- a/Zend/tests/methods-on-non-objects-catch.phpt
+++ b/Zend/tests/methods-on-non-objects-catch.phpt
@@ -9,12 +9,11 @@ set_error_handler(function($code, $message) {
$x= null;
try {
var_dump($x->method());
-} catch (Error $e) {
- var_dump($e->getCode(), $e->getMessage());
+} catch (Throwable $e) {
+ 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..5f3306d5bcea 100644
--- a/Zend/tests/methods-on-non-objects-usort.phpt
+++ b/Zend/tests/methods-on-non-objects-usort.phpt
@@ -11,8 +11,8 @@ $list= [1, 4, 2, 3, -1];
usort($list, function($a, $b) use ($comparator) {
try {
return $comparator->compare($a, $b);
- } catch (Error $e) {
- var_dump($e->getCode(), $e->getMessage());
+ } catch (Throwable $e) {
+ 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..a836044df9a1 100644
--- a/Zend/tests/mod_001.phpt
+++ b/Zend/tests/mod_001.phpt
@@ -9,12 +9,12 @@ $b = array();
try {
$c = $a % $b;
var_dump($c);
-} catch (TypeError $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..fee2d0c9c627 100644
--- a/Zend/tests/mul_001.phpt
+++ b/Zend/tests/mul_001.phpt
@@ -8,8 +8,8 @@ $b = array(1);
try {
var_dump($a * $b);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..717ad657380c 100644
--- a/Zend/tests/named_params/__invoke.phpt
+++ b/Zend/tests/named_params/__invoke.phpt
@@ -21,8 +21,8 @@ $test(b: 'B', a: 'A');
$test(b: 'B');
try {
$test(b: 'B', c: 'C');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -38,15 +38,15 @@ $test3(b: 'B', a: 'A');
$test3(b: 'B');
try {
$test3(b: 'B', c: 'C');
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..58ba7605a370 100644
--- a/Zend/tests/named_params/assert.phpt
+++ b/Zend/tests/named_params/assert.phpt
@@ -6,25 +6,25 @@ Calling assert with named params
assert(assertion: true);
try {
assert(assertion: false);
-} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
assert(assertion: true, description: "Description");
try {
assert(assertion: false, description: "Description");
-} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(description: "Description");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..caee975632a2 100644
--- a/Zend/tests/named_params/attributes.phpt
+++ b/Zend/tests/named_params/attributes.phpt
@@ -26,8 +26,8 @@ var_dump($attr->newInstance());
$attr = (new ReflectionClass(Test2::class))->getAttributes()[0];
try {
var_dump($attr->newInstance());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..74b6e6707a19 100644
--- a/Zend/tests/named_params/call_user_func.phpt
+++ b/Zend/tests/named_params/call_user_func.phpt
@@ -36,18 +36,18 @@ call_user_func($test_ref, ref: null);
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";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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..b708c63ad80c 100644
--- a/Zend/tests/named_params/call_user_func_array.phpt
+++ b/Zend/tests/named_params/call_user_func_array.phpt
@@ -17,13 +17,13 @@ namespace {
call_user_func_array($test_variadic, ['A', 'c' => 'C']);
try {
call_user_func_array($test, ['d' => 'D']);
- } catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func_array($test, ['c' => 'C', 'A']);
- } catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
}
@@ -35,13 +35,13 @@ namespace Foo {
call_user_func_array($test_variadic, ['A', 'c' => 'C']);
try {
call_user_func_array($test, ['d' => 'D']);
- } catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
call_user_func_array($test, ['c' => 'C', 'A']);
- } catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ 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..dab88481d7ea 100644
--- a/Zend/tests/named_params/cannot_pass_by_ref.phpt
+++ b/Zend/tests/named_params/cannot_pass_by_ref.phpt
@@ -5,9 +5,9 @@ Cannot pass by reference error with named parameters
function test($a, &$e) {}
try {
test(e: 42);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4617a21192a4 100644
--- a/Zend/tests/named_params/ctor_extra_named_args.phpt
+++ b/Zend/tests/named_params/ctor_extra_named_args.phpt
@@ -7,17 +7,17 @@ class Test {}
try {
new stdClass(x: "nope");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
new Test(x: "nope");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..00f67d4ea1e8 100644
--- a/Zend/tests/named_params/duplicate_param.phpt
+++ b/Zend/tests/named_params/duplicate_param.phpt
@@ -7,17 +7,17 @@ function test($a) {}
try {
test(a: 1, a: 2);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(1, a: 2);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..aaaa5c5dce92 100644
--- a/Zend/tests/named_params/gh17216.phpt
+++ b/Zend/tests/named_params/gh17216.phpt
@@ -12,11 +12,11 @@ $callback = [$o, 'trampoline'];
$array = ["a" => "b", 1];
try {
forward_static_call_array($callback, $array);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/missing_param.phpt b/Zend/tests/named_params/missing_param.phpt
index f8b0b356ceeb..17e2f33c67f4 100644
--- a/Zend/tests/named_params/missing_param.phpt
+++ b/Zend/tests/named_params/missing_param.phpt
@@ -8,20 +8,20 @@ function test($a, $b, $c, $d) {
try {
test(a: 'a', d: 'd');
-} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_keys(strict: true);
-} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
array_keys([], strict: true);
-} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..631776efeba1 100644
--- a/Zend/tests/named_params/unknown_named_param.phpt
+++ b/Zend/tests/named_params/unknown_named_param.phpt
@@ -11,37 +11,37 @@ function test2(...$a) {
try {
test(b: 42);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(b: new stdClass);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(b: 2, a: 1);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new ArrayIterator(['unknown' => 42]));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(a: 42);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c4eeffb9428f 100644
--- a/Zend/tests/named_params/unpack.phpt
+++ b/Zend/tests/named_params/unpack.phpt
@@ -17,14 +17,14 @@ test(...['a', 'b' => 'b', 'c' => 'c']);
try {
test(...['a', 'b' => 'b', 'c']);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...['a', 'a' => 'a']);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$ary = ['b' => 0];
@@ -38,14 +38,14 @@ test(...new ArrayIterator(['a', 'b' => 'b', 'c' => 'c']));
try {
test(...new ArrayIterator(['a', 'b' => 'b', 'c']));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(...new ArrayIterator(['a', 'a' => 'a']));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..85b407998469 100644
--- a/Zend/tests/named_params/unpack_and_named_1.phpt
+++ b/Zend/tests/named_params/unpack_and_named_1.phpt
@@ -19,13 +19,13 @@ test2(...['b' => 2, 'a' => 1], d: 40);
try {
test2(...[1, 2], b: 20);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(...[1, 'b' => 2], b: 20);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c033f43a38ed 100644
--- a/Zend/tests/namespaces/ns_076.phpt
+++ b/Zend/tests/namespaces/ns_076.phpt
@@ -7,24 +7,24 @@ use Error;
try {
$a = array(unknown => unknown);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo unknown;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo \unknown;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..9027b8d28e82 100644
--- a/Zend/tests/not_002.phpt
+++ b/Zend/tests/not_002.phpt
@@ -8,8 +8,8 @@ $b = array(1,2);
try {
var_dump(~$b);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..78ee39eebe83 100644
--- a/Zend/tests/nullsafe_operator/014.phpt
+++ b/Zend/tests/nullsafe_operator/014.phpt
@@ -6,8 +6,8 @@ Test nullsafe in binary op
function try_and_dump($fn) {
try {
var_dump($fn());
- } catch (\Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..23149c4070ac 100644
--- a/Zend/tests/nullsafe_operator/016.phpt
+++ b/Zend/tests/nullsafe_operator/016.phpt
@@ -14,13 +14,13 @@ function set(&$ref, $value) {
function test($foo) {
try {
set($foo?->bar, 'bar');
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(strrev('tes'))($foo?->bar, 'bar2');
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..cd2ed06884b2 100644
--- a/Zend/tests/nullsafe_operator/026.phpt
+++ b/Zend/tests/nullsafe_operator/026.phpt
@@ -10,17 +10,17 @@ $null = null;
try {
Test::${$null?->foo}->bar;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::{$null?->foo}()->bar;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4189b85dfea4 100644
--- a/Zend/tests/nullsafe_operator/039.phpt
+++ b/Zend/tests/nullsafe_operator/039.phpt
@@ -9,10 +9,10 @@ set_error_handler(function($_, $m) {
try {
$foo?->foo;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f6f9b616d7c0 100644
--- a/Zend/tests/nullsafe_operator/constant_propagation.phpt
+++ b/Zend/tests/nullsafe_operator/constant_propagation.phpt
@@ -7,10 +7,10 @@ class Bar { const FOO = "foo"; }
try {
Bar::FOO?->length();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/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..a76e26cae6dc 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
@@ -15,8 +15,8 @@ try {
$a = foxcache("dolor");
$a += "sit";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("5 amet,");
@@ -26,8 +26,8 @@ try {
$a = foxcache("adipiscing");
$a -= "elit,";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("11 sed");
@@ -37,8 +37,8 @@ try {
$a = foxcache("eiusmod");
$a *= "tempor";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("17 incididunt");
@@ -48,8 +48,8 @@ try {
$a = foxcache("labore");
$a /= "et";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("23 dolore");
@@ -59,8 +59,8 @@ try {
$a = foxcache("aliqua.");
$a **= "Ut";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("31 enim");
@@ -70,8 +70,8 @@ try {
$a = foxcache("minim");
$a %= "veniam,";
var_dump($a);
-} catch (\TypeError $e) {
- echo get_class($e) . ': ' . $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("41 minim");
@@ -80,8 +80,8 @@ try {
var_dump($a);
$a = foxcache("quis");
$a <<= "nostrud";
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($a);
echo "---", PHP_EOL;
@@ -92,8 +92,8 @@ try {
$a = foxcache("laboris");
$a >>= "nisi";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("59 ut");
@@ -106,15 +106,15 @@ try {
$a = foxcache("ex");
$a |= 73;
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = foxcache(79);
$a |= "ea";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("83 commodo");
@@ -127,15 +127,15 @@ try {
$a = foxcache("Duis");
$a &= 103;
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = foxcache(107);
$a &= "aute";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
$a = foxcache("109 irure");
@@ -148,15 +148,15 @@ try {
$a = foxcache("in");
$a ^= 137;
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a = foxcache(139);
$a ^= "reprehenderit";
var_dump($a);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..ff3202e2c29d 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
@@ -6,110 +6,110 @@ Invalid numeric string TypeErrors and E_WARNINGs
var_dump("2 Lorem" + "3 ipsum");
try {
var_dump("dolor" + "sit");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("5 amet," - "7 consectetur");
try {
var_dump("adipiscing" - "elit,");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("11 sed" * "13 do");
try {
var_dump("eiusmod" * "tempor");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("17 incididunt" / "19 ut");
try {
var_dump("labore" / "et");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("23 dolore" ** "29 magna");
try {
var_dump("aliqua." ** "Ut");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("41 minim" << "43 veniam,");
try {
var_dump("quis" << "nostrud");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("47 exercitation" >> "53 ullamco");
try {
var_dump("laboris" >> "nisi");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("59 ut" | 61);
var_dump(67 | "71 aliquip");
try {
var_dump("ex" | 73);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(79 | "ea");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("83 commodo" & 89);
var_dump(97 & "101 consequat.");
try {
var_dump("Duis" & 103);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(107 & "aute");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump("109 irure" ^ 113);
var_dump(127 ^ "131 dolor");
try {
var_dump("in" ^ 137);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(139 ^ "reprehenderit");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump(+"149 in");
try {
var_dump(+"voluptate");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "---", PHP_EOL;
var_dump(-"151 velit");
try {
var_dump(-"esse");
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..4516cb24f80a 100644
--- a/Zend/tests/numeric_strings/string_offset.phpt
+++ b/Zend/tests/numeric_strings/string_offset.phpt
@@ -30,8 +30,8 @@ $keys = [
foreach ($keys as $key) {
try {
var_dump($str[$key]);
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -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..e58701b94eb2 100644
--- a/Zend/tests/offset_array.phpt
+++ b/Zend/tests/offset_array.phpt
@@ -19,15 +19,15 @@ var_dump($arr[$fp]);
$obj = new stdClass;
try {
var_dump($arr[$obj]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr1 = Array(1,2,3);
try {
var_dump($arr[$arr1]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c979b5a3613b 100644
--- a/Zend/tests/offset_string.phpt
+++ b/Zend/tests/offset_string.phpt
@@ -10,14 +10,14 @@ var_dump($str[0.0836]);
var_dump($str[NULL]);
try {
var_dump($str["run away"]);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str["13"]);
try {
var_dump($str["14.5"]);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($str["15 and then some"]);
@@ -27,22 +27,22 @@ var_dump($str[FALSE]);
$fp = fopen(__FILE__, "r");
try {
var_dump($str[$fp]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj = new stdClass;
try {
var_dump($str[$obj]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr = Array(1,2,3);
try {
var_dump($str[$arr]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8ad3a7bb97fd 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!");
}
@@ -100,8 +100,8 @@ foreach ($illegalValues as $illegalValue) {
try {
eval("return ~$illegalValue;");
echo "No error for ~$illegalValue\n";
- } catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -111,15 +111,15 @@ foreach ($illegalValues as $illegalValue) {
try {
$copy++;
echo "No error for $copy++\n";
- } catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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";
+ } catch (Throwable $e) {
+ 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..26f10ccb9894 100644
--- a/Zend/tests/oss_fuzz_434346548.phpt
+++ b/Zend/tests/oss_fuzz_434346548.phpt
@@ -13,10 +13,10 @@ function test($y = new Foo() < "") {
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..32e06f1ff10b 100644
--- a/Zend/tests/pipe_operator/ast.phpt
+++ b/Zend/tests/pipe_operator/ast.phpt
@@ -7,76 +7,76 @@ print "Concat, which binds higher\n";
try {
assert(false && foo() . bar() |> baz() . quux());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && (foo() . bar()) |> baz() . quux());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() . (bar() |> baz()) . quux());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() . bar() |> (baz() . quux()));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && (foo() . bar() |> baz()) . quux());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() . (bar() |> baz() . quux()));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
print "<, which binds lower\n";
try {
assert(false && foo() < bar() |> baz());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && (foo() < bar()) |> baz());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() < (bar() |> baz()));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() |> bar() < baz());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && (foo() |> bar()) < baz());
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
assert(false && foo() |> (bar() < baz()));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
@@ -85,25 +85,25 @@ print "misc examples\n";
try {
assert(false && foo() |> (bar() |> baz(...)));
-} catch (AssertionError $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..052db32ea7b7 100644
--- a/Zend/tests/pipe_operator/call_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_by_ref.phpt
@@ -17,8 +17,8 @@ try {
$a = 5;
$res1 = $a |> _modify(...);
var_dump($res1);
-} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// Complex variables.
@@ -26,12 +26,12 @@ try {
$a = ['foo' => 'beep'];
$res2 = $a |> _append(...);
var_dump($res2);
-} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..6476105fdad8 100644
--- a/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
+++ b/Zend/tests/pipe_operator/call_prefer_by_ref.phpt
@@ -8,8 +8,8 @@ $a = ['hello', 'world'];
try {
$r = $a |> array_multisort(...);
var_dump($r);
-} catch (\Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
index 2ecfbab6348f..00c868483484 100644
--- a/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
+++ b/Zend/tests/pipe_operator/oss_fuzz_427814452.phpt
@@ -5,22 +5,22 @@ OSS-Fuzz #427814452
try {
false |> assert(...);
-} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': "', $e->getMessage(), '"', "\n";
}
try {
0 |> "assert"(...);
-} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': "', $e->getMessage(), '"', "\n";
}
try {
false |> ("a"."ssert")(...);
-} catch (\AssertionError $e) {
- echo $e::class, ": '", $e->getMessage(), "'\n";
+} catch (\Throwable $e) {
+ 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..c711393502a2 100644
--- a/Zend/tests/pipe_operator/prec_005.phpt
+++ b/Zend/tests/pipe_operator/prec_005.phpt
@@ -5,10 +5,10 @@ Pipe precedence 005
try {
assert(false && 1 |> (fn() => 2));
-} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-assert(false && 1 |> (fn() => 2))
+AssertionError: assert(false && 1 |> (fn() => 2))
diff --git a/Zend/tests/pow_array_leak.phpt b/Zend/tests/pow_array_leak.phpt
index 06dce0ac6a2b..be7bf6b0638b 100644
--- a/Zend/tests/pow_array_leak.phpt
+++ b/Zend/tests/pow_array_leak.phpt
@@ -6,27 +6,27 @@ Memory leak on ** with result==op1 array
$x = [0];
try {
$x **= 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($x);
$x = [0];
try {
$x **= $x;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..57ac29257cbb 100644
--- a/Zend/tests/prop_const_expr/non_enums_rhs.phpt
+++ b/Zend/tests/prop_const_expr/non_enums_rhs.phpt
@@ -12,8 +12,8 @@ function foo($prop = (new A)->prop) {}
function test() {
try {
foo();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..8cc6202097d5 100644
--- a/Zend/tests/property_access_errors_for_guarded_properties.phpt
+++ b/Zend/tests/property_access_errors_for_guarded_properties.phpt
@@ -34,22 +34,22 @@ class Test {
$test = new Test;
try {
$test->prop = "bar";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4ef9358e9864 100644
--- a/Zend/tests/property_exists_basic.phpt
+++ b/Zend/tests/property_exists_basic.phpt
@@ -42,28 +42,28 @@ var_dump(property_exists($foo,""));
try {
var_dump(property_exists(array(), "test"));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(property_exists(1, "test"));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(property_exists(3.14, "test"));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(property_exists(true, "test"));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(property_exists(null, "test"));
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..9153f4996210 100644
--- a/Zend/tests/property_hooks/ast_printing.phpt
+++ b/Zend/tests/property_hooks/ast_printing.phpt
@@ -19,13 +19,13 @@ try {
get => 42;
}
});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..63910574bf75 100644
--- a/Zend/tests/property_hooks/backed_delegated_read_write.phpt
+++ b/Zend/tests/property_hooks/backed_delegated_read_write.phpt
@@ -45,14 +45,14 @@ $test = new Test;
try {
$test->prop = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..280f2a0791b9 100644
--- a/Zend/tests/property_hooks/bug001.phpt
+++ b/Zend/tests/property_hooks/bug001.phpt
@@ -20,11 +20,11 @@ $c = new C;
try {
$c->x = 3;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0409c92a2b13 100644
--- a/Zend/tests/property_hooks/cache.phpt
+++ b/Zend/tests/property_hooks/cache.phpt
@@ -18,15 +18,15 @@ function doTest(Test $test) {
$test->prop = [];
try {
$test->prop[] = 1;
- } catch (\Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
isset($test->prop);
isset($test->prop[0]);
try {
unset($test->prop);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..81fc5d2d0ace 100644
--- a/Zend/tests/property_hooks/default_value_inheritance.phpt
+++ b/Zend/tests/property_hooks/default_value_inheritance.phpt
@@ -28,14 +28,14 @@ function test(P $p) {
var_dump($p->a);
try {
var_dump($p->b);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($p->c);
try {
var_dump($p->d);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..6a09bb115e51 100644
--- a/Zend/tests/property_hooks/direct_hook_call.phpt
+++ b/Zend/tests/property_hooks/direct_hook_call.phpt
@@ -13,16 +13,16 @@ class Test {
$test = new Test;
try {
$test->{'$prop::get'}();
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->{'$prop::set'}('foo');
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..a442c879dc26 100644
--- a/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
+++ b/Zend/tests/property_hooks/final_prop_promoted_ast.phpt
@@ -6,12 +6,12 @@ try {
assert(false && new class {
public function __construct(public final $prop) {}
});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a5a64c0950ba 100644
--- a/Zend/tests/property_hooks/foreach_val_to_ref.phpt
+++ b/Zend/tests/property_hooks/foreach_val_to_ref.phpt
@@ -24,11 +24,11 @@ function test($object) {
try {
test(new ByVal);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7c4923c86452 100644
--- a/Zend/tests/property_hooks/get.phpt
+++ b/Zend/tests/property_hooks/get.phpt
@@ -14,11 +14,11 @@ var_dump($test->prop);
try {
$test->prop = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b35be8751bfa 100644
--- a/Zend/tests/property_hooks/get_by_ref.phpt
+++ b/Zend/tests/property_hooks/get_by_ref.phpt
@@ -15,20 +15,20 @@ $test = new Test;
try {
$test->byVal = [];
$test->byVal[] = 42;
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$test->byVal =& $ref;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7e0be4e38d92 100644
--- a/Zend/tests/property_hooks/get_by_ref_auto.phpt
+++ b/Zend/tests/property_hooks/get_by_ref_auto.phpt
@@ -11,15 +11,15 @@ $test = new Test;
try {
$test->byVal[] = 42;
-} catch (\Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$test->byVal =& $ref;
-} catch (Error $e) {
- echo get_class($e) . ': ' . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..0302e3aa7694 100644
--- a/Zend/tests/property_hooks/get_type_check.phpt
+++ b/Zend/tests/property_hooks/get_type_check.phpt
@@ -15,12 +15,12 @@ class Test {
$test = new Test;
try {
var_dump($test->prop1);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c8d8131de8a1 100644
--- a/Zend/tests/property_hooks/gh15187_3.phpt
+++ b/Zend/tests/property_hooks/gh15187_3.phpt
@@ -17,8 +17,8 @@ foreach ($c as $k => &$v) {
if ($k === 'c') {
try {
$v = 'foo';
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..136fc8cc587c 100644
--- a/Zend/tests/property_hooks/gh15644.phpt
+++ b/Zend/tests/property_hooks/gh15644.phpt
@@ -16,17 +16,17 @@ $c = new C();
try {
$c->prop1 = 'hello world';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->prop2 = 'hello world';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3154873a0620 100644
--- a/Zend/tests/property_hooks/gh16185_002.phpt
+++ b/Zend/tests/property_hooks/gh16185_002.phpt
@@ -21,10 +21,10 @@ $c->init();
try {
foreach ($c as &$prop) {}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d6179f763f3e 100644
--- a/Zend/tests/property_hooks/gh17101.phpt
+++ b/Zend/tests/property_hooks/gh17101.phpt
@@ -7,13 +7,13 @@ try {
assert(false && new class {
public function __construct( #[Foo] public private(set) bool $boolVal = false { final set => $this->boolVal = 1;} ) {}
});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b2df80519646 100644
--- a/Zend/tests/property_hooks/gh20270.phpt
+++ b/Zend/tests/property_hooks/gh20270.phpt
@@ -31,21 +31,21 @@ $b = new B();
try {
$b->prop1 = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($b->prop1);
try {
$b->prop2 = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..198892adfae6 100644
--- a/Zend/tests/property_hooks/indirect_modification.phpt
+++ b/Zend/tests/property_hooks/indirect_modification.phpt
@@ -23,14 +23,14 @@ var_dump($test->byVal);
$test->byVal = [];
try {
$test->byVal[] = 1;
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->byVal);
try {
$ref =& $test->byVal;
-} catch (\Error $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..b2b31750fad5 100644
--- a/Zend/tests/property_hooks/magic_interaction.phpt
+++ b/Zend/tests/property_hooks/magic_interaction.phpt
@@ -18,24 +18,24 @@ class B extends A {
echo __METHOD__, "($name)\n";
try {
$this->$name;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __set($name, $value) {
echo __METHOD__, "($name, $value)\n";
try {
$this->$name = $value;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __isset($name) {
echo __METHOD__, "($name)\n";
try {
var_dump(isset($this->$name));
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
public function __unset($name) {
@@ -49,8 +49,8 @@ var_dump(isset($b->prop));
$b->prop = 1;
try {
unset($b->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..2848d38273d3 100644
--- a/Zend/tests/property_hooks/override_add_get.phpt
+++ b/Zend/tests/property_hooks/override_add_get.phpt
@@ -20,8 +20,8 @@ $a = new A;
$a->prop = 1;
try {
var_dump($a->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ba3c9c94127e 100644
--- a/Zend/tests/property_hooks/override_add_set.phpt
+++ b/Zend/tests/property_hooks/override_add_set.phpt
@@ -19,8 +19,8 @@ class B extends A {
$a = new A;
try {
$a->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0519b652254e 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
@@ -12,10 +12,10 @@ class Foo {
$foo = new Foo();
try {
var_dump($foo->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0fc8fea23b48 100644
--- a/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_typed_uninitialized.phpt
@@ -16,10 +16,10 @@ class C extends P {
$c = new C();
try {
var_dump($c->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0e96f3fa99e0 100644
--- a/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_get_plain_zpp.phpt
@@ -18,10 +18,10 @@ class B extends A {
$b = new B();
try {
var_dump($b->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..04967cbcf539 100644
--- a/Zend/tests/property_hooks/parent_get_undefined_property.phpt
+++ b/Zend/tests/property_hooks/parent_get_undefined_property.phpt
@@ -16,10 +16,10 @@ class C extends P {
$c = new C();
try {
var_dump($c->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5a6984ae7e19 100644
--- a/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
+++ b/Zend/tests/property_hooks/parent_set_plain_zpp.phpt
@@ -18,10 +18,10 @@ class B extends A {
$b = new B();
try {
$b->prop = 42;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..38658eac96fa 100644
--- a/Zend/tests/property_hooks/parent_superfluous_args.phpt
+++ b/Zend/tests/property_hooks/parent_superfluous_args.phpt
@@ -34,18 +34,18 @@ var_dump($b->virtual);
// Calling the implicit parent hook with extra args is not ok, since it is an internal function.
try {
var_dump($b->backed = 42);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($b->backed);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e01e2dd719d9 100644
--- a/Zend/tests/property_hooks/parent_wrong_property_info.phpt
+++ b/Zend/tests/property_hooks/parent_wrong_property_info.phpt
@@ -16,10 +16,10 @@ class B extends A {
$b = new B;
try {
var_dump($b->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b8e1e5671f3c 100644
--- a/Zend/tests/property_hooks/read_sibling_backing_value.phpt
+++ b/Zend/tests/property_hooks/read_sibling_backing_value.phpt
@@ -25,10 +25,10 @@ $test = new Test;
try {
var_dump($test->a);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..147f0b0e5d2c 100644
--- a/Zend/tests/property_hooks/set.phpt
+++ b/Zend/tests/property_hooks/set.phpt
@@ -16,17 +16,17 @@ var_dump($test->_prop);
try {
var_dump($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(isset($test->prop));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d9b2b29fb3ce 100644
--- a/Zend/tests/property_hooks/unset.phpt
+++ b/Zend/tests/property_hooks/unset.phpt
@@ -18,12 +18,12 @@ $test = new Test;
$test->prop = 42;
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..61eeba0e4f8f 100644
--- a/Zend/tests/property_hooks/virtual_read_write.phpt
+++ b/Zend/tests/property_hooks/virtual_read_write.phpt
@@ -33,17 +33,17 @@ $test = new Test;
try {
$test->prop = 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..faa4ae330bf7 100644
--- a/Zend/tests/readonly_classes/gh10377.phpt
+++ b/Zend/tests/readonly_classes/gh10377.phpt
@@ -20,23 +20,23 @@ $anon = new class {
var_dump($readonly_anon->field);
try {
$readonly_anon->field = 123;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($readonly_anon->field);
var_dump($anon->field);
try {
$anon->field = 123;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6b3234a18fe3 100644
--- a/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_dynamic_property.phpt
@@ -11,10 +11,10 @@ $foo = new Foo();
try {
$foo->bar = 1;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..acd9c3e68974 100644
--- a/Zend/tests/readonly_classes/readonly_class_property1.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property1.phpt
@@ -16,10 +16,10 @@ $foo = new Foo();
try {
$foo->bar = 2;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..ad491185bd87 100644
--- a/Zend/tests/readonly_classes/readonly_class_property2.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_property2.phpt
@@ -14,10 +14,10 @@ $foo = new Foo(1);
try {
$foo->bar = 2;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..c8ee17cb295c 100644
--- a/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
+++ b/Zend/tests/readonly_classes/readonly_class_unserialize_error.phpt
@@ -7,10 +7,10 @@ readonly class C {}
try {
$readonly = unserialize('O:1:"C":1:{s:1:"x";b:1;}');
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..19008bf29f1c 100644
--- a/Zend/tests/readonly_props/array_append_initialization.phpt
+++ b/Zend/tests/readonly_props/array_append_initialization.phpt
@@ -21,17 +21,17 @@ function init() {
try {
(new C)->init();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
init();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..67e3d31fae8e 100644
--- a/Zend/tests/readonly_props/by_ref_foreach.phpt
+++ b/Zend/tests/readonly_props/by_ref_foreach.phpt
@@ -20,10 +20,10 @@ $test->init();
try {
foreach ($test as &$prop) {}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..53d2bcef5873 100644
--- a/Zend/tests/readonly_props/cache_slot.phpt
+++ b/Zend/tests/readonly_props/cache_slot.phpt
@@ -29,8 +29,8 @@ $test->setProp("a");
var_dump($test->prop);
try {
$test->setProp("b");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop);
echo "\n";
@@ -38,13 +38,13 @@ echo "\n";
$test = new Test;
try {
$test->initAndAppendProp2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->initAndAppendProp2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2);
echo "\n";
@@ -65,13 +65,13 @@ $appendProp2 = (function() {
})->bindTo($test, Test::class);
try {
$appendProp2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$appendProp2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ff41043d771a 100644
--- a/Zend/tests/readonly_props/gh7942.phpt
+++ b/Zend/tests/readonly_props/gh7942.phpt
@@ -13,10 +13,10 @@ class Foo {
try {
$i = 42;
new Foo($i);
-} catch (Error $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..c694d1b7ca1c 100644
--- a/Zend/tests/readonly_props/initialization_scope.phpt
+++ b/Zend/tests/readonly_props/initialization_scope.phpt
@@ -19,8 +19,8 @@ class B extends A {
$test = new B;
try {
$test->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f734c0c8817e 100644
--- a/Zend/tests/readonly_props/magic_get_set.phpt
+++ b/Zend/tests/readonly_props/magic_get_set.phpt
@@ -35,18 +35,18 @@ $test = new Test;
var_dump(isset($test->prop));
try {
var_dump($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$test->unsetProp();
@@ -56,16 +56,16 @@ var_dump($test->prop);
$test->prop = 2;
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f7618b279d4d 100644
--- a/Zend/tests/readonly_props/promotion.phpt
+++ b/Zend/tests/readonly_props/promotion.phpt
@@ -15,8 +15,8 @@ var_dump(new Point);
$point = new Point(1.0, 2.0, 3.0);
try {
$point->x = 4.0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d39de17556a7 100644
--- a/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
+++ b/Zend/tests/readonly_props/readonly_assign_no_sideeffect.phpt
@@ -24,10 +24,10 @@ $foo = new Foo("");
try {
$foo->write();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..39b150991f6a 100644
--- a/Zend/tests/readonly_props/readonly_clone_error1.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error1.phpt
@@ -20,8 +20,8 @@ $foo = new Foo(1);
try {
clone $foo;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..d2a8f4017559 100644
--- a/Zend/tests/readonly_props/readonly_clone_error2.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error2.phpt
@@ -26,17 +26,17 @@ $foo = new Foo(1, 1);
try {
$foo->wrongCloneOld();
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$foo->wrongCloneNew();
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..e436cd18a047 100644
--- a/Zend/tests/readonly_props/readonly_clone_error3.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error3.phpt
@@ -28,17 +28,17 @@ $foo = new Foo(1, 1);
try {
$foo->wrongCloneOld();
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
$foo->wrongCloneNew();
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..7596a78e3487 100644
--- a/Zend/tests/readonly_props/readonly_clone_error4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error4.phpt
@@ -20,14 +20,14 @@ $foo = new Foo(1);
try {
clone $foo;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
clone $foo;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..b795a1cc9aae 100644
--- a/Zend/tests/readonly_props/readonly_clone_error5.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error5.phpt
@@ -34,31 +34,31 @@ class TestSetTwice {
try {
var_dump(clone (new TestSetOnce()));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetOnce()));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetTwice()));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone (new TestSetTwice()));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f4ed5db4bb23 100644
--- a/Zend/tests/readonly_props/readonly_clone_error6.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error6.phpt
@@ -21,14 +21,14 @@ var_dump($foo);
try {
$foo->__clone();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$foo->__clone();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..6925daf86fd9 100644
--- a/Zend/tests/readonly_props/readonly_clone_error7.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_error7.phpt
@@ -18,16 +18,16 @@ $foo = new Foo([]);
// First call fills the cache slot
try {
var_dump(clone $foo);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(clone $foo);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ab13e88a5c36 100644
--- a/Zend/tests/readonly_props/readonly_clone_success4.phpt
+++ b/Zend/tests/readonly_props/readonly_clone_success4.phpt
@@ -12,8 +12,8 @@ class Foo {
{
try {
$this->bar = "foo";
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..36ad807f2424 100644
--- a/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
+++ b/Zend/tests/readonly_props/readonly_coercion_type_error.phpt
@@ -10,8 +10,8 @@ class Foo {
$this->bar = 'bar';
try {
$this->bar = 42;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..bf6a88c8b30a 100644
--- a/Zend/tests/readonly_props/readonly_containing_object.phpt
+++ b/Zend/tests/readonly_props/readonly_containing_object.phpt
@@ -17,18 +17,18 @@ $test->prop->foo += 1;
$test->prop->foo++;
try {
$test->prop += 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
--$test->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d251e5c37c9e 100644
--- a/Zend/tests/readonly_props/readonly_modification.phpt
+++ b/Zend/tests/readonly_props/readonly_modification.phpt
@@ -20,63 +20,63 @@ $test = new Test;
var_dump($test->prop); // Read.
try {
$test->prop = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop += 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++$test->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ref =& $test->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop =& $ref;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
byRef($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop2); // Read.
try {
$test->prop2[] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2[0][] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/unset.phpt b/Zend/tests/readonly_props/unset.phpt
index 823c021f6122..7d6db9fc5abb 100644
--- a/Zend/tests/readonly_props/unset.phpt
+++ b/Zend/tests/readonly_props/unset.phpt
@@ -14,8 +14,8 @@ class Test {
$test = new Test(1);
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test2 {
@@ -39,8 +39,8 @@ var_dump($test->prop); // Call __get.
var_dump($test->prop); // Don't call __get.
try {
unset($test->prop); // Unset initialized, illegal.
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test3 {
@@ -50,8 +50,8 @@ class Test3 {
$test = new Test3;
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Test4 {
@@ -60,8 +60,8 @@ class Test4 {
public function __construct() {
try {
unset($this->prop);
- } catch (Error $e) {
- echo $e::class, ': ', $e->getMessage(), PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -74,19 +74,19 @@ $test = new Test4;
var_dump($test->prop); // Don't call __get.
try {
unset($test->prop);
-} catch (Error $e) {
- echo $e::class, ': ', $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->prop); // Still don't call __get.
?>
--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
Error: Cannot unset readonly property Test4::$prop
int(1)
Error: Cannot unset readonly property Test4::$prop
diff --git a/Zend/tests/readonly_props/visibility_change.phpt b/Zend/tests/readonly_props/visibility_change.phpt
index f4a32f3cdaaf..6e06efd61e67 100644
--- a/Zend/tests/readonly_props/visibility_change.phpt
+++ b/Zend/tests/readonly_props/visibility_change.phpt
@@ -17,8 +17,8 @@ class B extends A {
$a = new A();
try {
var_dump($a->prop);
-} catch (Error $error) {
- echo $error->getMessage() . "\n";
+} catch (Throwable $error) {
+ 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..c136f400ae39 100644
--- a/Zend/tests/recursive_array_comparison.phpt
+++ b/Zend/tests/recursive_array_comparison.phpt
@@ -5,17 +5,17 @@ Comparison of a recursive array throws a catchable error
$a = [&$a];
try {
$a === [[]];
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
[[]] === $a;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..3a72d265305f 100644
--- a/Zend/tests/recv_init_ref_type.phpt
+++ b/Zend/tests/recv_init_ref_type.phpt
@@ -9,10 +9,10 @@ function test(array &$foo = []) {
try {
$bar = 42;
test($bar);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..2eb33e035cdd 100644
--- a/Zend/tests/require_once_warning_to_exception.phpt
+++ b/Zend/tests/require_once_warning_to_exception.phpt
@@ -10,10 +10,10 @@ set_error_handler("exception_error_handler");
try {
$results = require_once 'does-not-exist.php';
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..331786bcaa15 100644
--- a/Zend/tests/require_parse_exception.phpt
+++ b/Zend/tests/require_parse_exception.phpt
@@ -8,8 +8,8 @@ allow_url_include=1
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";
+ } catch (Throwable $e) {
+ 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..c96d51ff0083 100644
--- a/Zend/tests/required_param_after_optional_named_args.phpt
+++ b/Zend/tests/required_param_after_optional_named_args.phpt
@@ -7,11 +7,11 @@ function test($a = 1, $b) {
}
try {
test(b: 2);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..afa8a0e75bba 100644
--- a/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
+++ b/Zend/tests/restrict_globals/invalid_pass_by_ref.phpt
@@ -6,18 +6,18 @@ $GLOBALS must be passed by reference (runtime error)
function by_ref(&$ref) {}
try {
by_ref($GLOBALS);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
by_ref2($GLOBALS);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..efc356e1d10e 100644
--- a/Zend/tests/return_types/028.phpt
+++ b/Zend/tests/return_types/028.phpt
@@ -11,10 +11,10 @@ function foo(): stdClass {
try {
foo();
-} catch (Error $e) {
- echo $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
?>
--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..f804678f83d8 100644
--- a/Zend/tests/return_types/bug70557.phpt
+++ b/Zend/tests/return_types/bug70557.phpt
@@ -9,9 +9,9 @@ function getNumber() : int {
try {
getNumber();
-} catch (TypeError $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..c6ca9a5def02 100644
--- a/Zend/tests/return_types/never_disallowed5.phpt
+++ b/Zend/tests/return_types/never_disallowed5.phpt
@@ -13,9 +13,9 @@ class Foo {
try {
Foo::bar();
-} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..76b370a35780 100644
--- a/Zend/tests/self_and.phpt
+++ b/Zend/tests/self_and.phpt
@@ -15,8 +15,8 @@ var_dump($s);
try {
$s1 &= 11;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..ffee9a84675e 100644
--- a/Zend/tests/self_instanceof_outside_class.phpt
+++ b/Zend/tests/self_instanceof_outside_class.phpt
@@ -6,12 +6,12 @@ instanceof self outside a class
$fn = function() {
try {
new stdClass instanceof self;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..c534dcf62af8 100644
--- a/Zend/tests/self_method_or_prop_outside_class.phpt
+++ b/Zend/tests/self_method_or_prop_outside_class.phpt
@@ -7,30 +7,30 @@ $fn = function() {
$str = "foo";
try {
self::${$str . "bar"};
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset(self::${$str . "bar"});
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset(self::${$str . "bar"});
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::{$str . "bar"}();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..feaa34517772 100644
--- a/Zend/tests/self_mod.phpt
+++ b/Zend/tests/self_mod.phpt
@@ -13,8 +13,8 @@ var_dump($s);
try {
$s1 %= 11;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..5ad5d8dbaee8 100644
--- a/Zend/tests/self_or.phpt
+++ b/Zend/tests/self_or.phpt
@@ -15,8 +15,8 @@ var_dump($s);
try {
$s1 |= 11;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..8262d185f7e8 100644
--- a/Zend/tests/self_xor.phpt
+++ b/Zend/tests/self_xor.phpt
@@ -15,8 +15,8 @@ var_dump($s);
try {
$s1 ^= 11;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..fde6dd5cc01a 100644
--- a/Zend/tests/serialize/bug64354.phpt
+++ b/Zend/tests/serialize/bug64354.phpt
@@ -16,10 +16,10 @@ $data = array(new B);
try {
serialize($data);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..75b1269eb9f1 100644
--- a/Zend/tests/serialize/bug71841.phpt
+++ b/Zend/tests/serialize/bug71841.phpt
@@ -5,41 +5,41 @@ Bug #71841 (EG(error_zval) is not handled well)
$z = unserialize('O:1:"A":0:{}');
try {
var_dump($z->e.=0);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(++$z->x);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($z->y++);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$y = array(PHP_INT_MAX => 0);
try {
var_dump($y[] .= 0);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(++$y[]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($y[]++);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e66bb5306a30 100644
--- a/Zend/tests/shift_001.phpt
+++ b/Zend/tests/shift_001.phpt
@@ -13,8 +13,8 @@ var_dump($s);
try {
$s1 <<= 1;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..3434c9332e6d 100644
--- a/Zend/tests/shift_002.phpt
+++ b/Zend/tests/shift_002.phpt
@@ -13,8 +13,8 @@ var_dump($s);
try {
$s1 >>= 1;
var_dump($s1);
-} catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..2142364de4f4 100644
--- a/Zend/tests/stack_limit/stack_limit_001.phpt
+++ b/Zend/tests/stack_limit/stack_limit_001.phpt
@@ -35,20 +35,20 @@ function replace() {
try {
new Test1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..059eecb9c4f0 100644
--- a/Zend/tests/stack_limit/stack_limit_002.phpt
+++ b/Zend/tests/stack_limit/stack_limit_002.phpt
@@ -34,20 +34,20 @@ function replace() {
$fiber = new Fiber(function (): void {
try {
new Test1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..1d0d7c089649 100644
--- a/Zend/tests/stack_limit/stack_limit_003.phpt
+++ b/Zend/tests/stack_limit/stack_limit_003.phpt
@@ -33,20 +33,20 @@ function replace() {
try {
new Test1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..4e187a513a3c 100644
--- a/Zend/tests/stack_limit/stack_limit_006.phpt
+++ b/Zend/tests/stack_limit/stack_limit_006.phpt
@@ -292,20 +292,20 @@ function replace() {
try {
new Test1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
clone new Test2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
replace();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..58478cc5a1c8 100644
--- a/Zend/tests/stack_limit/stack_limit_007.phpt
+++ b/Zend/tests/stack_limit/stack_limit_007.phpt
@@ -18,8 +18,8 @@ function replace() {
try {
$tryExecuted = true;
return replace();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..e52f2f350ad2 100644
--- a/Zend/tests/stack_limit/stack_limit_008.phpt
+++ b/Zend/tests/stack_limit/stack_limit_008.phpt
@@ -21,8 +21,8 @@ function replace() {
echo "Will throw:\n";
try {
return replace2();
- } catch (Error $e) {
- echo $e->getMessage();
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}, '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..15aa89d78c6e 100644
--- a/Zend/tests/stack_limit/stack_limit_011.phpt
+++ b/Zend/tests/stack_limit/stack_limit_011.phpt
@@ -34,8 +34,8 @@ function replace() {
try {
replace();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d9e87f4de790 100644
--- a/Zend/tests/stack_limit/stack_limit_014.phpt
+++ b/Zend/tests/stack_limit/stack_limit_014.phpt
@@ -15,8 +15,8 @@ memory_limit=1G
try {
require __DIR__.'/stack_limit_014.inc';
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..6917a4de3e90 100644
--- a/Zend/tests/static_method_non_existing_class.phpt
+++ b/Zend/tests/static_method_non_existing_class.phpt
@@ -6,10 +6,10 @@ Calling a static method on a non-existing class
$str = "foo";
try {
Test::{$str . "bar"}();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8377db2f74ca 100644
--- a/Zend/tests/static_variables/static_variables_destructor.phpt
+++ b/Zend/tests/static_variables/static_variables_destructor.phpt
@@ -24,13 +24,13 @@ function foo(bool $throw) {
try {
foo(true);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..c5b5a1223c71 100644
--- a/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
+++ b/Zend/tests/static_variables/static_variables_throwing_initializer.phpt
@@ -10,12 +10,12 @@ function foo($throw) {
try {
var_dump(foo(true));
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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/string_offset_as_object.phpt b/Zend/tests/string_offset_as_object.phpt
index 6fdebe936088..f5d477ef1b3b 100644
--- a/Zend/tests/string_offset_as_object.phpt
+++ b/Zend/tests/string_offset_as_object.phpt
@@ -6,58 +6,58 @@ Using string offset as object
$str = "x";
try {
$str[0]->bar = "xyz";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar[1] = "bang";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar += 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar = &$b;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
++$str[0]->bar;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
--$str[0]->bar;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar++;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str[0]->bar--;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($str[0]->bar);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..60c5399f5a60 100644
--- a/Zend/tests/string_offset_errors.phpt
+++ b/Zend/tests/string_offset_errors.phpt
@@ -15,25 +15,25 @@ function &gen() {
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$str = "foo";
$str[0] =& $str[1];
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
foreach (gen() as $v) {}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e7622db355ba 100644
--- a/Zend/tests/strlen_deprecation_to_exception.phpt
+++ b/Zend/tests/strlen_deprecation_to_exception.phpt
@@ -8,10 +8,10 @@ set_error_handler(function($_, $msg) {
});
try {
strlen(null);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..fc150741ada3 100644
--- a/Zend/tests/strncasecmp_basic.phpt
+++ b/Zend/tests/strncasecmp_basic.phpt
@@ -5,8 +5,8 @@ strncasecmp() tests
try {
var_dump(strncasecmp("", "", -1));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..6f93ed23f939 100644
--- a/Zend/tests/strncmp_basic.phpt
+++ b/Zend/tests/strncmp_basic.phpt
@@ -6,8 +6,8 @@ strncmp() tests
var_dump(strncmp("", "", 100));
try {
var_dump(strncmp("aef", "dfsgbdf", -1));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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..bf134a7f2366 100644
--- a/Zend/tests/sub_001.phpt
+++ b/Zend/tests/sub_001.phpt
@@ -8,8 +8,8 @@ $b = array(1);
try {
var_dump($a - $b);
-} catch (Error $e) {
- echo "\nException: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..9964826c5eca 100644
--- a/Zend/tests/switch/bug80046.phpt
+++ b/Zend/tests/switch/bug80046.phpt
@@ -13,10 +13,10 @@ function test($foo) {
}
try {
test('Foo');
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..950c092c2684 100644
--- a/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
+++ b/Zend/tests/temporary_cleaning/temporary_cleaning_012.phpt
@@ -11,10 +11,10 @@ class Foo {
try {
Foo::test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..5db09b7d700a 100644
--- a/Zend/tests/this-reserved/this_in_extract.phpt
+++ b/Zend/tests/this-reserved/this_in_extract.phpt
@@ -5,15 +5,15 @@ $this re-assign in extract()
function foo() {
try {
extract(["this"=>42, "a"=>24]);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..906e812d29bd 100644
--- a/Zend/tests/throw/001.phpt
+++ b/Zend/tests/throw/001.phpt
@@ -6,93 +6,93 @@ throw expression
try {
$result = true && throw new Exception("true && throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false && throw new Exception("false && throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = true || throw new Exception("true || throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = false || throw new Exception("false || throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = null ?? throw new Exception("null ?? throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = "foo" ?? throw new Exception('"foo" ?? throw');
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = null ?: throw new Exception("null ?: throw");
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$result = "foo" ?: throw new Exception('"foo" ?: throw');
var_dump($result);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$callable = fn() => throw new Exception("fn() => throw");
var_dump("not yet");
$callable();
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$result = "bar";
@@ -106,28 +106,28 @@ try {
throw new Exception("exception 1"),
throw new Exception("exception 2")
);
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ 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());
+} catch (Throwable $e) {
+ 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 {
@@ -143,31 +143,31 @@ var_dump($exception->getMessage());
try {
throw null ?? new Exception('throw null ?? new Exception();');
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..b38bc7c717f8 100644
--- a/Zend/tests/throw/002.phpt
+++ b/Zend/tests/throw/002.phpt
@@ -23,62 +23,62 @@ class Foo {
try {
(new Foo())->throwException();
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Foo::staticThrowException();
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ 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";
+} catch(Throwable $e) {
+ 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";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$exception1 = new Exception('Coalesce non-null 1');
$exception2 = new Exception('Coalesce non-null 2');
throw $exception1 ?? $exception2;
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$exception1 = null;
$exception2 = new Exception('Coalesce null 2');
throw $exception1 ?? $exception2;
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
throw $exception = new Exception('Assignment');
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$exception = null;
throw $exception ??= new Exception('Coalesce assignment null');
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ 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";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$andConditionalTest = function ($condition1, $condition2) {
@@ -89,40 +89,40 @@ $andConditionalTest = function ($condition1, $condition2) {
try {
$andConditionalTest(false, false);
-} catch(Exception $e) {
- echo $e->getMessage() . "\n";
+} catch(Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(false, true);
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(true, false);
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$andConditionalTest(true, true);
-} catch (Exception $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..7f127701ee6e 100644
--- a/Zend/tests/throwing_overloaded_compound_assign_op.phpt
+++ b/Zend/tests/throwing_overloaded_compound_assign_op.phpt
@@ -15,22 +15,22 @@ $test = new ArrayObject;
$test[0] = 42;
try {
$test[0] %= 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
$test2 = new Test;
try {
$test2->prop %= 0;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a42231f6004d 100644
--- a/Zend/tests/traits/gh_17728.phpt
+++ b/Zend/tests/traits/gh_17728.phpt
@@ -15,10 +15,10 @@ trait Foo {
try {
Foo::bar();
-} catch (ErrorException $e) {
- echo $e->getMessage(), PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..7d6a2d598026 100644
--- a/Zend/tests/traits/trait_type_errors.phpt
+++ b/Zend/tests/traits/trait_type_errors.phpt
@@ -22,22 +22,22 @@ class P extends C {
$c = new C;
try {
$c->test1("foo");
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->test2("foo");
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$c->test3("foo");
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f8d5209f9e0e 100644
--- a/Zend/tests/trigger_error_basic.phpt
+++ b/Zend/tests/trigger_error_basic.phpt
@@ -7,13 +7,13 @@ var_dump(trigger_error("error"));
try {
var_dump(trigger_error("error", -1));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(trigger_error("error", 0));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
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 80a0f379765b..d29d0cd89b1f 100644
--- a/Zend/tests/try/bug70228_3.phpt
+++ b/Zend/tests/try/bug70228_3.phpt
@@ -19,14 +19,14 @@ function test() {
try {
var_dump(test());
-} catch (Exception $e) {
+} catch (Throwable $e) {
do {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
$e = $e->getPrevious();
} while ($e);
}
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
-2
-1
+Exception: 2
+Exception: 1
diff --git a/Zend/tests/try/bug70228_4.phpt b/Zend/tests/try/bug70228_4.phpt
index 7e0fd78707d7..245433209de2 100644
--- a/Zend/tests/try/bug70228_4.phpt
+++ b/Zend/tests/try/bug70228_4.phpt
@@ -21,13 +21,13 @@ function test() {
try {
var_dump(test());
-} catch (Exception $e) {
+} catch (Throwable $e) {
do {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
$e = $e->getPrevious();
} while ($e);
}
?>
--EXPECTF--
Deprecated: Returning from a finally block is deprecated in %s on line %d
-1
+Exception: 1
diff --git a/Zend/tests/try/bug70228_5.phpt b/Zend/tests/try/bug70228_5.phpt
index 29cbf4910de1..b5aa085d5278 100644
--- a/Zend/tests/try/bug70228_5.phpt
+++ b/Zend/tests/try/bug70228_5.phpt
@@ -12,9 +12,9 @@ function test() {
try {
test();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ba53b3bb037d 100644
--- a/Zend/tests/try/bug72213.phpt
+++ b/Zend/tests/try/bug72213.phpt
@@ -15,11 +15,11 @@ function test() {
try {
test();
-} catch (Exception $e) {
- var_dump($e->getMessage());
+} catch (Throwable $e) {
+ 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..df5b8aad484b 100644
--- a/Zend/tests/try/bug72213_2.phpt
+++ b/Zend/tests/try/bug72213_2.phpt
@@ -18,9 +18,9 @@ function test() {
try {
test();
-} catch (Exception $e) {
- echo "caught {$e->getMessage()}\n";
+} catch (Throwable $e) {
+ 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 463ce377f0a3..fca1371fb671 100644
--- a/Zend/tests/try/catch_finally_006.phpt
+++ b/Zend/tests/try/catch_finally_006.phpt
@@ -17,9 +17,9 @@ function foo ($a) {
try {
var_dump(foo("para"));
-} catch (Exception $e) {
+} catch (Throwable $e) {
"caught exception" . PHP_EOL;
- var_dump($e->getMessage());
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
diff --git a/Zend/tests/try/try_finally_002.phpt b/Zend/tests/try/try_finally_002.phpt
index 99a34f62fbd7..a857f1e48a29 100644
--- a/Zend/tests/try/try_finally_002.phpt
+++ b/Zend/tests/try/try_finally_002.phpt
@@ -12,12 +12,12 @@ function foo () {
try {
foo();
-} catch (Exception $e) {
+} catch (Throwable $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..d1fee2ce2c42 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
@@ -11,10 +11,10 @@ set_error_handler(function($_, $msg) {
try {
test(0.5);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..68e097894b56 100644
--- a/Zend/tests/type_coercion/gh22112.phpt
+++ b/Zend/tests/type_coercion/gh22112.phpt
@@ -19,17 +19,17 @@ $nan = fdiv(0, 0);
try {
take_bool($nan);
-} catch (Exception $e) {
- echo "bool: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo 'bool: ', $e::class, ': ', $e->getMessage(), "\n";
}
try {
take_string($nan);
-} catch (Exception $e) {
- echo "string: ", $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..355b2362b85c 100644
--- a/Zend/tests/type_coercion/settype/settype_resource.phpt
+++ b/Zend/tests/type_coercion/settype/settype_resource.phpt
@@ -32,8 +32,8 @@ $vars = array(
foreach ($vars as $var) {
try {
settype($var, "resource");
- } catch (ValueError $exception) {
- echo $exception->getMessage() . "\n";
+ } catch (Throwable $exception) {
+ 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..64e1fc6ad056 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
@@ -7,12 +7,12 @@ try {
assert(false && function () {
(void) somefunc();
});
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..72c2eb0f6d00 100644
--- a/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
+++ b/Zend/tests/type_declarations/dnf_types/dnf_2_intersection.phpt
@@ -40,13 +40,13 @@ var_dump($o);
try {
bar1();
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bar2();
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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..e5eaed0fd63e 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
@@ -39,23 +39,23 @@ $test->prop2 = $n;
$c = new C();
try {
$test->foo1($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->foo2($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop1 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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..40c53e044dbd 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
@@ -60,43 +60,43 @@ $test->prop4 = $b;
$c = new C();
try {
$test->foo1($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->foo2($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->bar1($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->bar2($c);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop1 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop3 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop4 = $c;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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..db400d2535c7 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(), "\n";
}
try {
$t->method1(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method1(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method1(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
// 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(), "\n";
}
try {
$t->method2(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method2(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method2(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
/* 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(), "\n";
}
try {
$t->method3(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method3(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method3(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
// 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(), "\n";
}
try {
$t->method4(new B_);
echo 'Fail', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method4(new AB_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
try {
$t->method4(new D_);
echo 'Pass', \PHP_EOL;
} catch (\Throwable $throwable) {
- echo $throwable->getMessage(), \PHP_EOL;
+ echo $throwable::class, ': ', $throwable->getMessage(), "\n";
}
?>
--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..da9ce52ce163 100644
--- a/Zend/tests/type_declarations/internal_function_strict_mode.phpt
+++ b/Zend/tests/type_declarations/internal_function_strict_mode.phpt
@@ -7,29 +7,29 @@ declare(strict_types=1);
echo "*** Trying Ord With Integer" . PHP_EOL;
try {
var_dump(ord(1));
-} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "*** Trying Array Map With Invalid Callback" . PHP_EOL;
try {
array_map([null, "bar"], []);
-} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "*** Trying Strlen With Float" . PHP_EOL;
try {
var_dump(strlen(1.5));
-} catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..7490bcd8434d 100644
--- a/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
+++ b/Zend/tests/type_declarations/intersection_types/assigning_intersection_types.phpt
@@ -28,8 +28,8 @@ $tc = new TestChild();
$o = new A();
try {
$o->prop = $tp;
-} catch (TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..c268720d4c2a 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
@@ -9,11 +9,11 @@ function foo(X&Y $foo = null) {
try {
foo(5);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..5123be36f130 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
@@ -24,8 +24,8 @@ function bar(X&Y $o): void {
try {
$o = foo();
var_dump($o);
-} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$c = new Collection();
@@ -33,18 +33,18 @@ $a = new A();
try {
$c->intersect = $a;
-} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bar($a);
-} catch (\TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (\Throwable $e) {
+ 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..2de2d5b91edc 100644
--- a/Zend/tests/type_declarations/intersection_types/parameter.phpt
+++ b/Zend/tests/type_declarations/intersection_types/parameter.phpt
@@ -17,12 +17,12 @@ foo(new Foo());
try {
foo(new Bar());
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..b16dfad4025b 100644
--- a/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
+++ b/Zend/tests/type_declarations/intersection_types/typed_reference.phpt
@@ -21,10 +21,10 @@ $test->z =& $r;
try {
$r = new B;
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..c264908fbb54 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(), "\n";
}
?>
--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..978f177fc4b4 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(), "\n";
}
?>
@@ -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..86eb1aee258a 100644
--- a/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/false_no_coercion.phpt
@@ -7,22 +7,22 @@ function test(false $v) { var_dump($v); }
try {
test(0);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test('');
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test([]);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..34480f91f1e2 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
@@ -21,11 +21,11 @@ $c = new C();
var_dump($p->foo(0));
try {
var_dump($c->foo(0));
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..72e9ae889802 100644
--- a/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
+++ b/Zend/tests/type_declarations/literal_types/true_no_coercion.phpt
@@ -7,28 +7,28 @@ function test(true $v) { var_dump($v); }
try {
test(1);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test('1');
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test([1]);
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test(new stdClass());
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..a0ed9bf12d82 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
@@ -21,11 +21,11 @@ $c = new C();
var_dump($p->foo(1));
try {
var_dump($c->foo(1));
-} catch (\TypeError $e) {
- echo $e->getMessage(), \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..edd4d59f580e 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
@@ -27,10 +27,10 @@ $foo = new Foo();
try {
$foo->property1;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..720e9cdc13af 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
@@ -26,10 +26,10 @@ $foo = new Foo();
try {
$foo->property1;
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..7712f5e3a0e4 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
@@ -10,10 +10,10 @@ function foo(): mixed
try {
foo();
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..2e5efe16baae 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
@@ -9,10 +9,10 @@ function foo(): mixed
try {
foo();
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..e6559a941742 100644
--- a/Zend/tests/type_declarations/scalar_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_basic.phpt
@@ -52,8 +52,8 @@ foreach ($functions as $type => $function) {
var_dump($value);
try {
var_dump($function($value));
- } catch (\TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -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..10dbab93e7aa 100644
--- a/Zend/tests/type_declarations/scalar_constant_defaults.phpt
+++ b/Zend/tests/type_declarations/scalar_constant_defaults.phpt
@@ -64,15 +64,15 @@ var_dump(string_add_val());
echo "Testing int with default null constant" . PHP_EOL;
try {
var_dump(int_val_default_null());
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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";
+} catch (Throwable $e) {
+ 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..764f6a8a5745 100644
--- a/Zend/tests/type_declarations/scalar_none.phpt
+++ b/Zend/tests/type_declarations/scalar_none.phpt
@@ -19,20 +19,20 @@ foreach ($functions as $type => $function) {
try {
var_dump($function());
} catch (Throwable $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
echo PHP_EOL . "Done";
?>
--EXPECTF--
Testing int:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing float:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing string:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing bool:
-*** Caught Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function {closure:%s:%d}(), 0 passed in %s on line %d and exactly 1 expected
Testing int nullable:
NULL
Testing float nullable:
diff --git a/Zend/tests/type_declarations/scalar_null.phpt b/Zend/tests/type_declarations/scalar_null.phpt
index f69aec3b5b6e..fb7c52ba2fa0 100644
--- a/Zend/tests/type_declarations/scalar_null.phpt
+++ b/Zend/tests/type_declarations/scalar_null.phpt
@@ -18,8 +18,8 @@ foreach ($functions as $type => $function) {
echo "Testing $type:", PHP_EOL;
try {
var_dump($function(null));
- } catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -27,13 +27,13 @@ echo PHP_EOL . "Done";
?>
--EXPECTF--
Testing int:
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
Testing float:
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
Testing string:
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
Testing bool:
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
Testing int nullable:
NULL
Testing float nullable:
diff --git a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
index 498092e8ac54..e3cf8927662a 100644
--- a/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_return_basic_64bit.phpt
@@ -54,8 +54,8 @@ foreach ($functions as $type => $function) {
var_dump($value);
try {
var_dump($function($value));
- } catch (TypeError $e) {
- echo "*** Caught ", $e->getMessage(), " in ", $e->getFile(), " on line ", $e->getLine(), PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), ' in ', $e->getFile(), ' on line ', $e->getLine(), "\n";
}
}
}
@@ -74,32 +74,32 @@ int(1)
E_DEPRECATED: Implicit conversion from float 1.5 to int loses precision on line %d
int(1)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, string returned in %s on line %d
*** Trying int(9223372036854775807)
int(9223372036854775807)
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Return value must be of type int, float returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, float returned in %s on line %d
*** Trying bool(true)
int(1)
*** Trying bool(false)
int(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type int, resource returned in %s on line %d
Testing 'float' type:
*** Trying int(1)
@@ -111,11 +111,11 @@ float(1)
*** Trying float(1.5)
float(1.5)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, string returned in %s on line %d
*** Trying int(9223372036854775807)
float(9.223372036854776E+18)
*** Trying float(NAN)
@@ -125,18 +125,18 @@ float(1)
*** Trying bool(false)
float(0)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type float, resource returned in %s on line %d
Testing 'string' type:
*** Trying int(1)
@@ -163,18 +163,18 @@ string(1) "1"
*** Trying bool(false)
string(0) ""
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
string(6) "foobar"
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type string, resource returned in %s on line %d
Testing 'bool' type:
*** Trying int(1)
@@ -201,17 +201,17 @@ bool(true)
*** Trying bool(false)
bool(false)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, null returned in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, array returned in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, stdClass returned in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, StringCapable returned in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Return value must be of type bool, resource returned in %s on line %d
+TypeError: {closure:%s:%d}(): Return value must be of type bool, resource returned in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_64bit.phpt b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
index b7f2ce0de439..fe3012b83c0b 100644
--- a/Zend/tests/type_declarations/scalar_strict_64bit.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_64bit.phpt
@@ -45,8 +45,8 @@ foreach ($functions as $type => $function) {
var_dump($value);
try {
var_dump($function($value));
- } catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -60,52 +60,52 @@ Testing 'int' type:
int(1)
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying int(9223372036854775807)
int(9223372036854775807)
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
Testing 'float' type:
@@ -113,7 +113,7 @@ Testing 'float' type:
float(1)
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying float(1)
float(1)
@@ -122,13 +122,13 @@ float(1)
float(1.5)
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying int(9223372036854775807)
float(9.223372036854776E+18)
@@ -137,42 +137,42 @@ float(9.223372036854776E+18)
float(NAN)
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
Testing 'string' type:
*** Trying int(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying string(1) "1"
string(1) "1"
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying string(2) "1a"
string(2) "1a"
@@ -184,63 +184,63 @@ string(1) "a"
string(0) ""
*** Trying int(9223372036854775807)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying bool(true)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
*** Trying bool(false)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
Testing 'bool' type:
*** Trying int(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying string(1) "1"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying float(1)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying float(1.5)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying string(2) "1a"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying string(1) "a"
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying string(0) ""
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying int(9223372036854775807)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying float(NAN)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying bool(true)
bool(true)
@@ -249,21 +249,21 @@ bool(true)
bool(false)
*** Trying NULL
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
*** Trying array(0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
*** Trying object(stdClass)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
*** Trying object(StringCapable)#%d (0) {
}
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, StringCapable given, called in %s on line %d
*** Trying resource(%d) of type (stream)
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/scalar_strict_basic.phpt b/Zend/tests/type_declarations/scalar_strict_basic.phpt
index 462bed7983d6..2cc3430e9126 100644
--- a/Zend/tests/type_declarations/scalar_strict_basic.phpt
+++ b/Zend/tests/type_declarations/scalar_strict_basic.phpt
@@ -43,8 +43,8 @@ foreach ($functions as $type => $function) {
echo PHP_EOL . "*** Trying ", type($value), " value", PHP_EOL;
try {
var_dump($function($value));
- } catch (TypeError $e) {
- echo "*** Caught " . $e->getMessage() . PHP_EOL;
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -57,28 +57,28 @@ Testing 'int' type:
int(1)
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, float given, called in %s on line %d
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, string given, called in %s on line %d
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($i) must be of type int, resource given, called in %s on line %d
Testing 'float' type:
@@ -89,65 +89,65 @@ float(1)
float(1)
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, string given, called in %s on line %d
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($f) must be of type float, resource given, called in %s on line %d
Testing 'string' type:
*** Trying integer value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, int given, called in %s on line %d
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, float given, called in %s on line %d
*** Trying string value
string(1) "1"
*** Trying true value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, true given, called in %s on line %d
*** Trying false value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, false given, called in %s on line %d
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($s) must be of type string, resource given, called in %s on line %d
Testing 'bool' type:
*** Trying integer value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, int given, called in %s on line %d
*** Trying float value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, float given, called in %s on line %d
*** Trying string value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, string given, called in %s on line %d
*** Trying true value
bool(true)
@@ -156,15 +156,15 @@ bool(true)
bool(false)
*** Trying null value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, null given, called in %s on line %d
*** Trying array value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, array given, called in %s on line %d
*** Trying object value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, stdClass given, called in %s on line %d
*** Trying resource value
-*** Caught {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
+TypeError: {closure:%s:%d}(): Argument #1 ($b) must be of type bool, resource given, called in %s on line %d
Done
diff --git a/Zend/tests/type_declarations/static_type_return.phpt b/Zend/tests/type_declarations/static_type_return.phpt
index 0d37a8004650..069916cf0154 100644
--- a/Zend/tests/type_declarations/static_type_return.phpt
+++ b/Zend/tests/type_declarations/static_type_return.phpt
@@ -36,8 +36,8 @@ echo "\n";
var_dump($a->test2());
try {
var_dump($b->test2());
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -48,8 +48,8 @@ echo "\n";
var_dump($a->test4());
try {
var_dump($b->test4());
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -59,8 +59,8 @@ $test = function($x): static {
try {
var_dump($test(new stdClass));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b62b7263c8a2 100644
--- a/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_ast_print.phpt
@@ -7,12 +7,12 @@ try {
assert(false && new class {
public const int X = 1;
});
-} catch (AssertionError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..432061f008ad 100644
--- a/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_diamond_error1.phpt
@@ -8,9 +8,9 @@ class A {
try {
define("C", new A());
-} catch (Error $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..87c08de2cb63 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error11.phpt
@@ -12,10 +12,10 @@ enum E2 {
try {
var_dump(E1::C);
-} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..b23d78a55e69 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error2.phpt
@@ -10,17 +10,17 @@ define("C", "c");
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..bc98e08d6e97 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error3.phpt
@@ -10,16 +10,16 @@ define('C', new stdClass);
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..06bbd27e5d3f 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error7.phpt
@@ -10,16 +10,16 @@ define("C", new stdClass);
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..ecc82482c883 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error8.phpt
@@ -11,30 +11,30 @@ define("C", new stdClass);
try {
var_dump(A::CONST2);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST2);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(A::CONST1);
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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..7094d7bf2425 100644
--- a/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt
+++ b/Zend/tests/type_declarations/typed_class_constants_type_error9.phpt
@@ -17,9 +17,9 @@ define("S", new S());
try {
var_dump(A::S);
-} catch (TypeError $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..244fe0dd1e73 100644
--- a/Zend/tests/type_declarations/typed_properties_019.phpt
+++ b/Zend/tests/type_declarations/typed_properties_019.phpt
@@ -14,9 +14,9 @@ $foo = new Foo();
try {
$foo->inc();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..92b4e86ad637 100644
--- a/Zend/tests/type_declarations/typed_properties_020.phpt
+++ b/Zend/tests/type_declarations/typed_properties_020.phpt
@@ -11,8 +11,8 @@ class Foo {
$this->bar += 2;
try {
$this->bar += 1.5;
- } catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..1c21bf6a90c6 100644
--- a/Zend/tests/type_declarations/typed_properties_021.phpt
+++ b/Zend/tests/type_declarations/typed_properties_021.phpt
@@ -8,9 +8,9 @@ class Foo {
try {
$foo = new Foo();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..76d57e4ec48f 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 (Throwable $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..dcda621774a7 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 (Throwable $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 (Throwable $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..e9843aea3594 100644
--- a/Zend/tests/type_declarations/typed_properties_038.phpt
+++ b/Zend/tests/type_declarations/typed_properties_038.phpt
@@ -9,53 +9,53 @@ $foo = new class {
try {
$foo->bar++;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
try {
$foo->bar += 1;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
try {
++$foo->bar;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump($foo);
try {
$foo->bar = $foo->bar + 1;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ 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..c689c09e88fc 100644
--- a/Zend/tests/type_declarations/typed_properties_043.phpt
+++ b/Zend/tests/type_declarations/typed_properties_043.phpt
@@ -11,18 +11,18 @@ trait Test {
try {
Test::$selfProp = new stdClass;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::$selfNullProp = new stdClass;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Test::$parentProp = new stdClass;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..07ae8012a257 100644
--- a/Zend/tests/type_declarations/typed_properties_045.phpt
+++ b/Zend/tests/type_declarations/typed_properties_045.phpt
@@ -15,8 +15,8 @@ class Foo {
var_dump($val);
try {
$val = [];
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
}
@@ -33,8 +33,8 @@ foreach ($foo as $k => &$val) {
try {
$val = [];
var_dump($foo->$k);
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..ba12c77a1845 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 (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$a->_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$a->_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$a->_ = 0;
try {
$a->_ = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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..6a299a11afdf 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 (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$_;
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$_ = 0;
try {
$_ = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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..4880707f8f68 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 (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$_[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$_[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
$_[0] = 0;
try {
$_[0] = [];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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..a4d0aa4c0c0c 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
--$a[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
echo gettype($a->foo),"\n";
try {
++$a[0];
-} catch (Error $e) { echo $e->getMessage(), "\n"; }
+} catch (Throwable $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..f6c810b7c0fd 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($i, Foo::$i);
try {
Foo::$i = null;
-} catch (TypeError $e) { print $e->getMessage()."\n"; }
+} catch (Throwable $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 (Throwable $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 (Throwable $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 (Throwable $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..63c1d91e9ff1 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try {
var_dump(Foo::$i);
-} catch (Error $e) { print $e->getMessage()."\n"; }
+} catch (Throwable $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..bc3d33dd1bf8 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 (Throwable $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 (Throwable $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..ce99618fb1c1 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 (Throwable $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..7e44798ef3ee 100644
--- a/Zend/tests/type_declarations/typed_properties_075.phpt
+++ b/Zend/tests/type_declarations/typed_properties_075.phpt
@@ -11,43 +11,43 @@ class Foo {
try {
Foo::$bar++;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
try {
Foo::$bar += 1;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
try {
++Foo::$bar;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ echo $t::class, ': ', $t->getMessage(), "\n";
}
var_dump(Foo::$bar);
try {
Foo::$bar = Foo::$bar + 1;
-} catch(TypeError $t) {
- var_dump($t->getMessage());
+} catch(Throwable $t) {
+ 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..9aab4a5b37f4 100644
--- a/Zend/tests/type_declarations/typed_properties_076.phpt
+++ b/Zend/tests/type_declarations/typed_properties_076.phpt
@@ -36,14 +36,14 @@ function valid(Test $test, string $prop1, string $prop2, $value) {
try {
$test->$prop2 = $value;
$test->$prop1 =& $test->$prop2;
- } catch (TypeError $e) {
- echo "Valid assignment $prop1 =& $prop2 threw {$e->getMessage()}\n";
+ } catch (Throwable $e) {
+ 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";
+ } catch (Throwable $e) {
+ 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..346516b4b227 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 (Throwable $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 (Throwable $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 (Throwable $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..17b569a27382 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 (Throwable $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 (Throwable $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..ec8a69654d26 100644
--- a/Zend/tests/type_declarations/typed_properties_080.phpt
+++ b/Zend/tests/type_declarations/typed_properties_080.phpt
@@ -11,18 +11,18 @@ class Test {
static function run() {
try {
self::$a;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::$b;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
self::$c;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..c5120e8822e3 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 (Throwable $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..24cbfe7510d8 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 (Throwable $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..57b3cdea8ba7 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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { // must be uninit
var_dump($a->p); // WRONG!
-} catch (Error $e) { var_dump($e->getMessage()); }
+} catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
$a->p = null;
try {
$a->p[] = "test";
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
try { // must be uninit
var_dump(Foo::$s);
-} catch (Error $e) { var_dump($e->getMessage()); }
+} catch (Throwable $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 (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
var_dump($ref);
try {
$ref["baz"][] = "bar"; // indirect assign
-} catch (TypeError $e) { var_dump($e->getMessage()); }
+} catch (Throwable $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..9881c4c17262 100644
--- a/Zend/tests/type_declarations/typed_properties_093.phpt
+++ b/Zend/tests/type_declarations/typed_properties_093.phpt
@@ -17,14 +17,14 @@ $test = new Test;
$ref = "foobar";
try {
$test->$name =& $ref;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8c2858f30235 100644
--- a/Zend/tests/type_declarations/typed_properties_095.phpt
+++ b/Zend/tests/type_declarations/typed_properties_095.phpt
@@ -12,15 +12,15 @@ $obj = new _ZendTestClass;
var_dump($obj->intProp);
try {
$obj->intProp = "foobar";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->intProp = 456;
try {
$obj->classProp = $obj;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->classProp = new stdClass;
var_dump($obj);
@@ -34,15 +34,15 @@ $obj = new Test;
var_dump($obj->intProp);
try {
$obj->intProp = "foobar";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->intProp = 456;
try {
$obj->classProp = $obj;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj->classProp = new stdClass;
var_dump($obj);
@@ -52,8 +52,8 @@ var_dump($obj);
var_dump(_ZendTestClass::$staticIntProp);
try {
_ZendTestClass::$staticIntProp = "foobar";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..bc7cd2dfa151 100644
--- a/Zend/tests/type_declarations/typed_properties_096.phpt
+++ b/Zend/tests/type_declarations/typed_properties_096.phpt
@@ -13,8 +13,8 @@ $test->prop2 = 123;
$ref =& $test->prop2;
try {
$test->prop =& $ref;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..139897527968 100644
--- a/Zend/tests/type_declarations/typed_properties_097.phpt
+++ b/Zend/tests/type_declarations/typed_properties_097.phpt
@@ -14,28 +14,28 @@ $test = new Test;
$test->foo = PHP_INT_MIN;
try {
--$test->foo;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo--;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
$test->foo = PHP_INT_MAX;
try {
++$test->foo;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo++;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
@@ -45,46 +45,46 @@ $ref =& $test->foo;
$test->foo = PHP_INT_MIN;
try {
--$test->foo;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo--;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
$test->foo = PHP_INT_MAX;
try {
++$test->foo;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test->foo);
try {
$test->foo++;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..82271d275897 100644
--- a/Zend/tests/type_declarations/typed_properties_102.phpt
+++ b/Zend/tests/type_declarations/typed_properties_102.phpt
@@ -11,12 +11,12 @@ class Test {
Test::$prop =& Test::$intProp;
try {
Test::$prop .= "foobar";
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..fa114c5db00f 100644
--- a/Zend/tests/type_declarations/typed_properties_106.phpt
+++ b/Zend/tests/type_declarations/typed_properties_106.phpt
@@ -9,18 +9,18 @@ $obj = new Test;
$ref =& $obj->prop;
try {
$ref = [1];
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$ary = [1];
$ref = $ary;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0a7608d244aa 100644
--- a/Zend/tests/type_declarations/typed_properties_110.phpt
+++ b/Zend/tests/type_declarations/typed_properties_110.phpt
@@ -11,10 +11,10 @@ $foo->value = null;
try {
$foo->value = 1;
-} catch (\TypeError $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign int to property Foo::$value of type null
+TypeError: Cannot assign int to property Foo::$value of type null
diff --git a/Zend/tests/type_declarations/typed_properties_111.phpt b/Zend/tests/type_declarations/typed_properties_111.phpt
index 20236e8a19bb..a5a1b664d0b3 100644
--- a/Zend/tests/type_declarations/typed_properties_111.phpt
+++ b/Zend/tests/type_declarations/typed_properties_111.phpt
@@ -11,10 +11,10 @@ $foo->value = false;
try {
$foo->value = true;
-} catch (\TypeError $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign true to property Foo::$value of type false
+TypeError: Cannot assign true to property Foo::$value of type false
diff --git a/Zend/tests/type_declarations/typed_properties_112.phpt b/Zend/tests/type_declarations/typed_properties_112.phpt
index 8b1157759fec..4d125295649f 100644
--- a/Zend/tests/type_declarations/typed_properties_112.phpt
+++ b/Zend/tests/type_declarations/typed_properties_112.phpt
@@ -10,10 +10,10 @@ $foo = new Foo();
try {
$foo->value = false;
-} catch (\TypeError $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign false to property Foo::$value of type true
+TypeError: Cannot assign false to property Foo::$value of type true
diff --git a/Zend/tests/type_declarations/typed_properties_114.phpt b/Zend/tests/type_declarations/typed_properties_114.phpt
index 5f3093dd3308..1d4b30184625 100644
--- a/Zend/tests/type_declarations/typed_properties_114.phpt
+++ b/Zend/tests/type_declarations/typed_properties_114.phpt
@@ -17,14 +17,14 @@ foreach ($obj as $k => &$v) {
try {
$v = [];
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
foreach ($obj as $k => &$v) {
try {
$v = [];
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -32,10 +32,10 @@ var_dump($obj);
?>
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot assign array to reference held by property A::$foo of type string
+TypeError: Cannot assign array to reference held by property A::$foo of type string
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot assign array to reference held by property A::$foo of type string
+TypeError: Cannot assign array to reference held by property A::$foo of type string
object(A)#1 (1) {
["foo"]=>
&string(3) "bar"
diff --git a/Zend/tests/type_declarations/typed_properties_115.phpt b/Zend/tests/type_declarations/typed_properties_115.phpt
index 6347ee0c35d6..d929fb60dc86 100644
--- a/Zend/tests/type_declarations/typed_properties_115.phpt
+++ b/Zend/tests/type_declarations/typed_properties_115.phpt
@@ -17,14 +17,14 @@ $obj = new A;
try {
foreach ($obj as $k => &$v) {}
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($obj);
?>
--EXPECTF--
Deprecated: ArrayIterator::__construct(): Using an object as a backing array for ArrayIterator is deprecated, as it allows violating class constraints and invariants in %s on line %d
-Cannot acquire reference to readonly property A::$foo
+Error: Cannot acquire reference to readonly property A::$foo
object(A)#1 (1) {
["foo"]=>
string(3) "bar"
diff --git a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
index 72cff1058f22..3f8cf1748eff 100644
--- a/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
+++ b/Zend/tests/type_declarations/typed_properties_cache_slot_opt.phpt
@@ -11,8 +11,8 @@ class Test {
$this->prop = 1;
try {
$this->prop = "foobar";
- } catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..28f4518107f9 100644
--- a/Zend/tests/type_declarations/typed_properties_class_loading.phpt
+++ b/Zend/tests/type_declarations/typed_properties_class_loading.phpt
@@ -15,8 +15,8 @@ spl_autoload_register(function($class) {
$test = new Test;
try {
$test->propX = new stdClass;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
if (true) {
@@ -30,8 +30,8 @@ $test->propY = null;
$r =& $test->propY;
try {
$test->propY = new stdClass;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..7c958137e40a 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
@@ -15,22 +15,22 @@ class Test {
$test = new Test;
try {
$test->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop = "foo";
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..1e2cf13f2bb5 100644
--- a/Zend/tests/type_declarations/typed_properties_magic_set.phpt
+++ b/Zend/tests/type_declarations/typed_properties_magic_set.phpt
@@ -24,8 +24,8 @@ class Test {
$test = new Test;
try {
var_dump($test->foo);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(isset($test->foo));
$test->foo = 42;
@@ -61,7 +61,7 @@ $test->foo = 42;
?>
--EXPECT--
-Typed property Test::$foo must not be accessed before initialization
+Error: Typed property Test::$foo must not be accessed before initialization
bool(false)
int(42)
__set foo = 42
diff --git a/Zend/tests/type_declarations/union_types/anonymous_class.phpt b/Zend/tests/type_declarations/union_types/anonymous_class.phpt
index 1e009f22b00f..1ffec32de05e 100644
--- a/Zend/tests/type_declarations/union_types/anonymous_class.phpt
+++ b/Zend/tests/type_declarations/union_types/anonymous_class.phpt
@@ -16,15 +16,15 @@ $a = new class {
try {
$a->testParam(null);
} catch (\Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$a->test();
} catch (\Throwable $e) {
- echo $e->getMessage()."\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d
-class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned
+TypeError: class@anonymous(): Argument #1 ($a) must be of type class@anonymous|string, null given, called in %s on line %d
+TypeError: class@anonymous::test(): Return value must be of type class@anonymous|string, stdClass returned
diff --git a/Zend/tests/type_declarations/union_types/incdec_prop.phpt b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
index 7b61fc9fe60c..62beef9befef 100644
--- a/Zend/tests/type_declarations/union_types/incdec_prop.phpt
+++ b/Zend/tests/type_declarations/union_types/incdec_prop.phpt
@@ -55,61 +55,61 @@ var_dump(is_float($test->prop));
try {
$test->prop2 = PHP_INT_MAX;
$x = $test->prop2++;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MAX;
$x = ++$test->prop2;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$x = $test->prop2--;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$x = --$test->prop2;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MAX;
$r =& $test->prop2;
$x = $test->prop2++;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MAX;
$r =& $test->prop2;
$x = ++$test->prop2;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$r =& $test->prop2;
$x = $test->prop2--;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->prop2 = PHP_INT_MIN;
$r =& $test->prop2;
$x = --$test->prop2;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..81aa4079bc8c 100644
--- a/Zend/tests/type_declarations/union_types/inheritance_internal.phpt
+++ b/Zend/tests/type_declarations/union_types/inheritance_internal.phpt
@@ -12,8 +12,8 @@ $obj->classUnionProp = new stdClass;
$obj->classUnionProp = new ArrayIterator;
try {
$obj->classUnionProp = new DateTime;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$obj = new C;
@@ -21,11 +21,11 @@ $obj->classUnionProp = new stdClass;
$obj->classUnionProp = new ArrayIterator;
try {
$obj->classUnionProp = new DateTime;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d507550db434 100644
--- a/Zend/tests/type_declarations/union_types/multiple_classes.phpt
+++ b/Zend/tests/type_declarations/union_types/multiple_classes.phpt
@@ -27,14 +27,14 @@ var_dump($test->method("42"));
try {
$test->prop = new stdClass;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$test->method(new stdClass);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..ac2b2da19f01 100644
--- a/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt
+++ b/Zend/tests/type_declarations/union_types/prop_ref_assign.phpt
@@ -16,16 +16,16 @@ $test->y =& $r;
$v = 42;
try {
$r = $v;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($r, $v);
$v = 42.0;
try {
$r = $v;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($r, $v);
@@ -34,8 +34,8 @@ unset($r, $test->x, $test->y);
$test->x = 42;
try {
$test->y =& $test->x;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
unset($test->x, $test->y);
@@ -43,17 +43,17 @@ unset($test->x, $test->y);
$test->y = 42.0;
try {
$test->x =& $test->y;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e043136b161d 100644
--- a/Zend/tests/type_declarations/variance/loading_exception1.phpt
+++ b/Zend/tests/type_declarations/variance/loading_exception1.phpt
@@ -12,8 +12,8 @@ for ($i = 0; $i < 2; $i++) {
try {
class B extends A {
}
- } catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -33,14 +33,14 @@ spl_autoload_register(function($class) {
try {
class B extends A implements I {
}
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..f2b5500f2b39 100644
--- a/Zend/tests/type_declarations/variance/loading_exception2.phpt
+++ b/Zend/tests/type_declarations/variance/loading_exception2.phpt
@@ -14,8 +14,8 @@ for ($i = 0; $i < 2; $i++) {
try {
class B extends A implements I {
}
- } catch (Exception $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -35,14 +35,14 @@ spl_autoload_register(function($class) {
try {
class B extends A implements I, J {
}
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..294e861d1662 100644
--- a/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
+++ b/Zend/tests/type_declarations/variance/unlinked_parent_1.phpt
@@ -10,10 +10,10 @@ spl_autoload_register(function($class) {
try {
class B extends A {
}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..659b5ebed7f4 100644
--- a/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
+++ b/Zend/tests/type_declarations/variance/unlinked_parent_2.phpt
@@ -10,10 +10,10 @@ spl_autoload_register(function($class) {
try {
interface B extends A {
}
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..8416685fedbf 100644
--- a/Zend/tests/undef_index_to_exception.phpt
+++ b/Zend/tests/undef_index_to_exception.phpt
@@ -10,37 +10,37 @@ set_error_handler(function($_, $msg) {
$test = [];
try {
$test[0] .= "xyz";
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
try {
$test["key"] .= "xyz";
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($test);
unset($test);
try {
$GLOBALS["test"] .= "xyz";
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($test);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..b74e03e056e6 100644
--- a/Zend/tests/undefined_multidimensional_array.phpt
+++ b/Zend/tests/undefined_multidimensional_array.phpt
@@ -11,16 +11,16 @@ $arr[1][2][3][4][5]->foo;
try {
$arr[1][2][3][4][5]->foo = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$arr[][] = 2;
try {
$arr[][]->bar = 2;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..742d3ab1a9ad 100644
--- a/Zend/tests/unpack_iterator_by_ref_type_check.phpt
+++ b/Zend/tests/unpack_iterator_by_ref_type_check.phpt
@@ -9,10 +9,10 @@ function gen() {
}
try {
test(...gen());
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..e3d1ed2fa263 100644
--- a/Zend/tests/unset/unset_non_array.phpt
+++ b/Zend/tests/unset/unset_non_array.phpt
@@ -14,36 +14,36 @@ unset($x[0]);
$x = true;
try {
unset($x[0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 1;
try {
unset($x[0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 3.14;
try {
unset($x[0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = "str";
try {
unset($x[0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = new stdClass;
try {
unset($x[0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
// And now repeat the same with a nested offset.
@@ -60,36 +60,36 @@ unset($x[0][0]);
$x = true;
try {
unset($x[0][0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 1;
try {
unset($x[0][0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = 3.14;
try {
unset($x[0][0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = "str";
try {
unset($x[0][0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = new stdClass;
try {
unset($x[0][0]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..0bc77f114925 100644
--- a/Zend/tests/varSyntax/constant_object_deref.phpt
+++ b/Zend/tests/varSyntax/constant_object_deref.phpt
@@ -8,17 +8,17 @@ class Bar { const FOO = "foo"; }
try {
FOO->length();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
Bar::FOO->length();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..cb21e879471e 100644
--- a/Zend/tests/varSyntax/encapsed_string_deref.phpt
+++ b/Zend/tests/varSyntax/encapsed_string_deref.phpt
@@ -8,8 +8,8 @@ var_dump("foo$bar"[0]);
var_dump("foo$bar"->prop);
try {
var_dump("foo$bar"->method());
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..d227e2e013a9 100644
--- a/Zend/tests/varSyntax/magic_const_deref.phpt
+++ b/Zend/tests/varSyntax/magic_const_deref.phpt
@@ -8,8 +8,8 @@ function test() {
var_dump(__FUNCTION__->prop);
try {
__FUNCTION__->method();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..fd9d304f1b27 100644
--- a/Zend/tests/variadic/typehint_suppressed_error.phpt
+++ b/Zend/tests/variadic/typehint_suppressed_error.phpt
@@ -9,10 +9,10 @@ function test(array... $args) {
try {
test([0], [1], 2);
-} catch(Error $e) {
- var_dump($e->getMessage());
+} catch(Throwable $e) {
+ 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..830d1741fce8 100644
--- a/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt
+++ b/Zend/tests/weakrefs/weakmap_basic_map_behavior.phpt
@@ -42,8 +42,8 @@ var_dump(isset($map[$obj]));
var_dump(!empty($map[$obj]));
try {
var_dump($map[$obj]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..a903048fb148 100644
--- a/Zend/tests/weakrefs/weakmap_error_conditions.phpt
+++ b/Zend/tests/weakrefs/weakmap_error_conditions.phpt
@@ -6,39 +6,39 @@ WeakMap error conditions
$map = new WeakMap;
try {
$map[1] = 2;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($map[1]);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
isset($map[1]);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($map[1]);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map[] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map[][1] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($map[new stdClass]);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($map->prop);
@@ -47,46 +47,46 @@ unset($map->prop);
try {
$map->prop = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$map->prop[] = 1;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$r =& $map->prop;
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
serialize($map);
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unserialize('C:7:"WeakMap":0:{}');
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ 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..622c55de1546 100644
--- a/Zend/tests/weakrefs/weakrefs_002.phpt
+++ b/Zend/tests/weakrefs/weakrefs_002.phpt
@@ -6,18 +6,18 @@ $wr = WeakReference::create(new stdClass);
try {
serialize($wr);
-} catch (Exception $ex) {
- var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
$wrs = 'O:13:"WeakReference":0:{}';
try {
var_dump(unserialize($wrs));
-} catch (Exception $ex) {
- var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+ 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..441b856ef3a0 100644
--- a/Zend/tests/weakrefs/weakrefs_003.phpt
+++ b/Zend/tests/weakrefs/weakrefs_003.phpt
@@ -10,19 +10,19 @@ unset($wr->disallow);
try {
$wr->disallow = "writes";
-} catch (Error $ex) {
- var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
$disallow = &$wr->disallowed;
-} catch (Error $ex) {
- var_dump($ex->getMessage());
+} catch (Throwable $ex) {
+ 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..82c592426e0c 100644
--- a/Zend/tests/xor_001.phpt
+++ b/Zend/tests/xor_001.phpt
@@ -8,12 +8,12 @@ $b = array();
try {
$c = $a ^ $b;
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "Done\n";
?>
--EXPECT--
-Unsupported operand types: array ^ array
+TypeError: Unsupported operand types: array ^ array
Done
diff --git a/Zend/tests/zpp/iterable_or_null.phpt b/Zend/tests/zpp/iterable_or_null.phpt
index a44e858bce92..ab5fc170aec7 100644
--- a/Zend/tests/zpp/iterable_or_null.phpt
+++ b/Zend/tests/zpp/iterable_or_null.phpt
@@ -7,20 +7,20 @@ zend_test
try {
var_dump(zend_iterable("string"));
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(zend_iterable(1));
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
try {
var_dump(zend_iterable(null));
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ echo $exception::class, ': ', $exception->getMessage(), "\n";
}
@@ -34,14 +34,13 @@ zend_iterable($iterator, null);
try {
var_dump(zend_iterable([], "string"));
-} catch (TypeError $exception) {
- echo $exception->getMessage() . "\n";
+} catch (Throwable $exception) {
+ 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/ext/bcmath/tests/bcadd_error.phpt b/ext/bcmath/tests/bcadd_error.phpt
index 320bf390680a..77cb46c18c1f 100644
--- a/ext/bcmath/tests/bcadd_error.phpt
+++ b/ext/bcmath/tests/bcadd_error.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcadd('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcadd('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..5cc2c2f4ca03 100644
--- a/ext/bcmath/tests/bccomp_error.phpt
+++ b/ext/bcmath/tests/bccomp_error.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bccomp('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bccomp('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..154f20e52d82 100644
--- a/ext/bcmath/tests/bcdiv_error1.phpt
+++ b/ext/bcmath/tests/bcdiv_error1.phpt
@@ -10,23 +10,23 @@ bcmath
getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcdiv('10.99', '0.00');
-} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcdiv('10.99', '-0.00');
-} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--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..622760327c5d 100644
--- a/ext/bcmath/tests/bcdiv_error2.phpt
+++ b/ext/bcmath/tests/bcdiv_error2.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcdiv('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcdiv('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..f3cb6074cb26 100644
--- a/ext/bcmath/tests/bcmod_error2.phpt
+++ b/ext/bcmath/tests/bcmod_error2.phpt
@@ -8,21 +8,21 @@ bcmath.scale=0
getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcmod("10", "0.000");
-} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
try {
bcmod("10", "-0.0");
-} catch (DivisionByZeroError $ex) {
- echo $ex->getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--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..ee8768f90e79 100644
--- a/ext/bcmath/tests/bcmod_error3.phpt
+++ b/ext/bcmath/tests/bcmod_error3.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcmod('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcmod('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..b1a6364c6a65 100644
--- a/ext/bcmath/tests/bcmul_error.phpt
+++ b/ext/bcmath/tests/bcmul_error.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcmul('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcmul('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..1d6fb2b7d2f4 100644
--- a/ext/bcmath/tests/bcpow_div_by_zero.phpt
+++ b/ext/bcmath/tests/bcpow_div_by_zero.phpt
@@ -13,17 +13,17 @@ foreach ($baseNumbers as $baseNumber) {
foreach ($exponents as $exponent) {
try {
echo bcpow($baseNumber, $exponent), "\n";
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ 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..0a78b4bdeb51 100644
--- a/ext/bcmath/tests/bcpow_error1.phpt
+++ b/ext/bcmath/tests/bcpow_error1.phpt
@@ -6,15 +6,15 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bcpow('1', '0.1', 2));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..a959a37399ee 100644
--- a/ext/bcmath/tests/bcpow_error2.phpt
+++ b/ext/bcmath/tests/bcpow_error2.phpt
@@ -6,16 +6,16 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bcpow('0', '-9223372036854775808', 2));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..1c97cce12b6f 100644
--- a/ext/bcmath/tests/bcpow_error3.phpt
+++ b/ext/bcmath/tests/bcpow_error3.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcpow('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcpow('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..99ba973a1df6 100644
--- a/ext/bcmath/tests/bcpowmod_error.phpt
+++ b/ext/bcmath/tests/bcpowmod_error.phpt
@@ -7,24 +7,24 @@ bcmath
try {
bcpowmod('a', '1', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcpowmod('1', 'a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcpowmod('1', '1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..6589177046f2 100644
--- a/ext/bcmath/tests/bcpowmod_negative_exponent.phpt
+++ b/ext/bcmath/tests/bcpowmod_negative_exponent.phpt
@@ -8,9 +8,9 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..cf757b07757d 100644
--- a/ext/bcmath/tests/bcpowmod_zero_modulus.phpt
+++ b/ext/bcmath/tests/bcpowmod_zero_modulus.phpt
@@ -8,9 +8,9 @@ bcmath
getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--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..ad1d6c9fc0f4 100644
--- a/ext/bcmath/tests/bcround_precision_bounds.phpt
+++ b/ext/bcmath/tests/bcround_precision_bounds.phpt
@@ -8,21 +8,21 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new BcMath\Number('1'))->round(PHP_INT_MAX);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
(new BcMath\Number('1'))->round(2147483648); // INT_MAX + 1
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..e816c499fedf 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;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..9c8781923b33 100644
--- a/ext/bcmath/tests/bcsqrt_error1.phpt
+++ b/ext/bcmath/tests/bcsqrt_error1.phpt
@@ -9,9 +9,9 @@ bcmath
getMessage(), PHP_EOL;
+} catch (Throwable $ex) {
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--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..7e58beca8fcc 100644
--- a/ext/bcmath/tests/bcsqrt_error2.phpt
+++ b/ext/bcmath/tests/bcsqrt_error2.phpt
@@ -7,10 +7,10 @@ bcmath
try {
bcsqrt('a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..029423326414 100644
--- a/ext/bcmath/tests/bcsub_error.phpt
+++ b/ext/bcmath/tests/bcsub_error.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcsub('a', '1');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcsub('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..ed65e83838d5 100644
--- a/ext/bcmath/tests/bug60377.phpt
+++ b/ext/bcmath/tests/bug60377.phpt
@@ -9,11 +9,11 @@ if (PHP_INT_SIZE != 8) die("skip: 64-bit only"); ?>
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$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..68955985e7e9 100644
--- a/ext/bcmath/tests/bug72093.phpt
+++ b/ext/bcmath/tests/bug72093.phpt
@@ -6,15 +6,15 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bcpowmod(1, 1.2, 1, 1));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..b39c53dfd5df 100644
--- a/ext/bcmath/tests/bug75178.phpt
+++ b/ext/bcmath/tests/bug75178.phpt
@@ -6,15 +6,15 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(bcpowmod('4', '4', '3.1', 3));
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..7ecd7c151e5e 100644
--- a/ext/bcmath/tests/bug78878.phpt
+++ b/ext/bcmath/tests/bug78878.phpt
@@ -6,9 +6,9 @@ bcmath
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..7b76a883adda 100644
--- a/ext/bcmath/tests/bug80545.phpt
+++ b/ext/bcmath/tests/bug80545.phpt
@@ -7,17 +7,17 @@ bcmath
try {
bcadd('a', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcadd('1', 'a');
-} catch (\ValueError $e) {
- echo $e->getMessage();
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..4b12b0e6cc41 100644
--- a/ext/bcmath/tests/gh15968.phpt
+++ b/ext/bcmath/tests/gh15968.phpt
@@ -14,9 +14,9 @@ $a = new BCMath\Number("1");
$b = new MyString();
try {
var_dump($a + $b);
-} catch (Error $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..0b10fbfc1c3f 100644
--- a/ext/bcmath/tests/negative_scale.phpt
+++ b/ext/bcmath/tests/negative_scale.phpt
@@ -8,63 +8,63 @@ bcmath.scale=0
getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcsub('1','2',-1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcmul('1','2',-1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcdiv('1','2',-1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcmod('1','2',-1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcpowmod('1', '2', '3', -9);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcpow('1', '2', -1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcsqrt('9', -1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bccomp('1', '2', -1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
bcscale(-1);
-} catch (\ValueError $e) {
- echo $e->getMessage() . \PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..0a05a0b57110 100644
--- a/ext/bcmath/tests/number/construct_error.phpt
+++ b/ext/bcmath/tests/number/construct_error.phpt
@@ -7,17 +7,17 @@ bcmath
try {
$num = new BcMath\Number('1');
$num->__construct(5);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num = new BcMath\Number('a');
var_dump($num);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..256d73f16c3a 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
@@ -28,8 +28,8 @@ foreach ($methods as $method) {
echo "{$type}:\n";
try {
$num->$method($val);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..479e205757b1 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
@@ -26,8 +26,8 @@ foreach ($methods as $method) {
echo "{$type}:\n";
try {
$num->$method(1, $val);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..6af3753f4945 100644
--- a/ext/bcmath/tests/number/methods/compare_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/compare_arg_error.phpt
@@ -17,21 +17,21 @@ foreach ($args as [$val, $type]) {
echo "{$type}:\n";
try {
$num->compare($val);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..b15005fc4152 100644
--- a/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt
+++ b/ext/bcmath/tests/number/methods/pow_div_by_zero.phpt
@@ -20,22 +20,22 @@ foreach ($values as $value) {
echo "{$value} ** {$exponent}: {$type}\n";
try {
$num->pow($exponent);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..3b3069296d67 100644
--- a/ext/bcmath/tests/number/methods/powmod_arg_error.phpt
+++ b/ext/bcmath/tests/number/methods/powmod_arg_error.phpt
@@ -19,8 +19,8 @@ foreach ($args as [$val, $type]) {
echo "{$type}:\n";
try {
$num->powmod($val, 1);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
@@ -31,19 +31,19 @@ foreach ($args as [$val, $type]) {
echo "{$type}:\n";
try {
$num->powmod(1, $val);
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..4e6389d8bb92 100644
--- a/ext/bcmath/tests/number/operators/calc_array.phpt
+++ b/ext/bcmath/tests/number/operators/calc_array.phpt
@@ -9,44 +9,44 @@ $array = [1];
try {
$num + $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $array;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..ebdd9867994a 100644
--- a/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt
+++ b/ext/bcmath/tests/number/operators/calc_non_numeric_string.phpt
@@ -8,44 +8,44 @@ $num = new BcMath\Number(100);
try {
$num + 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** 'a';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..46a3b8bf4a43 100644
--- a/ext/bcmath/tests/number/operators/calc_null.phpt
+++ b/ext/bcmath/tests/number/operators/calc_null.phpt
@@ -8,44 +8,44 @@ $num = new BcMath\Number(100);
try {
$num + null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** null;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..4b1e6a9917a0 100644
--- a/ext/bcmath/tests/number/operators/calc_other_class.phpt
+++ b/ext/bcmath/tests/number/operators/calc_other_class.phpt
@@ -9,44 +9,44 @@ $other = new stdClass();
try {
$num + $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $other;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..90ce286229cb 100644
--- a/ext/bcmath/tests/number/operators/calc_undef.phpt
+++ b/ext/bcmath/tests/number/operators/calc_undef.phpt
@@ -8,55 +8,55 @@ $num = new BcMath\Number(100);
try {
$num + $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num - $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num * $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num ** $undef;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..16959d243a48 100644
--- a/ext/bcmath/tests/number/operators/div_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/div_by_zero.phpt
@@ -8,46 +8,46 @@ $num = new BcMath\Number(100);
try {
$num / 0;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / '0';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / (new BcMath\Number(0));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$zero = new BcMath\Number(0);
try {
100 / $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
'100' / $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num / $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..58232fba0122 100644
--- a/ext/bcmath/tests/number/operators/mod_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/mod_by_zero.phpt
@@ -8,46 +8,46 @@ $num = new BcMath\Number(100);
try {
$num % 0;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % '0';
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % (new BcMath\Number(0));
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$zero = new BcMath\Number(0);
try {
100 % $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
'100' % $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num % $zero;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..7dd98fdea61e 100644
--- a/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt
+++ b/ext/bcmath/tests/number/operators/pow_div_by_zero.phpt
@@ -20,22 +20,22 @@ foreach ($values as $value) {
echo "{$value} ** {$exponent}: {$type}\n";
try {
$num ** $exponent;
- } catch (Error $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..f98e97477a57 100644
--- a/ext/bcmath/tests/number/properties_unknown.phpt
+++ b/ext/bcmath/tests/number/properties_unknown.phpt
@@ -11,16 +11,16 @@ var_dump($num->foo);
try {
$num->foo = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($num->foo);
try {
$num->bar = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..12dcf4b6e686 100644
--- a/ext/bcmath/tests/number/properties_unset.phpt
+++ b/ext/bcmath/tests/number/properties_unset.phpt
@@ -8,16 +8,16 @@ bcmath
$num = new BcMath\Number(1);
try {
unset($num->value);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
unset($num->scale);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..f92cccf2e125 100644
--- a/ext/bcmath/tests/number/properties_write_error.phpt
+++ b/ext/bcmath/tests/number/properties_write_error.phpt
@@ -8,16 +8,16 @@ bcmath
$num = new BcMath\Number(1);
try {
$num->value = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
$num->scale = 1;
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ 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..8351fe72336a 100644
--- a/ext/bcmath/tests/number/unserialize_error.phpt
+++ b/ext/bcmath/tests/number/unserialize_error.phpt
@@ -7,8 +7,8 @@ bcmath
try {
$num = new BcMath\Number(1);
$num->__unserialize(['value' => '5']);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -22,15 +22,15 @@ $cases = [
foreach ($cases as $case) {
try {
unserialize($case);
- } catch (Exception $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..20e3cf432ce2 100644
--- a/ext/bcmath/tests/sec_embedded_null_truncation.phpt
+++ b/ext/bcmath/tests/sec_embedded_null_truncation.phpt
@@ -26,34 +26,34 @@ foreach ($cases as $s) {
try {
$fn($s);
echo "FAIL: accepted\n";
- } catch (\ValueError $e) {
- echo $e->getMessage() . "\n";
+ } catch (\Throwable $e) {
+ 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..3cf4e5fc67a1 100644
--- a/ext/bcmath/tests/str2num_formatting.phpt
+++ b/ext/bcmath/tests/str2num_formatting.phpt
@@ -18,38 +18,38 @@ echo "\n";
try {
echo bcadd(" 0", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bcadd("1e1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bcadd("1,1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bcadd("Hello", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bcadd("1 1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bcadd("1.a", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
echo "\n";
@@ -64,32 +64,32 @@ echo "\n";
try {
echo bccomp(" 0", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bccomp("1e1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bccomp("1,1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bccomp("Hello", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo bccomp("1 1", "2");
-} catch (\ValueError $e) {
- echo $e->getMessage() . PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -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/dom/tests/DOM4_ChildNode_wrong_document.phpt b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
index cf51c3581a34..5942a4cf75fa 100644
--- a/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
+++ b/ext/dom/tests/DOM4_ChildNode_wrong_document.phpt
@@ -18,8 +18,8 @@ function test($method) {
try {
$element->$method($dom2->documentElement->firstChild);
echo "FAIL";
- } catch (DOMException $e) {
- echo $e->getMessage() . "\n";
+ } catch (Throwable $e) {
+ 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..b1db57e4f31a 100644
--- a/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt
+++ b/ext/dom/tests/DOM4_DOMNode_removeDanglingElement.phpt
@@ -11,9 +11,9 @@ $element = $dom->createElement('test');
try {
$element->remove();
-} catch (DOMException $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--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..2583bbe3178e 100644
--- a/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt
+++ b/ext/dom/tests/DOM4_ParentNode_append_invalidtypes.phpt
@@ -11,9 +11,9 @@ $dom->loadXML('
other
'); try { $dom->firstChild->firstChild->prepend($dom2->firstChild); -} catch (\DOMException $e) { - echo $e->getMessage(), "\n"; +} catch (\Throwable $e) { + 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"