Commit ca2f9bce3f1 for php.net
commit ca2f9bce3f1427a5b7a30bcb16c17dd3b9d1c3b6
Author: NickSdot <32384907+NickSdot@users.noreply.github.com>
Date: Sat Aug 22 19:49:54 2026 +0700
ext/opcache: applied fixers to improve test robustness (#23133)
diff --git a/ext/opcache/tests/assign_obj_exceptions.phpt b/ext/opcache/tests/assign_obj_exceptions.phpt
index ffcebede37b..f75caab5634 100644
--- a/ext/opcache/tests/assign_obj_exceptions.phpt
+++ b/ext/opcache/tests/assign_obj_exceptions.phpt
@@ -26,22 +26,22 @@ function test_invalid_obj_type($c) {
try {
test_invalid_prop_type();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_invalid_prop_name("\0");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_invalid_obj_type(false);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot assign string to property Test::$x of type stdClass
-Cannot access property starting with "\0"
-Attempt to assign property "x" on null
+TypeError: Cannot assign string to property Test::$x of type stdClass
+Error: Cannot access property starting with "\0"
+Error: Attempt to assign property "x" on null
diff --git a/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
index 1f42c3ac2ae..5f55f1f371a 100644
--- a/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
+++ b/ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
@@ -12,11 +12,11 @@ function test() {
}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined array key 0 in %s on line %d
-Attempt to assign property "y" on null
+Error: Attempt to assign property "y" on null
diff --git a/ext/opcache/tests/bug68104.phpt b/ext/opcache/tests/bug68104.phpt
index 00c9551e974..6c4335adc0c 100644
--- a/ext/opcache/tests/bug68104.phpt
+++ b/ext/opcache/tests/bug68104.phpt
@@ -17,10 +17,10 @@
var_dump(is_callable("dl"));
try {
dl("a.so");
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
bool(false)
-Call to undefined function dl()
+Error: Call to undefined function dl()
diff --git a/ext/opcache/tests/bug76796.phpt b/ext/opcache/tests/bug76796.phpt
index b9efbc3ce70..bc10f1fc628 100644
--- a/ext/opcache/tests/bug76796.phpt
+++ b/ext/opcache/tests/bug76796.phpt
@@ -12,10 +12,10 @@
try {
var_dump(strpos('foo', 'bar'));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to undefined function strpos()
+Error: Call to undefined function strpos()
diff --git a/ext/opcache/tests/bug78185.phpt b/ext/opcache/tests/bug78185.phpt
index d8f2b00977e..b671039a19b 100644
--- a/ext/opcache/tests/bug78185.phpt
+++ b/ext/opcache/tests/bug78185.phpt
@@ -38,4 +38,3 @@
?>
--EXPECTF--
string(%d) "%s78185.php.bin"
-
diff --git a/ext/opcache/tests/get_configuration_matches_ini.phpt b/ext/opcache/tests/get_configuration_matches_ini.phpt
index 8e29614acad..07d7f104456 100644
--- a/ext/opcache/tests/get_configuration_matches_ini.phpt
+++ b/ext/opcache/tests/get_configuration_matches_ini.phpt
@@ -14,4 +14,4 @@
?>
--EXPECT--
array(0) {
-}
\ No newline at end of file
+}
diff --git a/ext/opcache/tests/gh13817.phpt b/ext/opcache/tests/gh13817.phpt
index 0e5eb560d46..140b6d83632 100644
--- a/ext/opcache/tests/gh13817.phpt
+++ b/ext/opcache/tests/gh13817.phpt
@@ -48,4 +48,3 @@ function outer() {
</foo>
</outer>
</file '%s'>
-
diff --git a/ext/opcache/tests/gh17422/002.phpt b/ext/opcache/tests/gh17422/002.phpt
index 6145f71a8e5..9d4b1134fe2 100644
--- a/ext/opcache/tests/gh17422/002.phpt
+++ b/ext/opcache/tests/gh17422/002.phpt
@@ -9,13 +9,13 @@
try {
require __DIR__ . "/warning.inc";
-} catch (\Exception $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
warning();
?>
--EXPECT--
-Caught: "continue" targeting switch is equivalent to "break"
+ErrorException: "continue" targeting switch is equivalent to "break"
OK: warning
diff --git a/ext/opcache/tests/gh20628_borked_live_range_calc.phpt b/ext/opcache/tests/gh20628_borked_live_range_calc.phpt
index f0b6ccfc92c..741cb8ea3ff 100644
--- a/ext/opcache/tests/gh20628_borked_live_range_calc.phpt
+++ b/ext/opcache/tests/gh20628_borked_live_range_calc.phpt
@@ -15,9 +15,9 @@ function test($cond) {
try {
test(true);
} catch (Throwable $e) {
- echo $e::class, $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ReflectionExceptionClass "non" does not exist
+ReflectionException: Class "non" does not exist
diff --git a/ext/opcache/tests/inc_array.phpt b/ext/opcache/tests/inc_array.phpt
index 22355444816..0e4201286e6 100644
--- a/ext/opcache/tests/inc_array.phpt
+++ b/ext/opcache/tests/inc_array.phpt
@@ -13,15 +13,15 @@ function test_inc_partial_array($k) {
}
try {
test_inc_array();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_inc_partial_array(0);
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot increment array
-Cannot increment array
+TypeError: Cannot increment array
+TypeError: Cannot increment array
diff --git a/ext/opcache/tests/invalid_new_dce.phpt b/ext/opcache/tests/invalid_new_dce.phpt
index 4f31c8049c9..d1f38af59a3 100644
--- a/ext/opcache/tests/invalid_new_dce.phpt
+++ b/ext/opcache/tests/invalid_new_dce.phpt
@@ -29,14 +29,14 @@ function test4() {
$x = new Abc;
}
-try { test1(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
-try { test2(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
-try { test3(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
-try { test4(); } catch (Error $e) { echo $e->getMessage(), "\n"; }
+try { test1(); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
+try { test2(); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
+try { test3(); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
+try { test4(); } catch (Throwable $e) { echo $e::class, ': ', $e->getMessage(), "\n"; }
?>
--EXPECT--
-Cannot instantiate abstract class Foo
-Cannot instantiate interface Bar
-Cannot instantiate trait Baz
-Cannot declare self-referencing constant Abc::BAR
+Error: Cannot instantiate abstract class Foo
+Error: Cannot instantiate interface Bar
+Error: Cannot instantiate trait Baz
+Error: Cannot declare self-referencing constant Abc::BAR
diff --git a/ext/opcache/tests/issue0057.phpt b/ext/opcache/tests/issue0057.phpt
index ac73859b0d3..87a4e27561a 100644
--- a/ext/opcache/tests/issue0057.phpt
+++ b/ext/opcache/tests/issue0057.phpt
@@ -29,10 +29,10 @@ function dummy($query) {
try {
dummy(0);
-} catch (Exception $e) {
- echo $e->getMessage();
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-exception
+Exception: exception
diff --git a/ext/opcache/tests/jit/add_011.phpt b/ext/opcache/tests/jit/add_011.phpt
index 17bd7be99d1..898759b0a89 100644
--- a/ext/opcache/tests/jit/add_011.phpt
+++ b/ext/opcache/tests/jit/add_011.phpt
@@ -197,4 +197,3 @@ function test() {
Warning: The float %f is not representable as an int, cast occurred in %sadd_011.php on line 5
int(66572500992)
-
diff --git a/ext/opcache/tests/jit/add_012.phpt b/ext/opcache/tests/jit/add_012.phpt
index 707b795f5e0..87ae095f38f 100644
--- a/ext/opcache/tests/jit/add_012.phpt
+++ b/ext/opcache/tests/jit/add_012.phpt
@@ -15,4 +15,4 @@
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/add_013.phpt b/ext/opcache/tests/jit/add_013.phpt
index 9bac9ad5103..ef28c70da26 100644
--- a/ext/opcache/tests/jit/add_013.phpt
+++ b/ext/opcache/tests/jit/add_013.phpt
@@ -16,4 +16,4 @@ function y(){
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/add_014.phpt b/ext/opcache/tests/jit/add_014.phpt
index 7f4b96229ad..a620cc9b392 100644
--- a/ext/opcache/tests/jit/add_014.phpt
+++ b/ext/opcache/tests/jit/add_014.phpt
@@ -17,8 +17,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/add_015.phpt b/ext/opcache/tests/jit/add_015.phpt
index 6fcded2fe1f..8322cf1213c 100644
--- a/ext/opcache/tests/jit/add_015.phpt
+++ b/ext/opcache/tests/jit/add_015.phpt
@@ -19,4 +19,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/assign_018.phpt b/ext/opcache/tests/jit/assign_018.phpt
index a0c29320ab1..b5ba2a4989e 100644
--- a/ext/opcache/tests/jit/assign_018.phpt
+++ b/ext/opcache/tests/jit/assign_018.phpt
@@ -23,4 +23,3 @@ function foo() {
int(2)
array(0) {
}
-
diff --git a/ext/opcache/tests/jit/assign_040.phpt b/ext/opcache/tests/jit/assign_040.phpt
index 73eecfe2e10..17e0ef41aca 100644
--- a/ext/opcache/tests/jit/assign_040.phpt
+++ b/ext/opcache/tests/jit/assign_040.phpt
@@ -18,10 +18,10 @@ function test() {
}
try {
test();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $y in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
diff --git a/ext/opcache/tests/jit/assign_041.phpt b/ext/opcache/tests/jit/assign_041.phpt
index e7e2914875a..7e4ffeee4db 100644
--- a/ext/opcache/tests/jit/assign_041.phpt
+++ b/ext/opcache/tests/jit/assign_041.phpt
@@ -18,4 +18,4 @@ function test($val) {
test(0);
?>
--EXPECT--
-string(1) "0"
\ No newline at end of file
+string(1) "0"
diff --git a/ext/opcache/tests/jit/assign_043.phpt b/ext/opcache/tests/jit/assign_043.phpt
index edb0cb212ab..666deb35a96 100644
--- a/ext/opcache/tests/jit/assign_043.phpt
+++ b/ext/opcache/tests/jit/assign_043.phpt
@@ -13,9 +13,9 @@
try {
$a = $b;
NOT_REACHED;
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $b
+Exception: Undefined variable $b
diff --git a/ext/opcache/tests/jit/assign_044.phpt b/ext/opcache/tests/jit/assign_044.phpt
index e30483d2cae..312aaa3ab9c 100644
--- a/ext/opcache/tests/jit/assign_044.phpt
+++ b/ext/opcache/tests/jit/assign_044.phpt
@@ -17,4 +17,3 @@ function test($x) {
?>
--EXPECT--
float(INF)
-
diff --git a/ext/opcache/tests/jit/assign_045.phpt b/ext/opcache/tests/jit/assign_045.phpt
index 8c8f6fc9909..2f15ec62595 100644
--- a/ext/opcache/tests/jit/assign_045.phpt
+++ b/ext/opcache/tests/jit/assign_045.phpt
@@ -15,4 +15,3 @@ function test($x, $y) {
?>
--EXPECT--
int(1)
-
diff --git a/ext/opcache/tests/jit/assign_047.phpt b/ext/opcache/tests/jit/assign_047.phpt
index dcd222a8190..83092e4bb87 100644
--- a/ext/opcache/tests/jit/assign_047.phpt
+++ b/ext/opcache/tests/jit/assign_047.phpt
@@ -21,4 +21,3 @@ function test(){
--EXPECTF--
Warning: Undefined variable $a in %sassign_047.php on line 5
DONE
-
diff --git a/ext/opcache/tests/jit/assign_053.phpt b/ext/opcache/tests/jit/assign_053.phpt
index 7e226ab9935..66f2fc79fa0 100644
--- a/ext/opcache/tests/jit/assign_053.phpt
+++ b/ext/opcache/tests/jit/assign_053.phpt
@@ -22,4 +22,4 @@ class Test {
Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
Stack trace:
#0 {main}
- thrown in %sassign_053.php on line 7
\ No newline at end of file
+ thrown in %sassign_053.php on line 7
diff --git a/ext/opcache/tests/jit/assign_dim_002.phpt b/ext/opcache/tests/jit/assign_dim_002.phpt
index dac9393d5ba..53603b5115b 100644
--- a/ext/opcache/tests/jit/assign_dim_002.phpt
+++ b/ext/opcache/tests/jit/assign_dim_002.phpt
@@ -30,8 +30,8 @@ function foo3() {
$array = array(PHP_INT_MAX => "dummy");
try {
$array[] = array();
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$array = new ArrayObject();
@@ -59,8 +59,8 @@ function foo4() {
try {
$array[function() {}] = 2;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($array);
@@ -73,8 +73,8 @@ function foo5() {
$a = 1;
try {
$a[2] = 1;
- } catch (Error $e) {
- echo $e->getMessage(), "\n";
+ } catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
return $a;
}
@@ -108,15 +108,15 @@ function false_to_array_nested_invalid_index($a) {
var_dump(false_to_array_append(false));
try {
var_dump(false_to_array_invalid_index(false));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(false_to_array_nested(false));
var_dump(false_to_array_nested_append(false));
try {
var_dump(false_to_array_nested_invalid_index(false));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
function array_access_undef() {
@@ -141,7 +141,7 @@ function array_access_undef() {
array(0) {
}
}
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
@@ -160,7 +160,7 @@ function array_access_undef() {
int(1)
}
}
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
array(1) {
[0]=>
array(2) {
@@ -179,7 +179,7 @@ function array_access_undef() {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -197,7 +197,7 @@ function array_access_undef() {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
int(1)
@@ -220,7 +220,7 @@ function array_access_undef() {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Warning: Undefined variable $undef in %s on line %d
NULL
diff --git a/ext/opcache/tests/jit/assign_dim_003.phpt b/ext/opcache/tests/jit/assign_dim_003.phpt
index 95fed0b52cc..6d62754cf36 100644
--- a/ext/opcache/tests/jit/assign_dim_003.phpt
+++ b/ext/opcache/tests/jit/assign_dim_003.phpt
@@ -16,4 +16,4 @@ function test() {
?>
--EXPECTF--
Warning: Undefined variable $v in %sassign_dim_003.php on line 3
-NULL
\ No newline at end of file
+NULL
diff --git a/ext/opcache/tests/jit/assign_dim_011.phpt b/ext/opcache/tests/jit/assign_dim_011.phpt
index 5df415c89e6..5fa763fe9aa 100644
--- a/ext/opcache/tests/jit/assign_dim_011.phpt
+++ b/ext/opcache/tests/jit/assign_dim_011.phpt
@@ -14,11 +14,11 @@
try {
$my_var[] = "";
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
Err: Automatic conversion of false to array is deprecated
-Exception: Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
DONE
diff --git a/ext/opcache/tests/jit/assign_dim_013.phpt b/ext/opcache/tests/jit/assign_dim_013.phpt
index cccf0a32150..582129ede26 100644
--- a/ext/opcache/tests/jit/assign_dim_013.phpt
+++ b/ext/opcache/tests/jit/assign_dim_013.phpt
@@ -22,4 +22,4 @@ function test() {
Stack trace:
#0 %sassign_dim_013.php(11): test()
#1 {main}
- thrown in %sassign_dim_013.php on line 8
\ No newline at end of file
+ thrown in %sassign_dim_013.php on line 8
diff --git a/ext/opcache/tests/jit/assign_dim_017.phpt b/ext/opcache/tests/jit/assign_dim_017.phpt
index 9b0925f867f..c3524fdc79b 100644
--- a/ext/opcache/tests/jit/assign_dim_017.phpt
+++ b/ext/opcache/tests/jit/assign_dim_017.phpt
@@ -16,4 +16,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/assign_dim_op_001.phpt b/ext/opcache/tests/jit/assign_dim_op_001.phpt
index c5b057e9260..2834ee7ed29 100644
--- a/ext/opcache/tests/jit/assign_dim_op_001.phpt
+++ b/ext/opcache/tests/jit/assign_dim_op_001.phpt
@@ -48,20 +48,20 @@ function modulo_string($a) {
false_to_array_append(false);
try {
var_dump(false_to_array_invalid_index(false));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump(false_to_array_nested(false));
var_dump(false_to_array_nested_append(false));
try {
var_dump(false_to_array_nested_invalid_index(false));
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(modulo_string([]));
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
@@ -78,7 +78,7 @@ function modulo_string($a) {
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
@@ -103,5 +103,5 @@ function modulo_string($a) {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
-Unsupported operand types: null % string
+TypeError: Cannot access offset of type array on array
+TypeError: Unsupported operand types: null % string
diff --git a/ext/opcache/tests/jit/assign_dim_op_005.phpt b/ext/opcache/tests/jit/assign_dim_op_005.phpt
index a25cc7505e2..7f61f225170 100644
--- a/ext/opcache/tests/jit/assign_dim_op_005.phpt
+++ b/ext/opcache/tests/jit/assign_dim_op_005.phpt
@@ -17,15 +17,15 @@ function test2() {
}
try {
test1();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $undef
-Undefined variable $a
+Exception: Undefined variable $undef
+Exception: Undefined variable $a
diff --git a/ext/opcache/tests/jit/assign_dim_undef_exception.phpt b/ext/opcache/tests/jit/assign_dim_undef_exception.phpt
index 2c1d0274a1f..0a87e9f2467 100644
--- a/ext/opcache/tests/jit/assign_dim_undef_exception.phpt
+++ b/ext/opcache/tests/jit/assign_dim_undef_exception.phpt
@@ -23,15 +23,15 @@ function test3() {
}
try {
test1();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $undef
-Undefined variable $undef
+Exception: Undefined variable $undef
+Exception: Undefined variable $undef
diff --git a/ext/opcache/tests/jit/assign_obj_001.phpt b/ext/opcache/tests/jit/assign_obj_001.phpt
index c83a7e649e5..94c2897a62e 100644
--- a/ext/opcache/tests/jit/assign_obj_001.phpt
+++ b/ext/opcache/tests/jit/assign_obj_001.phpt
@@ -17,17 +17,17 @@ function test2($o) {
try {
test1(null);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(null);
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Attempt to assign property "x" on null
-Attempt to assign property "x" on null
+Error: Attempt to assign property "x" on null
+Error: Attempt to assign property "x" on null
diff --git a/ext/opcache/tests/jit/assign_obj_002.phpt b/ext/opcache/tests/jit/assign_obj_002.phpt
index 2b211f79d5d..f91e9f5c11f 100644
--- a/ext/opcache/tests/jit/assign_obj_002.phpt
+++ b/ext/opcache/tests/jit/assign_obj_002.phpt
@@ -23,8 +23,8 @@ function test2() {
test();
try {
test2();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
@@ -32,4 +32,4 @@ function test2() {
NULL
Warning: Undefined variable $undef in %s on line %d
-Cannot assign null to property Test::$prop2 of type int
+TypeError: Cannot assign null to property Test::$prop2 of type int
diff --git a/ext/opcache/tests/jit/assign_obj_003.phpt b/ext/opcache/tests/jit/assign_obj_003.phpt
index 4d878d648ef..7addb110113 100644
--- a/ext/opcache/tests/jit/assign_obj_003.phpt
+++ b/ext/opcache/tests/jit/assign_obj_003.phpt
@@ -29,8 +29,8 @@ function xxx() {
try {
@xxx();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Attempt to assign property "next" on null
+Error: Attempt to assign property "next" on null
diff --git a/ext/opcache/tests/jit/assign_obj_on_null.phpt b/ext/opcache/tests/jit/assign_obj_on_null.phpt
index 3ba85f20a23..136c438c1ea 100644
--- a/ext/opcache/tests/jit/assign_obj_on_null.phpt
+++ b/ext/opcache/tests/jit/assign_obj_on_null.phpt
@@ -22,15 +22,15 @@ function test2() {
}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Attempt to assign property "y" on null
-Attempt to assign property "y" on null
+Error: Attempt to assign property "y" on null
+Error: Attempt to assign property "y" on null
diff --git a/ext/opcache/tests/jit/assign_op_001.phpt b/ext/opcache/tests/jit/assign_op_001.phpt
index 957de4d83c5..5ebbcd35a81 100644
--- a/ext/opcache/tests/jit/assign_op_001.phpt
+++ b/ext/opcache/tests/jit/assign_op_001.phpt
@@ -14,15 +14,15 @@ function test2($a) {
}
try {
test1(1);
-} catch (DivisionByZeroError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test2(1);
-} catch (ArithmeticError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Modulo by zero
-Bit shift by negative number
+DivisionByZeroError: Modulo by zero
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/assign_op_002.phpt b/ext/opcache/tests/jit/assign_op_002.phpt
index fb8b0e46b7f..067d5f195c8 100644
--- a/ext/opcache/tests/jit/assign_op_002.phpt
+++ b/ext/opcache/tests/jit/assign_op_002.phpt
@@ -17,4 +17,4 @@ function test() {
test();
?>
--EXPECT--
-string(1) "0"
\ No newline at end of file
+string(1) "0"
diff --git a/ext/opcache/tests/jit/bind_static.phpt b/ext/opcache/tests/jit/bind_static.phpt
index 3aaef1befb5..367c38e8c5d 100644
--- a/ext/opcache/tests/jit/bind_static.phpt
+++ b/ext/opcache/tests/jit/bind_static.phpt
@@ -12,10 +12,10 @@ function test() {
}
try {
test();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined constant "UNDEFINED"
+Error: Undefined constant "UNDEFINED"
diff --git a/ext/opcache/tests/jit/bug80745.phpt b/ext/opcache/tests/jit/bug80745.phpt
index f2dec43d215..c0be5bebe84 100644
--- a/ext/opcache/tests/jit/bug80745.phpt
+++ b/ext/opcache/tests/jit/bug80745.phpt
@@ -39,4 +39,3 @@ function headerToBinary(Message $message)
Starting...
int(0)
PROBLEM NOT REPRODUCED !
-
diff --git a/ext/opcache/tests/jit/bug81409.phpt b/ext/opcache/tests/jit/bug81409.phpt
index d9501b18ddb..c617fd648a7 100644
--- a/ext/opcache/tests/jit/bug81409.phpt
+++ b/ext/opcache/tests/jit/bug81409.phpt
@@ -22,4 +22,4 @@ function bar() {
bar();
?>
--EXPECT--
-int(200)
\ No newline at end of file
+int(200)
diff --git a/ext/opcache/tests/jit/bw_not_001.phpt b/ext/opcache/tests/jit/bw_not_001.phpt
index 125cc8a1f15..33a37ff0c7f 100644
--- a/ext/opcache/tests/jit/bw_not_001.phpt
+++ b/ext/opcache/tests/jit/bw_not_001.phpt
@@ -16,4 +16,4 @@
Warning: Undefined variable $x in %sbw_not_001.php on line 2
Warning: Undefined array key "" in %sbw_not_001.php on line 2
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/copy_tmp_002.phpt b/ext/opcache/tests/jit/copy_tmp_002.phpt
index 01b87b41874..ed61b52ac87 100644
--- a/ext/opcache/tests/jit/copy_tmp_002.phpt
+++ b/ext/opcache/tests/jit/copy_tmp_002.phpt
@@ -11,4 +11,4 @@
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/count_001.phpt b/ext/opcache/tests/jit/count_001.phpt
index 2fb1c52d285..6fca44ecfc2 100644
--- a/ext/opcache/tests/jit/count_001.phpt
+++ b/ext/opcache/tests/jit/count_001.phpt
@@ -65,4 +65,4 @@ public static function count_throws(): int {
Caught In destructor
Caught In destructor
Caught In destructor
-Caught In destructor
\ No newline at end of file
+Caught In destructor
diff --git a/ext/opcache/tests/jit/fe_reset_001.phpt b/ext/opcache/tests/jit/fe_reset_001.phpt
index fcd1d18ada8..95b7c38661b 100644
--- a/ext/opcache/tests/jit/fe_reset_001.phpt
+++ b/ext/opcache/tests/jit/fe_reset_001.phpt
@@ -33,4 +33,3 @@
Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4
OK
-
diff --git a/ext/opcache/tests/jit/fetch_dim_r_003.phpt b/ext/opcache/tests/jit/fetch_dim_r_003.phpt
index 43c216026b9..44157598a10 100644
--- a/ext/opcache/tests/jit/fetch_dim_r_003.phpt
+++ b/ext/opcache/tests/jit/fetch_dim_r_003.phpt
@@ -21,15 +21,15 @@ function foo() {
var_dump($a[null]);
try {
var_dump($a["ab"]);
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
$x = "a";
$y = "b";
try {
var_dump($a[$x . $y]);
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
var_dump($a["2x"]);
$x = "2";
@@ -55,8 +55,8 @@ function foo() {
Warning: String offset cast occurred in %s on line %d
string(1) "A"
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "2x" in %sfetch_dim_r_003.php on line 24
string(1) "C"
diff --git a/ext/opcache/tests/jit/fetch_dim_r_004.phpt b/ext/opcache/tests/jit/fetch_dim_r_004.phpt
index d0a25de7936..5ecfe1f4696 100644
--- a/ext/opcache/tests/jit/fetch_dim_r_004.phpt
+++ b/ext/opcache/tests/jit/fetch_dim_r_004.phpt
@@ -13,8 +13,8 @@ function foo($n) {
$a = "ABCDEF";
try {
var_dump($a[$n]);
- } catch (\TypeError $e) {
- echo $e->getMessage() . \PHP_EOL;
+ } catch (\Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
}
foo(0);
@@ -51,8 +51,8 @@ function foo($n) {
Warning: String offset cast occurred in %s on line %d
string(1) "A"
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "2x" in %sfetch_dim_r_004.php on line 5
string(1) "C"
diff --git a/ext/opcache/tests/jit/fetch_dim_r_006.phpt b/ext/opcache/tests/jit/fetch_dim_r_006.phpt
index 18250aa822f..10b33b42418 100644
--- a/ext/opcache/tests/jit/fetch_dim_r_006.phpt
+++ b/ext/opcache/tests/jit/fetch_dim_r_006.phpt
@@ -24,4 +24,4 @@ function test() {
Warning: Undefined array key 0 in %sfetch_dim_r_006.php on line 5
NULL
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/fetch_obj_001.phpt b/ext/opcache/tests/jit/fetch_obj_001.phpt
index ddc8dfafba6..a172f3cfba4 100644
--- a/ext/opcache/tests/jit/fetch_obj_001.phpt
+++ b/ext/opcache/tests/jit/fetch_obj_001.phpt
@@ -50,24 +50,24 @@ function bar() {
$d = array();
try {
foo($d->{"ab" ."c"});
- } catch (Error $err) {
- echo $err->getMessage(), "\n";
+ } catch (Throwable $err) {
+ echo $err::class, ': ', $err->getMessage(), "\n";
}
var_dump($d);
$e = NULL;
try {
foo($e->{"ab" ."c"});
- } catch (Error $err) {
- echo $err->getMessage(), "\n";
+ } catch (Throwable $err) {
+ echo $err::class, ': ', $err->getMessage(), "\n";
}
var_dump($e);
$f = "";
try {
foo($f->{"ab" ."c"});
- } catch (Error $err) {
- echo $err->getMessage(), "\n";
+ } catch (Throwable $err) {
+ echo $err::class, ': ', $err->getMessage(), "\n";
}
var_dump($f);
}
@@ -127,10 +127,10 @@ function bar() {
array(0) {
}
}
-Attempt to modify property "abc" on array
+Error: Attempt to modify property "abc" on array
array(0) {
}
-Attempt to modify property "abc" on null
+Error: Attempt to modify property "abc" on null
NULL
-Attempt to modify property "abc" on string
+Error: Attempt to modify property "abc" on string
string(0) ""
diff --git a/ext/opcache/tests/jit/fetch_obj_005.phpt b/ext/opcache/tests/jit/fetch_obj_005.phpt
index 2084269bf43..bfd61eb725b 100644
--- a/ext/opcache/tests/jit/fetch_obj_005.phpt
+++ b/ext/opcache/tests/jit/fetch_obj_005.phpt
@@ -19,4 +19,4 @@
Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
-Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
\ No newline at end of file
+Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
diff --git a/ext/opcache/tests/jit/gh12509.phpt b/ext/opcache/tests/jit/gh12509.phpt
index ae8bdee6619..e96a22f4d0f 100644
--- a/ext/opcache/tests/jit/gh12509.phpt
+++ b/ext/opcache/tests/jit/gh12509.phpt
@@ -25,4 +25,4 @@ function test($a) {
int(2)
[3]=>
int(3)
-}
\ No newline at end of file
+}
diff --git a/ext/opcache/tests/jit/gh12723-A.phpt b/ext/opcache/tests/jit/gh12723-A.phpt
index f30453e8c0a..d0350dca3ae 100644
--- a/ext/opcache/tests/jit/gh12723-A.phpt
+++ b/ext/opcache/tests/jit/gh12723-A.phpt
@@ -12,9 +12,9 @@
try {
var_dump($container[$dimension]);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type array on string
+TypeError: Cannot access offset of type array on string
diff --git a/ext/opcache/tests/jit/gh12723-B.phpt b/ext/opcache/tests/jit/gh12723-B.phpt
index 9f5ae7a19ff..7018e24b156 100644
--- a/ext/opcache/tests/jit/gh12723-B.phpt
+++ b/ext/opcache/tests/jit/gh12723-B.phpt
@@ -11,9 +11,9 @@
try {
$container[new stdClass()] .= 'append';
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use object of type stdClass as array
+Error: Cannot use object of type stdClass as array
diff --git a/ext/opcache/tests/jit/gh12747.phpt b/ext/opcache/tests/jit/gh12747.phpt
index df0b039cebc..1229b782914 100644
--- a/ext/opcache/tests/jit/gh12747.phpt
+++ b/ext/opcache/tests/jit/gh12747.phpt
@@ -11,25 +11,25 @@
echo "isset():\n";
var_dump(isset($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "empty():\n";
var_dump(empty($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "Coalesce():\n";
var_dump($container[new stdClass()] ?? 'default');
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
isset():
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
empty():
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
Coalesce():
-Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type stdClass on array
diff --git a/ext/opcache/tests/jit/gh12748.phpt b/ext/opcache/tests/jit/gh12748.phpt
index d7580fdb9ab..3b309e25745 100644
--- a/ext/opcache/tests/jit/gh12748.phpt
+++ b/ext/opcache/tests/jit/gh12748.phpt
@@ -11,19 +11,19 @@
echo "isset():\n";
var_dump(isset($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "empty():\n";
var_dump(empty($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "Coalesce():\n";
var_dump($container[new stdClass()] ?? 'default');
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -32,4 +32,4 @@
empty():
bool(true)
Coalesce():
-Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
diff --git a/ext/opcache/tests/jit/gh12812.phpt b/ext/opcache/tests/jit/gh12812.phpt
index 267abf2aae0..faa6433ce26 100644
--- a/ext/opcache/tests/jit/gh12812.phpt
+++ b/ext/opcache/tests/jit/gh12812.phpt
@@ -12,12 +12,12 @@
try {
var_dump($container['7']);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($container[$dimension]);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/opcache/tests/jit/gh13772.phpt b/ext/opcache/tests/jit/gh13772.phpt
index 97fa6536e0c..172d2e535b7 100644
--- a/ext/opcache/tests/jit/gh13772.phpt
+++ b/ext/opcache/tests/jit/gh13772.phpt
@@ -23,4 +23,3 @@ function Ack($m, $n) {
?>
--EXPECT--
int(61)
-
diff --git a/ext/opcache/tests/jit/gh15652.phpt b/ext/opcache/tests/jit/gh15652.phpt
index 2220c7550a6..82762a7138c 100644
--- a/ext/opcache/tests/jit/gh15652.phpt
+++ b/ext/opcache/tests/jit/gh15652.phpt
@@ -43,4 +43,4 @@ class C2 extends C {
Warning: Undefined property: C2::$value in %sgh15652.php on line 6
Warning: Undefined property: C2::$value in %sgh15652.php on line 6
-bool(true)
\ No newline at end of file
+bool(true)
diff --git a/ext/opcache/tests/jit/gh16499.phpt b/ext/opcache/tests/jit/gh16499.phpt
index 6aec1012ab5..0dad8349a15 100644
--- a/ext/opcache/tests/jit/gh16499.phpt
+++ b/ext/opcache/tests/jit/gh16499.phpt
@@ -25,4 +25,4 @@ function test($cond): ?int {
Warning: Undefined variable $i in %sgh16499.php on line 6
Warning: Undefined variable $i in %sgh16499.php on line 6
-NULL
\ No newline at end of file
+NULL
diff --git a/ext/opcache/tests/jit/gh8863.phpt b/ext/opcache/tests/jit/gh8863.phpt
index 0d8e833c5fa..dc52e4d73c1 100644
--- a/ext/opcache/tests/jit/gh8863.phpt
+++ b/ext/opcache/tests/jit/gh8863.phpt
@@ -22,11 +22,11 @@ public function rw() {
$test = new Test();
try {
$test->rw();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
-Cannot modify readonly property Test::$prop
+Error: Cannot modify readonly property Test::$prop
DONE
diff --git a/ext/opcache/tests/jit/gh9011.phpt b/ext/opcache/tests/jit/gh9011.phpt
index 3ffefe2ce29..f8667fbae8c 100644
--- a/ext/opcache/tests/jit/gh9011.phpt
+++ b/ext/opcache/tests/jit/gh9011.phpt
@@ -24,4 +24,4 @@ public function __toString(): string
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/inc_020.phpt b/ext/opcache/tests/jit/inc_020.phpt
index 9c0c2472acf..99610f1d3b4 100644
--- a/ext/opcache/tests/jit/inc_020.phpt
+++ b/ext/opcache/tests/jit/inc_020.phpt
@@ -24,4 +24,4 @@ function foo($row) {
?>
OK
--EXPECT--
-OK
\ No newline at end of file
+OK
diff --git a/ext/opcache/tests/jit/inc_obj_003.phpt b/ext/opcache/tests/jit/inc_obj_003.phpt
index dfa556cfe26..77dd2d42e31 100644
--- a/ext/opcache/tests/jit/inc_obj_003.phpt
+++ b/ext/opcache/tests/jit/inc_obj_003.phpt
@@ -16,4 +16,4 @@ class Test {
var_dump($v);
?>
--EXPECT--
-float(0)
\ No newline at end of file
+float(0)
diff --git a/ext/opcache/tests/jit/inc_obj_006.phpt b/ext/opcache/tests/jit/inc_obj_006.phpt
index af31d0c471c..1bdae45fa16 100644
--- a/ext/opcache/tests/jit/inc_obj_006.phpt
+++ b/ext/opcache/tests/jit/inc_obj_006.phpt
@@ -27,4 +27,3 @@ function __set($x, $y) {
Stack trace:
#0 {main}
thrown in %sinc_obj_006.php on line 14
-
diff --git a/ext/opcache/tests/jit/init_fcall_001.phpt b/ext/opcache/tests/jit/init_fcall_001.phpt
index fae4af53179..19959a235d0 100644
--- a/ext/opcache/tests/jit/init_fcall_001.phpt
+++ b/ext/opcache/tests/jit/init_fcall_001.phpt
@@ -18,4 +18,3 @@
#0 %sinit_fcall_001.php(5): ini_set()
#1 {main}
thrown in %sinit_fcall_001.php on line 5
-
diff --git a/ext/opcache/tests/jit/isset_002.phpt b/ext/opcache/tests/jit/isset_002.phpt
index 2c2527fbe7b..41f1b6e39a8 100644
--- a/ext/opcache/tests/jit/isset_002.phpt
+++ b/ext/opcache/tests/jit/isset_002.phpt
@@ -29,4 +29,4 @@ function foo() {
Warning: Undefined variable $how in %sisset_002.php on line 3
Warning: foreach() argument must be of type array|object, null given in %sisset_002.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/match_001.phpt b/ext/opcache/tests/jit/match_001.phpt
index b21c5b2c172..86d9cf9ff51 100644
--- a/ext/opcache/tests/jit/match_001.phpt
+++ b/ext/opcache/tests/jit/match_001.phpt
@@ -18,4 +18,4 @@ function foo() {
Stack trace:
#0 %smatch_001.php(5): foo()
#1 {main}
- thrown in %smatch_001.php on line 3
\ No newline at end of file
+ thrown in %smatch_001.php on line 3
diff --git a/ext/opcache/tests/jit/mod_001.phpt b/ext/opcache/tests/jit/mod_001.phpt
index 03431fe54eb..c01be5536b6 100644
--- a/ext/opcache/tests/jit/mod_001.phpt
+++ b/ext/opcache/tests/jit/mod_001.phpt
@@ -21,12 +21,12 @@ function mod(int $a, int $b) {
try {
var_dump(mod(125, -1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(mod(125, 0));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -37,4 +37,4 @@ function mod(int $a, int $b) {
int(26)
int(-26)
int(0)
-Exception (DivisionByZeroError): Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/jit/mod_002.phpt b/ext/opcache/tests/jit/mod_002.phpt
index b1d163b94d5..a19d8c41ac3 100644
--- a/ext/opcache/tests/jit/mod_002.phpt
+++ b/ext/opcache/tests/jit/mod_002.phpt
@@ -33,12 +33,12 @@ function mod0(int $a) {
try {
var_dump(modNeg1(125));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(mod0(125));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -49,4 +49,4 @@ function mod0(int $a) {
int(26)
int(-26)
int(0)
-Exception (DivisionByZeroError): Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/jit/mod_004.phpt b/ext/opcache/tests/jit/mod_004.phpt
index 73cf1a92c47..b8905ae8c6d 100644
--- a/ext/opcache/tests/jit/mod_004.phpt
+++ b/ext/opcache/tests/jit/mod_004.phpt
@@ -17,4 +17,4 @@
Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smod_004.php:4
Stack trace:
#0 {main}
- thrown in %smod_004.php on line 4
\ No newline at end of file
+ thrown in %smod_004.php on line 4
diff --git a/ext/opcache/tests/jit/mod_006.phpt b/ext/opcache/tests/jit/mod_006.phpt
index 6409cd3253a..b9abbd8e98a 100644
--- a/ext/opcache/tests/jit/mod_006.phpt
+++ b/ext/opcache/tests/jit/mod_006.phpt
@@ -15,4 +15,4 @@ function foo(){
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mod_007.phpt b/ext/opcache/tests/jit/mod_007.phpt
index 1d76d34fe43..add360e9f3a 100644
--- a/ext/opcache/tests/jit/mod_007.phpt
+++ b/ext/opcache/tests/jit/mod_007.phpt
@@ -19,4 +19,4 @@ function test($a) {
Stack trace:
#0 %smod_007.php(7): test(NULL)
#1 {main}
- thrown in %smod_007.php on line 4
\ No newline at end of file
+ thrown in %smod_007.php on line 4
diff --git a/ext/opcache/tests/jit/mul_003.phpt b/ext/opcache/tests/jit/mul_003.phpt
index d57534d9b3f..08f0b4cdd76 100644
--- a/ext/opcache/tests/jit/mul_003.phpt
+++ b/ext/opcache/tests/jit/mul_003.phpt
@@ -29,4 +29,4 @@ function mul1_bound(int $a) {
?>
--EXPECT--
int(-6442450944)
-int(-6442450944)
\ No newline at end of file
+int(-6442450944)
diff --git a/ext/opcache/tests/jit/mul_005.phpt b/ext/opcache/tests/jit/mul_005.phpt
index 7476d215f13..9d475bf5e4e 100644
--- a/ext/opcache/tests/jit/mul_005.phpt
+++ b/ext/opcache/tests/jit/mul_005.phpt
@@ -16,9 +16,9 @@ function test($a) {
try {
test('foo');
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: string * int
+TypeError: Unsupported operand types: string * int
diff --git a/ext/opcache/tests/jit/mul_006.phpt b/ext/opcache/tests/jit/mul_006.phpt
index a36bdec41b0..0dd03fc9dc2 100644
--- a/ext/opcache/tests/jit/mul_006.phpt
+++ b/ext/opcache/tests/jit/mul_006.phpt
@@ -15,4 +15,4 @@
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mul_007.phpt b/ext/opcache/tests/jit/mul_007.phpt
index 71eb4d4009c..e4a652de183 100644
--- a/ext/opcache/tests/jit/mul_007.phpt
+++ b/ext/opcache/tests/jit/mul_007.phpt
@@ -17,4 +17,4 @@ function test() {
Deprecated: Implicit conversion from float 1.5 to int loses precision in %smul_007.php on line 3
Deprecated: Implicit conversion from float 0.5 to int loses precision in %smul_007.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mul_009.phpt b/ext/opcache/tests/jit/mul_009.phpt
index a6016bd535e..4f3207d2735 100644
--- a/ext/opcache/tests/jit/mul_009.phpt
+++ b/ext/opcache/tests/jit/mul_009.phpt
@@ -16,4 +16,4 @@
Fatal error: Uncaught TypeError: Unsupported operand types: array * int in %smul_009.php:3
Stack trace:
#0 {main}
- thrown in %smul_009.php on line 3
\ No newline at end of file
+ thrown in %smul_009.php on line 3
diff --git a/ext/opcache/tests/jit/mul_010.phpt b/ext/opcache/tests/jit/mul_010.phpt
index 6c94f816448..49422a20ff7 100644
--- a/ext/opcache/tests/jit/mul_010.phpt
+++ b/ext/opcache/tests/jit/mul_010.phpt
@@ -25,8 +25,8 @@ function test() {
try {
@test();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: string * float
+TypeError: Unsupported operand types: string * float
diff --git a/ext/opcache/tests/jit/noval_001.phpt b/ext/opcache/tests/jit/noval_001.phpt
index 0fef38652bf..c0932560494 100644
--- a/ext/opcache/tests/jit/noval_001.phpt
+++ b/ext/opcache/tests/jit/noval_001.phpt
@@ -31,4 +31,3 @@ static function bar() {
?>
--EXPECT--
string(2) "ok"
-
diff --git a/ext/opcache/tests/jit/qm_assign_001.phpt b/ext/opcache/tests/jit/qm_assign_001.phpt
index ecfda50a28c..3c89b5360bb 100644
--- a/ext/opcache/tests/jit/qm_assign_001.phpt
+++ b/ext/opcache/tests/jit/qm_assign_001.phpt
@@ -13,4 +13,3 @@
Deprecated: Implicit conversion from float 1.5 to int loses precision in %sqm_assign_001.php on line 2
-1
-
diff --git a/ext/opcache/tests/jit/qm_assign_002.phpt b/ext/opcache/tests/jit/qm_assign_002.phpt
index 8f6328d81dd..2a12942dc44 100644
--- a/ext/opcache/tests/jit/qm_assign_002.phpt
+++ b/ext/opcache/tests/jit/qm_assign_002.phpt
@@ -25,4 +25,4 @@ function test() {
Warning: Undefined variable $a in %sqm_assign_002.php on line 4
Warning: Array to string conversion in %sqm_assign_002.php on line 5
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/qm_assign_003.phpt b/ext/opcache/tests/jit/qm_assign_003.phpt
index cb62c5425c7..c9c8b126cbd 100644
--- a/ext/opcache/tests/jit/qm_assign_003.phpt
+++ b/ext/opcache/tests/jit/qm_assign_003.phpt
@@ -22,4 +22,4 @@ function foo() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/qm_assign_undef_exception.phpt b/ext/opcache/tests/jit/qm_assign_undef_exception.phpt
index 4e93e2ed7e5..4c2c513141f 100644
--- a/ext/opcache/tests/jit/qm_assign_undef_exception.phpt
+++ b/ext/opcache/tests/jit/qm_assign_undef_exception.phpt
@@ -13,9 +13,9 @@ function test() {
}
try {
test();
-} catch (Exception $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Undefined variable $b
+Exception: Undefined variable $b
diff --git a/ext/opcache/tests/jit/recursive_wrong_args.phpt b/ext/opcache/tests/jit/recursive_wrong_args.phpt
index 84043ca03d5..d135f53362f 100644
--- a/ext/opcache/tests/jit/recursive_wrong_args.phpt
+++ b/ext/opcache/tests/jit/recursive_wrong_args.phpt
@@ -11,9 +11,9 @@ function f($arg) {
}
try {
f();
-} catch (ArgumentCountError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
-Too few arguments to function f(), 0 passed in %s on line %d and exactly 1 expected
+ArgumentCountError: Too few arguments to function f(), 0 passed in %s on line %d and exactly 1 expected
diff --git a/ext/opcache/tests/jit/recv_002.phpt b/ext/opcache/tests/jit/recv_002.phpt
index 30999dc278d..016935f94cb 100644
--- a/ext/opcache/tests/jit/recv_002.phpt
+++ b/ext/opcache/tests/jit/recv_002.phpt
@@ -23,4 +23,4 @@ function test($a)
Stack trace:
#0 %s(7): test()
#1 {main}
- thrown in %s on line 3
\ No newline at end of file
+ thrown in %s on line 3
diff --git a/ext/opcache/tests/jit/reg_alloc_005.phpt b/ext/opcache/tests/jit/reg_alloc_005.phpt
index f46d0f64e74..3d4d15b896e 100644
--- a/ext/opcache/tests/jit/reg_alloc_005.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_005.phpt
@@ -18,4 +18,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_006.phpt b/ext/opcache/tests/jit/reg_alloc_006.phpt
index fa7777a12d8..411a614c778 100644
--- a/ext/opcache/tests/jit/reg_alloc_006.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_006.phpt
@@ -30,4 +30,4 @@ function foo() {
Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_010.phpt b/ext/opcache/tests/jit/reg_alloc_010.phpt
index 4dd92d43dfa..02b685f5879 100644
--- a/ext/opcache/tests/jit/reg_alloc_010.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_010.phpt
@@ -20,4 +20,4 @@ function foo($y) {
Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3
Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_011.phpt b/ext/opcache/tests/jit/reg_alloc_011.phpt
index 521a827cc1f..8d61ac2047a 100644
--- a/ext/opcache/tests/jit/reg_alloc_011.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_011.phpt
@@ -21,4 +21,4 @@ function foo($y) {
?>
DONE
--EXPECTF--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_012.phpt b/ext/opcache/tests/jit/reg_alloc_012.phpt
index b684011fbf1..d9d20820337 100644
--- a/ext/opcache/tests/jit/reg_alloc_012.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_012.phpt
@@ -18,4 +18,4 @@ function foo($a) {
?>
DONE
--EXPECTF--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_013.phpt b/ext/opcache/tests/jit/reg_alloc_013.phpt
index 73bd3abb656..cba21193a84 100644
--- a/ext/opcache/tests/jit/reg_alloc_013.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_013.phpt
@@ -15,4 +15,4 @@ function foo() {
DONE
--EXPECTF--
Warning: Undefined variable $j in %sreg_alloc_013.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_022.phpt b/ext/opcache/tests/jit/reg_alloc_022.phpt
index fc9a0b29dff..80f720627bc 100644
--- a/ext/opcache/tests/jit/reg_alloc_022.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_022.phpt
@@ -22,4 +22,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/shift_left_001.phpt b/ext/opcache/tests/jit/shift_left_001.phpt
index 5b0cbf927ca..c5f0421e780 100644
--- a/ext/opcache/tests/jit/shift_left_001.phpt
+++ b/ext/opcache/tests/jit/shift_left_001.phpt
@@ -19,12 +19,12 @@ function shl(int $a, int $b) {
try {
var_dump(shl(1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shl(1, -1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -33,4 +33,4 @@ function shl(int $a, int $b) {
int(4)
int(-4)
int(0)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_left_002.phpt b/ext/opcache/tests/jit/shift_left_002.phpt
index 979aaf96b0b..5bdbf8bd745 100644
--- a/ext/opcache/tests/jit/shift_left_002.phpt
+++ b/ext/opcache/tests/jit/shift_left_002.phpt
@@ -31,12 +31,12 @@ function shlNEG(int $a) {
try {
var_dump(shl64(1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shlNEG(1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -45,4 +45,4 @@ function shlNEG(int $a) {
int(4)
int(-4)
int(0)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_right_001.phpt b/ext/opcache/tests/jit/shift_right_001.phpt
index 454e8a12044..c1ddb627b28 100644
--- a/ext/opcache/tests/jit/shift_right_001.phpt
+++ b/ext/opcache/tests/jit/shift_right_001.phpt
@@ -19,17 +19,17 @@ function shr(int $a, int $b) {
try {
var_dump(shr(1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr(-1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr(1, -1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -39,4 +39,4 @@ function shr(int $a, int $b) {
int(-2)
int(0)
int(-1)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_right_002.phpt b/ext/opcache/tests/jit/shift_right_002.phpt
index c7d6d227774..0dea5171512 100644
--- a/ext/opcache/tests/jit/shift_right_002.phpt
+++ b/ext/opcache/tests/jit/shift_right_002.phpt
@@ -31,17 +31,17 @@ function shrNEG(int $a) {
try {
var_dump(shr64(1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr64(-1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shrNEG(1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -51,4 +51,4 @@ function shrNEG(int $a) {
int(-2)
int(0)
int(-1)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/type_check_001.phpt b/ext/opcache/tests/jit/type_check_001.phpt
index 028d2e8637e..b498fda998d 100644
--- a/ext/opcache/tests/jit/type_check_001.phpt
+++ b/ext/opcache/tests/jit/type_check_001.phpt
@@ -16,8 +16,8 @@
if (!is_scalar($a)) {
undefined_function('Null');
}
-} catch (Exception $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
diff --git a/ext/opcache/tests/jit/undef_to_typed_ref.phpt b/ext/opcache/tests/jit/undef_to_typed_ref.phpt
index c1308e249a9..dc6e75797d8 100644
--- a/ext/opcache/tests/jit/undef_to_typed_ref.phpt
+++ b/ext/opcache/tests/jit/undef_to_typed_ref.phpt
@@ -56,51 +56,51 @@ function test_obj_nores() {
try {
test_simple_res();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_simple_nores();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_dim_res();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_dim_nores();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_obj_res();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
test_obj_nores();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
Warning: Undefined variable $v in %s on line %d
-Cannot assign null to reference held by property Test::$x of type string
+TypeError: Cannot assign null to reference held by property Test::$x of type string
diff --git a/ext/opcache/tests/jit/verify_return_undef.phpt b/ext/opcache/tests/jit/verify_return_undef.phpt
index fb07ee42505..db46ec2dfff 100644
--- a/ext/opcache/tests/jit/verify_return_undef.phpt
+++ b/ext/opcache/tests/jit/verify_return_undef.phpt
@@ -13,11 +13,11 @@ function test(): int {
try {
test();
-} catch (TypeError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: Undefined variable $undef in %s on line %d
-test(): Return value must be of type int, null returned
+TypeError: test(): Return value must be of type int, null returned
diff --git a/ext/opcache/tests/match_always_error.phpt b/ext/opcache/tests/match_always_error.phpt
index 1be5b21305b..b1a86548877 100644
--- a/ext/opcache/tests/match_always_error.phpt
+++ b/ext/opcache/tests/match_always_error.phpt
@@ -13,9 +13,9 @@ function test() {
}
try {
test();
-} catch (UnhandledMatchError $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Unhandled match case 0
+UnhandledMatchError: Unhandled match case 0
diff --git a/ext/opcache/tests/method_call_on_literal.phpt b/ext/opcache/tests/method_call_on_literal.phpt
index 50b0076c401..ad61adc47c4 100644
--- a/ext/opcache/tests/method_call_on_literal.phpt
+++ b/ext/opcache/tests/method_call_on_literal.phpt
@@ -7,10 +7,10 @@
try {
(42)->foo();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Call to a member function foo() on int
+Error: Call to a member function foo() on int
diff --git a/ext/opcache/tests/opt/coalesce_002.phpt b/ext/opcache/tests/opt/coalesce_002.phpt
index c3a05d22e7a..e118df2cc62 100644
--- a/ext/opcache/tests/opt/coalesce_002.phpt
+++ b/ext/opcache/tests/opt/coalesce_002.phpt
@@ -19,4 +19,4 @@ function t() {
#0 %scoalesce_002.php(3): var_dump()
#1 %scoalesce_002.php(5): t()
#2 {main}
- thrown in %scoalesce_002.php on line 3
\ No newline at end of file
+ thrown in %scoalesce_002.php on line 3
diff --git a/ext/opcache/tests/opt/gh19792.phpt b/ext/opcache/tests/opt/gh19792.phpt
index edd805ca57a..69987d7590d 100644
--- a/ext/opcache/tests/opt/gh19792.phpt
+++ b/ext/opcache/tests/opt/gh19792.phpt
@@ -17,11 +17,11 @@ function foo()
try {
foo();
-} catch (Error $e) {
- echo $e->getMessage(), "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
Warning: a warning in %s on line %d
-an exception
+Error: an exception
diff --git a/ext/opcache/tests/opt/inference_003.phpt b/ext/opcache/tests/opt/inference_003.phpt
index 046396f2125..b4e58596825 100644
--- a/ext/opcache/tests/opt/inference_003.phpt
+++ b/ext/opcache/tests/opt/inference_003.phpt
@@ -17,4 +17,3 @@ public static function wrap(\Throwable $e): C {
Stack trace:
#0 {main}
thrown in %sinference_003.php on line 2
-
diff --git a/ext/opcache/tests/opt/inference_016.phpt b/ext/opcache/tests/opt/inference_016.phpt
index 7d1733934fb..5b8b8a3334c 100644
--- a/ext/opcache/tests/opt/inference_016.phpt
+++ b/ext/opcache/tests/opt/inference_016.phpt
@@ -15,11 +15,11 @@ function test() {
try {
test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
NULL
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %sinference_016.php on line %d
-Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/opt/inference_017.phpt b/ext/opcache/tests/opt/inference_017.phpt
index 2c9255e3b2b..00f26bd682a 100644
--- a/ext/opcache/tests/opt/inference_017.phpt
+++ b/ext/opcache/tests/opt/inference_017.phpt
@@ -14,8 +14,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/opcache/tests/opt/inference_018.phpt b/ext/opcache/tests/opt/inference_018.phpt
index 123cb3b9eb6..f865913d01b 100644
--- a/ext/opcache/tests/opt/inference_018.phpt
+++ b/ext/opcache/tests/opt/inference_018.phpt
@@ -16,8 +16,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/opcache/tests/opt/tmp_001.phpt b/ext/opcache/tests/opt/tmp_001.phpt
index 83b679f5f76..3b1e67e006f 100644
--- a/ext/opcache/tests/opt/tmp_001.phpt
+++ b/ext/opcache/tests/opt/tmp_001.phpt
@@ -15,4 +15,4 @@
Stack trace:
#0 %stmp_001.php(2): is_a(0)
#1 {main}
- thrown in %stmp_001.php on line 2
\ No newline at end of file
+ thrown in %stmp_001.php on line 2
diff --git a/ext/opcache/tests/optimize_static_001.phpt b/ext/opcache/tests/optimize_static_001.phpt
index a71f029b330..894d9f0d8c2 100644
--- a/ext/opcache/tests/optimize_static_001.phpt
+++ b/ext/opcache/tests/optimize_static_001.phpt
@@ -14,10 +14,10 @@ function foo() {
try {
foo();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
OK
--EXPECT--
-Exception: Undefined constant "UNDEFINED_CONST"
+Error: Undefined constant "UNDEFINED_CONST"
OK
diff --git a/ext/opcache/tests/preload_004.phpt b/ext/opcache/tests/preload_004.phpt
index 76047bde622..fee4eb68214 100644
--- a/ext/opcache/tests/preload_004.phpt
+++ b/ext/opcache/tests/preload_004.phpt
@@ -17,9 +17,9 @@
try {
new Foo();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-Undefined constant self::DOES_NOT_EXIST
+Error: Undefined constant self::DOES_NOT_EXIST
diff --git a/ext/opcache/tests/preload_009.phpt b/ext/opcache/tests/preload_009.phpt
index bb15998f7ab..71702922bea 100644
--- a/ext/opcache/tests/preload_009.phpt
+++ b/ext/opcache/tests/preload_009.phpt
@@ -18,10 +18,10 @@
try {
new Foo();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
bool(true)
-Undefined constant "UNDEF"
+Error: Undefined constant "UNDEF"
diff --git a/ext/opcache/tests/preload_012.phpt b/ext/opcache/tests/preload_012.phpt
index 836d4707a0d..b23876666cb 100644
--- a/ext/opcache/tests/preload_012.phpt
+++ b/ext/opcache/tests/preload_012.phpt
@@ -19,9 +19,9 @@ class Foo {
try {
new Test();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
diff --git a/ext/opcache/tests/ssa_bug_003.phpt b/ext/opcache/tests/ssa_bug_003.phpt
index 780a0295578..95de8b40290 100644
--- a/ext/opcache/tests/ssa_bug_003.phpt
+++ b/ext/opcache/tests/ssa_bug_003.phpt
@@ -18,8 +18,8 @@ function test1($x) : callable {
try {
test1(1);
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
class Foo {}
@@ -30,11 +30,11 @@ function test2() : Foo {
try {
test2();
-} catch (Error $e) {
- echo $e->getMessage() . "\n";
+} catch (Throwable $e) {
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-test1(): Return value must be of type callable, string returned
-test2(): Return value must be of type Foo, stdClass returned
+TypeError: test1(): Return value must be of type callable, string returned
+TypeError: test2(): Return value must be of type Foo, stdClass returned