[PHP-CVS] [php-src] master: ext/opcache: applied fixers to improve test robustness (#23133)
[email protected] (NickSdot via GitHub)
| Newsgroups | php.cvs |
|---|---|
| Message-ID | <[email protected]> |
Author: NickSdot (NickSdot)
Committer: GitHub (web-flow)
Pusher: Girgias
Date: 2026-08-22T13:49:54+01:00
Commit: https://github.com/php/php-src/commit/ca2f9bce3f1427a5b7a30bcb16c17dd3b9d1c3b6
Raw diff: https://github.com/php/php-src/commit/ca2f9bce3f1427a5b7a30bcb16c17dd3b9d1c3b6.diff
ext/opcache: applied fixers to improve test robustness (#23133)
Changed paths:
M ext/opcache/tests/assign_obj_exceptions.phpt
M ext/opcache/tests/assign_obj_op_of_fetch_dim.phpt
M ext/opcache/tests/bug68104.phpt
M ext/opcache/tests/bug76796.phpt
M ext/opcache/tests/bug78185.phpt
M ext/opcache/tests/get_configuration_matches_ini.phpt
M ext/opcache/tests/gh13817.phpt
M ext/opcache/tests/gh17422/002.phpt
M ext/opcache/tests/gh20628_borked_live_range_calc.phpt
M ext/opcache/tests/inc_array.phpt
M ext/opcache/tests/invalid_new_dce.phpt
M ext/opcache/tests/issue0057.phpt
M ext/opcache/tests/jit/add_011.phpt
M ext/opcache/tests/jit/add_012.phpt
M ext/opcache/tests/jit/add_013.phpt
M ext/opcache/tests/jit/add_014.phpt
M ext/opcache/tests/jit/add_015.phpt
M ext/opcache/tests/jit/assign_018.phpt
M ext/opcache/tests/jit/assign_040.phpt
M ext/opcache/tests/jit/assign_041.phpt
M ext/opcache/tests/jit/assign_043.phpt
M ext/opcache/tests/jit/assign_044.phpt
M ext/opcache/tests/jit/assign_045.phpt
M ext/opcache/tests/jit/assign_047.phpt
M ext/opcache/tests/jit/assign_053.phpt
M ext/opcache/tests/jit/assign_dim_002.phpt
M ext/opcache/tests/jit/assign_dim_003.phpt
M ext/opcache/tests/jit/assign_dim_011.phpt
M ext/opcache/tests/jit/assign_dim_013.phpt
M ext/opcache/tests/jit/assign_dim_017.phpt
M ext/opcache/tests/jit/assign_dim_op_001.phpt
M ext/opcache/tests/jit/assign_dim_op_005.phpt
M ext/opcache/tests/jit/assign_dim_undef_exception.phpt
M ext/opcache/tests/jit/assign_obj_001.phpt
M ext/opcache/tests/jit/assign_obj_002.phpt
M ext/opcache/tests/jit/assign_obj_003.phpt
M ext/opcache/tests/jit/assign_obj_on_null.phpt
M ext/opcache/tests/jit/assign_op_001.phpt
M ext/opcache/tests/jit/assign_op_002.phpt
M ext/opcache/tests/jit/bind_static.phpt
M ext/opcache/tests/jit/bug80745.phpt
M ext/opcache/tests/jit/bug81409.phpt
M ext/opcache/tests/jit/bw_not_001.phpt
M ext/opcache/tests/jit/copy_tmp_002.phpt
M ext/opcache/tests/jit/count_001.phpt
M ext/opcache/tests/jit/fe_reset_001.phpt
M ext/opcache/tests/jit/fetch_dim_r_003.phpt
M ext/opcache/tests/jit/fetch_dim_r_004.phpt
M ext/opcache/tests/jit/fetch_dim_r_006.phpt
M ext/opcache/tests/jit/fetch_obj_001.phpt
M ext/opcache/tests/jit/fetch_obj_005.phpt
M ext/opcache/tests/jit/gh12509.phpt
M ext/opcache/tests/jit/gh12723-A.phpt
M ext/opcache/tests/jit/gh12723-B.phpt
M ext/opcache/tests/jit/gh12747.phpt
M ext/opcache/tests/jit/gh12748.phpt
M ext/opcache/tests/jit/gh12812.phpt
M ext/opcache/tests/jit/gh13772.phpt
M ext/opcache/tests/jit/gh15652.phpt
M ext/opcache/tests/jit/gh16499.phpt
M ext/opcache/tests/jit/gh8863.phpt
M ext/opcache/tests/jit/gh9011.phpt
M ext/opcache/tests/jit/inc_020.phpt
M ext/opcache/tests/jit/inc_obj_003.phpt
M ext/opcache/tests/jit/inc_obj_006.phpt
M ext/opcache/tests/jit/init_fcall_001.phpt
M ext/opcache/tests/jit/isset_002.phpt
M ext/opcache/tests/jit/match_001.phpt
M ext/opcache/tests/jit/mod_001.phpt
M ext/opcache/tests/jit/mod_002.phpt
M ext/opcache/tests/jit/mod_004.phpt
M ext/opcache/tests/jit/mod_006.phpt
M ext/opcache/tests/jit/mod_007.phpt
M ext/opcache/tests/jit/mul_003.phpt
M ext/opcache/tests/jit/mul_005.phpt
M ext/opcache/tests/jit/mul_006.phpt
M ext/opcache/tests/jit/mul_007.phpt
M ext/opcache/tests/jit/mul_009.phpt
M ext/opcache/tests/jit/mul_010.phpt
M ext/opcache/tests/jit/noval_001.phpt
M ext/opcache/tests/jit/qm_assign_001.phpt
M ext/opcache/tests/jit/qm_assign_002.phpt
M ext/opcache/tests/jit/qm_assign_003.phpt
M ext/opcache/tests/jit/qm_assign_undef_exception.phpt
M ext/opcache/tests/jit/recursive_wrong_args.phpt
M ext/opcache/tests/jit/recv_002.phpt
M ext/opcache/tests/jit/reg_alloc_005.phpt
M ext/opcache/tests/jit/reg_alloc_006.phpt
M ext/opcache/tests/jit/reg_alloc_010.phpt
M ext/opcache/tests/jit/reg_alloc_011.phpt
M ext/opcache/tests/jit/reg_alloc_012.phpt
M ext/opcache/tests/jit/reg_alloc_013.phpt
M ext/opcache/tests/jit/reg_alloc_022.phpt
M ext/opcache/tests/jit/shift_left_001.phpt
M ext/opcache/tests/jit/shift_left_002.phpt
M ext/opcache/tests/jit/shift_right_001.phpt
M ext/opcache/tests/jit/shift_right_002.phpt
M ext/opcache/tests/jit/type_check_001.phpt
M ext/opcache/tests/jit/undef_to_typed_ref.phpt
M ext/opcache/tests/jit/verify_return_undef.phpt
M ext/opcache/tests/match_always_error.phpt
M ext/opcache/tests/method_call_on_literal.phpt
M ext/opcache/tests/opt/coalesce_002.phpt
M ext/opcache/tests/opt/gh19792.phpt
M ext/opcache/tests/opt/inference_003.phpt
M ext/opcache/tests/opt/inference_016.phpt
M ext/opcache/tests/opt/inference_017.phpt
M ext/opcache/tests/opt/inference_018.phpt
M ext/opcache/tests/opt/tmp_001.phpt
M ext/opcache/tests/optimize_static_001.phpt
M ext/opcache/tests/preload_004.phpt
M ext/opcache/tests/preload_009.phpt
M ext/opcache/tests/preload_012.phpt
M ext/opcache/tests/ssa_bug_003.phpt
Diff:
diff --git a/ext/opcache/tests/assign_obj_exceptions.phpt b/ext/opcache/tests/assign_obj_exceptions.phpt
index ffcebede37b0..f75caab56346 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 1f42c3ac2aeb..5f55f1f371a8 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 00c9551e974c..6c4335adc0cb 100644
--- a/ext/opcache/tests/bug68104.phpt
+++ b/ext/opcache/tests/bug68104.phpt
@@ -17,10 +17,10 @@ if (getenv('SKIP_ASAN')) die('xleak dl() crashes LSan');
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 b9efbc3ce70f..bc10f1fc6289 100644
--- a/ext/opcache/tests/bug76796.phpt
+++ b/ext/opcache/tests/bug76796.phpt
@@ -12,10 +12,10 @@ opcache
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 d8f2b00977ec..b671039a19be 100644
--- a/ext/opcache/tests/bug78185.phpt
+++ b/ext/opcache/tests/bug78185.phpt
@@ -38,4 +38,3 @@ foreach (glob($pattern) as $p) {
?>
--EXPECTF--
string(%d) "%s78185.php.bin"
-
diff --git a/ext/opcache/tests/get_configuration_matches_ini.phpt b/ext/opcache/tests/get_configuration_matches_ini.phpt
index 8e29614acad6..07d7f1044567 100644
--- a/ext/opcache/tests/get_configuration_matches_ini.phpt
+++ b/ext/opcache/tests/get_configuration_matches_ini.phpt
@@ -14,4 +14,4 @@ var_dump(array_diff_key($inis, $opts));
?>
--EXPECT--
array(0) {
-}
\ No newline at end of file
+}
diff --git a/ext/opcache/tests/gh13817.phpt b/ext/opcache/tests/gh13817.phpt
index 0e5eb560d46f..140b6d836320 100644
--- a/ext/opcache/tests/gh13817.phpt
+++ b/ext/opcache/tests/gh13817.phpt
@@ -48,4 +48,3 @@ Ok
</foo>
</outer>
</file '%s'>
-
diff --git a/ext/opcache/tests/gh17422/002.phpt b/ext/opcache/tests/gh17422/002.phpt
index 6145f71a8e58..9d4b1134fe29 100644
--- a/ext/opcache/tests/gh17422/002.phpt
+++ b/ext/opcache/tests/gh17422/002.phpt
@@ -9,13 +9,13 @@ set_error_handler(static function (int $errno, string $errstr, string $errfile,
try {
require __DIR__ . "/warning.inc";
-} catch (\Exception $e) {
- echo "Caught: ", $e->getMessage(), PHP_EOL;
+} 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 f0b6ccfc92c8..741cb8ea3fff 100644
--- a/ext/opcache/tests/gh20628_borked_live_range_calc.phpt
+++ b/ext/opcache/tests/gh20628_borked_live_range_calc.phpt
@@ -15,9 +15,9 @@ function test($cond) {
try {
test(true);
} catch (Throwable $e) {
- echo $e::class, $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-ReflectionExceptionClass "non" does not exist
+ReflectionException: Class "non" does not exist
diff --git a/ext/opcache/tests/inc_array.phpt b/ext/opcache/tests/inc_array.phpt
index 223554448164..0e4201286e65 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 4f31c8049c9c..d1f38af59a3c 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 ac73859b0d36..87a4e27561ac 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 17bd7be99d15..898759b0a894 100644
--- a/ext/opcache/tests/jit/add_011.phpt
+++ b/ext/opcache/tests/jit/add_011.phpt
@@ -197,4 +197,3 @@ Warning: Undefined variable $u in %sadd_011.php on line 5
Warning: The float %f is not representable as an int, cast occurred in %sadd_011.php on line 5
int(66572500992)
-
diff --git a/ext/opcache/tests/jit/add_012.phpt b/ext/opcache/tests/jit/add_012.phpt
index 707b795f5e03..87ae095f38f1 100644
--- a/ext/opcache/tests/jit/add_012.phpt
+++ b/ext/opcache/tests/jit/add_012.phpt
@@ -15,4 +15,4 @@ $y[$x] += 4467793343;
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/add_013.phpt b/ext/opcache/tests/jit/add_013.phpt
index 9bac9ad51036..ef28c70da26b 100644
--- a/ext/opcache/tests/jit/add_013.phpt
+++ b/ext/opcache/tests/jit/add_013.phpt
@@ -16,4 +16,4 @@ function y(){
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/add_014.phpt b/ext/opcache/tests/jit/add_014.phpt
index 7f4b96229ad4..a620cc9b392d 100644
--- a/ext/opcache/tests/jit/add_014.phpt
+++ b/ext/opcache/tests/jit/add_014.phpt
@@ -17,8 +17,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/add_015.phpt b/ext/opcache/tests/jit/add_015.phpt
index 6fcded2fe1f5..8322cf1213c7 100644
--- a/ext/opcache/tests/jit/add_015.phpt
+++ b/ext/opcache/tests/jit/add_015.phpt
@@ -19,4 +19,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/assign_018.phpt b/ext/opcache/tests/jit/assign_018.phpt
index a0c29320ab18..b5ba2a4989e9 100644
--- a/ext/opcache/tests/jit/assign_018.phpt
+++ b/ext/opcache/tests/jit/assign_018.phpt
@@ -23,4 +23,3 @@ foo();
int(2)
array(0) {
}
-
diff --git a/ext/opcache/tests/jit/assign_040.phpt b/ext/opcache/tests/jit/assign_040.phpt
index 73eecfe2e109..17e0ef41acaf 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 e7e2914875a8..7e4ffeee4db0 100644
--- a/ext/opcache/tests/jit/assign_041.phpt
+++ b/ext/opcache/tests/jit/assign_041.phpt
@@ -18,4 +18,4 @@ function test($val) {
test(0);
?>
--EXPECT--
-string(1) "0"
\ No newline at end of file
+string(1) "0"
diff --git a/ext/opcache/tests/jit/assign_043.phpt b/ext/opcache/tests/jit/assign_043.phpt
index edb0cb212ab0..666deb35a96e 100644
--- a/ext/opcache/tests/jit/assign_043.phpt
+++ b/ext/opcache/tests/jit/assign_043.phpt
@@ -13,9 +13,9 @@ set_error_handler(function($_, $m) {
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 e30483d2caec..312aaa3ab9c1 100644
--- a/ext/opcache/tests/jit/assign_044.phpt
+++ b/ext/opcache/tests/jit/assign_044.phpt
@@ -17,4 +17,3 @@ test(false);
?>
--EXPECT--
float(INF)
-
diff --git a/ext/opcache/tests/jit/assign_045.phpt b/ext/opcache/tests/jit/assign_045.phpt
index 8c8f6fc99091..2f15ec62595e 100644
--- a/ext/opcache/tests/jit/assign_045.phpt
+++ b/ext/opcache/tests/jit/assign_045.phpt
@@ -15,4 +15,3 @@ test(null, 1);
?>
--EXPECT--
int(1)
-
diff --git a/ext/opcache/tests/jit/assign_047.phpt b/ext/opcache/tests/jit/assign_047.phpt
index dcd222a8190e..83092e4bb876 100644
--- a/ext/opcache/tests/jit/assign_047.phpt
+++ b/ext/opcache/tests/jit/assign_047.phpt
@@ -21,4 +21,3 @@ DONE
--EXPECTF--
Warning: Undefined variable $a in %sassign_047.php on line 5
DONE
-
diff --git a/ext/opcache/tests/jit/assign_053.phpt b/ext/opcache/tests/jit/assign_053.phpt
index 7e226ab99351..66f2fc79fa0c 100644
--- a/ext/opcache/tests/jit/assign_053.phpt
+++ b/ext/opcache/tests/jit/assign_053.phpt
@@ -22,4 +22,4 @@ Warning: Undefined variable $y in %sassign_053.php on line 7
Fatal error: Uncaught TypeError: Cannot assign null to reference held by property Test::$x of type string in %sassign_053.php:7
Stack trace:
#0 {main}
- thrown in %sassign_053.php on line 7
\ No newline at end of file
+ thrown in %sassign_053.php on line 7
diff --git a/ext/opcache/tests/jit/assign_dim_002.phpt b/ext/opcache/tests/jit/assign_dim_002.phpt
index dac9393d5ba9..53603b5115bb 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 @@ var_dump(false_to_array(false));
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 @@ array(1) {
array(0) {
}
}
-Cannot add element to the array as the next element is already occupied
+Error: Cannot add element to the array as the next element is already occupied
object(ArrayObject)#%d (1) {
["storage":"ArrayObject":private]=>
array(2) {
@@ -160,7 +160,7 @@ array(1) {
int(1)
}
}
-Cannot access offset of type Closure on array
+TypeError: Cannot access offset of type Closure on array
array(1) {
[0]=>
array(2) {
@@ -179,7 +179,7 @@ array(1) {
int(1)
}
}
-Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
int(1)
Deprecated: Automatic conversion of false to array is deprecated in %s
@@ -197,7 +197,7 @@ array(1) {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
int(1)
@@ -220,7 +220,7 @@ array(1) {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Warning: Undefined variable $undef in %s on line %d
NULL
diff --git a/ext/opcache/tests/jit/assign_dim_003.phpt b/ext/opcache/tests/jit/assign_dim_003.phpt
index 95fed0b52cce..6d62754cf360 100644
--- a/ext/opcache/tests/jit/assign_dim_003.phpt
+++ b/ext/opcache/tests/jit/assign_dim_003.phpt
@@ -16,4 +16,4 @@ test();
?>
--EXPECTF--
Warning: Undefined variable $v in %sassign_dim_003.php on line 3
-NULL
\ No newline at end of file
+NULL
diff --git a/ext/opcache/tests/jit/assign_dim_011.phpt b/ext/opcache/tests/jit/assign_dim_011.phpt
index 5df415c89e6c..5fa763fe9aa7 100644
--- a/ext/opcache/tests/jit/assign_dim_011.phpt
+++ b/ext/opcache/tests/jit/assign_dim_011.phpt
@@ -14,11 +14,11 @@ set_error_handler(function($code, $msg) use(&$my_var) {
try {
$my_var[] = "";
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
DONE
--EXPECT--
Err: Automatic conversion of false to array is deprecated
-Exception: Cannot use a scalar value as an array
+Error: Cannot use a scalar value as an array
DONE
diff --git a/ext/opcache/tests/jit/assign_dim_013.phpt b/ext/opcache/tests/jit/assign_dim_013.phpt
index cccf0a32150c..582129ede261 100644
--- a/ext/opcache/tests/jit/assign_dim_013.phpt
+++ b/ext/opcache/tests/jit/assign_dim_013.phpt
@@ -22,4 +22,4 @@ Fatal error: Uncaught Error: Undefined constant "y" in %sassign_dim_013.php:8
Stack trace:
#0 %sassign_dim_013.php(11): test()
#1 {main}
- thrown in %sassign_dim_013.php on line 8
\ No newline at end of file
+ thrown in %sassign_dim_013.php on line 8
diff --git a/ext/opcache/tests/jit/assign_dim_017.phpt b/ext/opcache/tests/jit/assign_dim_017.phpt
index 9b0925f867f8..c3524fdc79b4 100644
--- a/ext/opcache/tests/jit/assign_dim_017.phpt
+++ b/ext/opcache/tests/jit/assign_dim_017.phpt
@@ -16,4 +16,4 @@ function test() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/assign_dim_op_001.phpt b/ext/opcache/tests/jit/assign_dim_op_001.phpt
index c5b057e92603..2834ee7ed297 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 @@ false_to_array(false);
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 @@ Warning: Undefined array key 2 in %s on line %d
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
+TypeError: Cannot access offset of type array on array
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
@@ -103,5 +103,5 @@ array(1) {
}
Deprecated: Automatic conversion of false to array is deprecated in %s on line %d
-Cannot access offset of type array on array
-Unsupported operand types: null % string
+TypeError: Cannot access offset of type array on array
+TypeError: Unsupported operand types: null % string
diff --git a/ext/opcache/tests/jit/assign_dim_op_005.phpt b/ext/opcache/tests/jit/assign_dim_op_005.phpt
index a25cc7505e2b..7f61f2251707 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 2c1d0274a1f8..0a87e9f2467c 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 c83a7e649e5b..94c2897a62e5 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 2b211f79d5dd..f91e9f5c11f7 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 @@ Warning: Undefined variable $undef in %s on line %d
NULL
Warning: Undefined variable $undef in %s on line %d
-Cannot assign null to property Test::$prop2 of type int
+TypeError: Cannot assign null to property Test::$prop2 of type int
diff --git a/ext/opcache/tests/jit/assign_obj_003.phpt b/ext/opcache/tests/jit/assign_obj_003.phpt
index 4d878d648efb..7addb1101136 100644
--- a/ext/opcache/tests/jit/assign_obj_003.phpt
+++ b/ext/opcache/tests/jit/assign_obj_003.phpt
@@ -29,8 +29,8 @@ function xxx() {
try {
@xxx();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Exception: Attempt to assign property "next" on null
+Error: Attempt to assign property "next" on null
diff --git a/ext/opcache/tests/jit/assign_obj_on_null.phpt b/ext/opcache/tests/jit/assign_obj_on_null.phpt
index 3ba85f20a230..136c438c1ea9 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 957de4d83c56..5ebbcd35a813 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 fb8b0e46b7f4..067d5f195c8c 100644
--- a/ext/opcache/tests/jit/assign_op_002.phpt
+++ b/ext/opcache/tests/jit/assign_op_002.phpt
@@ -17,4 +17,4 @@ function test() {
test();
?>
--EXPECT--
-string(1) "0"
\ No newline at end of file
+string(1) "0"
diff --git a/ext/opcache/tests/jit/bind_static.phpt b/ext/opcache/tests/jit/bind_static.phpt
index 3aaef1befb5e..367c38e8c5d5 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 f2dec43d2153..c0be5bebe845 100644
--- a/ext/opcache/tests/jit/bug80745.phpt
+++ b/ext/opcache/tests/jit/bug80745.phpt
@@ -39,4 +39,3 @@ echo "PROBLEM NOT REPRODUCED !\n";
Starting...
int(0)
PROBLEM NOT REPRODUCED !
-
diff --git a/ext/opcache/tests/jit/bug81409.phpt b/ext/opcache/tests/jit/bug81409.phpt
index d9501b18ddbb..c617fd648a78 100644
--- a/ext/opcache/tests/jit/bug81409.phpt
+++ b/ext/opcache/tests/jit/bug81409.phpt
@@ -22,4 +22,4 @@ function bar() {
bar();
?>
--EXPECT--
-int(200)
\ No newline at end of file
+int(200)
diff --git a/ext/opcache/tests/jit/bw_not_001.phpt b/ext/opcache/tests/jit/bw_not_001.phpt
index 125cc8a1f158..33a37ff0c7f7 100644
--- a/ext/opcache/tests/jit/bw_not_001.phpt
+++ b/ext/opcache/tests/jit/bw_not_001.phpt
@@ -16,4 +16,4 @@ Warning: Undefined variable $x in %sbw_not_001.php on line 2
Warning: Undefined variable $x in %sbw_not_001.php on line 2
Warning: Undefined array key "" in %sbw_not_001.php on line 2
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/copy_tmp_002.phpt b/ext/opcache/tests/jit/copy_tmp_002.phpt
index 01b87b418748..ed61b52ac87c 100644
--- a/ext/opcache/tests/jit/copy_tmp_002.phpt
+++ b/ext/opcache/tests/jit/copy_tmp_002.phpt
@@ -11,4 +11,4 @@ $x[~"abc"] ??= 0;
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/count_001.phpt b/ext/opcache/tests/jit/count_001.phpt
index 2fb1c52d2855..6fca44ecfc21 100644
--- a/ext/opcache/tests/jit/count_001.phpt
+++ b/ext/opcache/tests/jit/count_001.phpt
@@ -65,4 +65,4 @@ Caught In destructor
Caught In destructor
Caught In destructor
Caught In destructor
-Caught In destructor
\ No newline at end of file
+Caught In destructor
diff --git a/ext/opcache/tests/jit/fe_reset_001.phpt b/ext/opcache/tests/jit/fe_reset_001.phpt
index fcd1d18ada80..95b7c38661b9 100644
--- a/ext/opcache/tests/jit/fe_reset_001.phpt
+++ b/ext/opcache/tests/jit/fe_reset_001.phpt
@@ -33,4 +33,3 @@ Warning: Undefined variable $4 in %sfe_reset_001.php on line 4
Warning: foreach() argument must be of type array|object, null given in %sfe_reset_001.php on line 4
OK
-
diff --git a/ext/opcache/tests/jit/fetch_dim_r_003.phpt b/ext/opcache/tests/jit/fetch_dim_r_003.phpt
index 43c216026b93..44157598a10b 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 @@ string(1) "B"
Warning: String offset cast occurred in %s on line %d
string(1) "A"
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "2x" in %sfetch_dim_r_003.php on line 24
string(1) "C"
diff --git a/ext/opcache/tests/jit/fetch_dim_r_004.phpt b/ext/opcache/tests/jit/fetch_dim_r_004.phpt
index d0a25de7936e..5ecfe1f46967 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 @@ string(1) "B"
Warning: String offset cast occurred in %s on line %d
string(1) "A"
-Cannot access offset of type string on string
-Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
+TypeError: Cannot access offset of type string on string
Warning: Illegal string offset "2x" in %sfetch_dim_r_004.php on line 5
string(1) "C"
diff --git a/ext/opcache/tests/jit/fetch_dim_r_006.phpt b/ext/opcache/tests/jit/fetch_dim_r_006.phpt
index 18250aa822ff..10b33b424180 100644
--- a/ext/opcache/tests/jit/fetch_dim_r_006.phpt
+++ b/ext/opcache/tests/jit/fetch_dim_r_006.phpt
@@ -24,4 +24,4 @@ NULL
Warning: Undefined array key 0 in %sfetch_dim_r_006.php on line 5
NULL
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/fetch_obj_001.phpt b/ext/opcache/tests/jit/fetch_obj_001.phpt
index ddc8dfafba64..a172f3cfba44 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 @@ object(stdClass)#%d (2) {
array(0) {
}
}
-Attempt to modify property "abc" on array
+Error: Attempt to modify property "abc" on array
array(0) {
}
-Attempt to modify property "abc" on null
+Error: Attempt to modify property "abc" on null
NULL
-Attempt to modify property "abc" on string
+Error: Attempt to modify property "abc" on string
string(0) ""
diff --git a/ext/opcache/tests/jit/fetch_obj_005.phpt b/ext/opcache/tests/jit/fetch_obj_005.phpt
index 2084269bf430..bfd61eb725b2 100644
--- a/ext/opcache/tests/jit/fetch_obj_005.phpt
+++ b/ext/opcache/tests/jit/fetch_obj_005.phpt
@@ -19,4 +19,4 @@ Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
-Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
\ No newline at end of file
+Warning: Attempt to read property "p" on null in %sfetch_obj_005.php on line 4
diff --git a/ext/opcache/tests/jit/gh12509.phpt b/ext/opcache/tests/jit/gh12509.phpt
index ae8bdee66196..e96a22f4d0fc 100644
--- a/ext/opcache/tests/jit/gh12509.phpt
+++ b/ext/opcache/tests/jit/gh12509.phpt
@@ -25,4 +25,4 @@ array(3) {
int(2)
[3]=>
int(3)
-}
\ No newline at end of file
+}
diff --git a/ext/opcache/tests/jit/gh12723-A.phpt b/ext/opcache/tests/jit/gh12723-A.phpt
index f30453e8c0a3..d0350dca3ae2 100644
--- a/ext/opcache/tests/jit/gh12723-A.phpt
+++ b/ext/opcache/tests/jit/gh12723-A.phpt
@@ -12,9 +12,9 @@ $dimension = [];
try {
var_dump($container[$dimension]);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot access offset of type array on string
+TypeError: Cannot access offset of type array on string
diff --git a/ext/opcache/tests/jit/gh12723-B.phpt b/ext/opcache/tests/jit/gh12723-B.phpt
index 9f5ae7a19ff1..7018e24b156d 100644
--- a/ext/opcache/tests/jit/gh12723-B.phpt
+++ b/ext/opcache/tests/jit/gh12723-B.phpt
@@ -11,9 +11,9 @@ $container = new stdClass();
try {
$container[new stdClass()] .= 'append';
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Cannot use object of type stdClass as array
+Error: Cannot use object of type stdClass as array
diff --git a/ext/opcache/tests/jit/gh12747.phpt b/ext/opcache/tests/jit/gh12747.phpt
index df0b039cebc0..1229b7829145 100644
--- a/ext/opcache/tests/jit/gh12747.phpt
+++ b/ext/opcache/tests/jit/gh12747.phpt
@@ -11,25 +11,25 @@ try {
echo "isset():\n";
var_dump(isset($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "empty():\n";
var_dump(empty($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "Coalesce():\n";
var_dump($container[new stdClass()] ?? 'default');
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
isset():
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
empty():
-Cannot access offset of type stdClass in isset or empty
+TypeError: Cannot access offset of type stdClass in isset or empty
Coalesce():
-Cannot access offset of type stdClass on array
+TypeError: Cannot access offset of type stdClass on array
diff --git a/ext/opcache/tests/jit/gh12748.phpt b/ext/opcache/tests/jit/gh12748.phpt
index d7580fdb9ab7..3b309e25745b 100644
--- a/ext/opcache/tests/jit/gh12748.phpt
+++ b/ext/opcache/tests/jit/gh12748.phpt
@@ -11,19 +11,19 @@ try {
echo "isset():\n";
var_dump(isset($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "empty():\n";
var_dump(empty($container[new stdClass()]));
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
echo "Coalesce():\n";
var_dump($container[new stdClass()] ?? 'default');
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -32,4 +32,4 @@ bool(false)
empty():
bool(true)
Coalesce():
-Cannot access offset of type stdClass on string
+TypeError: Cannot access offset of type stdClass on string
diff --git a/ext/opcache/tests/jit/gh12812.phpt b/ext/opcache/tests/jit/gh12812.phpt
index 267abf2aae06..faa6433ce263 100644
--- a/ext/opcache/tests/jit/gh12812.phpt
+++ b/ext/opcache/tests/jit/gh12812.phpt
@@ -12,12 +12,12 @@ $dimension = '7';
try {
var_dump($container['7']);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump($container[$dimension]);
} catch (\Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
diff --git a/ext/opcache/tests/jit/gh13772.phpt b/ext/opcache/tests/jit/gh13772.phpt
index 97fa6536e0ce..172d2e535b7e 100644
--- a/ext/opcache/tests/jit/gh13772.phpt
+++ b/ext/opcache/tests/jit/gh13772.phpt
@@ -23,4 +23,3 @@ var_dump(Ack(3, 3));
?>
--EXPECT--
int(61)
-
diff --git a/ext/opcache/tests/jit/gh15652.phpt b/ext/opcache/tests/jit/gh15652.phpt
index 2220c7550a66..82762a7138cb 100644
--- a/ext/opcache/tests/jit/gh15652.phpt
+++ b/ext/opcache/tests/jit/gh15652.phpt
@@ -43,4 +43,4 @@ bool(true)
Warning: Undefined property: C2::$value in %sgh15652.php on line 6
Warning: Undefined property: C2::$value in %sgh15652.php on line 6
-bool(true)
\ No newline at end of file
+bool(true)
diff --git a/ext/opcache/tests/jit/gh16499.phpt b/ext/opcache/tests/jit/gh16499.phpt
index 6aec1012ab5e..0dad8349a157 100644
--- a/ext/opcache/tests/jit/gh16499.phpt
+++ b/ext/opcache/tests/jit/gh16499.phpt
@@ -25,4 +25,4 @@ NULL
Warning: Undefined variable $i in %sgh16499.php on line 6
Warning: Undefined variable $i in %sgh16499.php on line 6
-NULL
\ No newline at end of file
+NULL
diff --git a/ext/opcache/tests/jit/gh8863.phpt b/ext/opcache/tests/jit/gh8863.phpt
index 0d8e833c5faa..dc52e4d73c1f 100644
--- a/ext/opcache/tests/jit/gh8863.phpt
+++ b/ext/opcache/tests/jit/gh8863.phpt
@@ -22,11 +22,11 @@ class Test {
$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 3ffefe2ce29b..f8667fbae8ce 100644
--- a/ext/opcache/tests/jit/gh9011.phpt
+++ b/ext/opcache/tests/jit/gh9011.phpt
@@ -24,4 +24,4 @@ foreach ($foo as $baz) {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/inc_020.phpt b/ext/opcache/tests/jit/inc_020.phpt
index 9c0c2472acf4..99610f1d3b4d 100644
--- a/ext/opcache/tests/jit/inc_020.phpt
+++ b/ext/opcache/tests/jit/inc_020.phpt
@@ -24,4 +24,4 @@ function foo($row) {
?>
OK
--EXPECT--
-OK
\ No newline at end of file
+OK
diff --git a/ext/opcache/tests/jit/inc_obj_003.phpt b/ext/opcache/tests/jit/inc_obj_003.phpt
index dfa556cfe26f..77dd2d42e311 100644
--- a/ext/opcache/tests/jit/inc_obj_003.phpt
+++ b/ext/opcache/tests/jit/inc_obj_003.phpt
@@ -16,4 +16,4 @@ $v = --$test->prop;
var_dump($v);
?>
--EXPECT--
-float(0)
\ No newline at end of file
+float(0)
diff --git a/ext/opcache/tests/jit/inc_obj_006.phpt b/ext/opcache/tests/jit/inc_obj_006.phpt
index af31d0c471c2..1bdae45fa16e 100644
--- a/ext/opcache/tests/jit/inc_obj_006.phpt
+++ b/ext/opcache/tests/jit/inc_obj_006.phpt
@@ -27,4 +27,3 @@ Fatal error: Uncaught Error: Attempt to increment/decrement property "y" on int
Stack trace:
#0 {main}
thrown in %sinc_obj_006.php on line 14
-
diff --git a/ext/opcache/tests/jit/init_fcall_001.phpt b/ext/opcache/tests/jit/init_fcall_001.phpt
index fae4af53179f..19959a235d05 100644
--- a/ext/opcache/tests/jit/init_fcall_001.phpt
+++ b/ext/opcache/tests/jit/init_fcall_001.phpt
@@ -18,4 +18,3 @@ Stack trace:
#0 %sinit_fcall_001.php(5): ini_set()
#1 {main}
thrown in %sinit_fcall_001.php on line 5
-
diff --git a/ext/opcache/tests/jit/isset_002.phpt b/ext/opcache/tests/jit/isset_002.phpt
index 2c2527fbe7b9..41f1b6e39a85 100644
--- a/ext/opcache/tests/jit/isset_002.phpt
+++ b/ext/opcache/tests/jit/isset_002.phpt
@@ -29,4 +29,4 @@ DONE
Warning: Undefined variable $how in %sisset_002.php on line 3
Warning: foreach() argument must be of type array|object, null given in %sisset_002.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/match_001.phpt b/ext/opcache/tests/jit/match_001.phpt
index b21c5b2c1720..86d9cf9ff514 100644
--- a/ext/opcache/tests/jit/match_001.phpt
+++ b/ext/opcache/tests/jit/match_001.phpt
@@ -18,4 +18,4 @@ Fatal error: Uncaught UnhandledMatchError: Unhandled match case NULL in %smatch_
Stack trace:
#0 %smatch_001.php(5): foo()
#1 {main}
- thrown in %smatch_001.php on line 3
\ No newline at end of file
+ thrown in %smatch_001.php on line 3
diff --git a/ext/opcache/tests/jit/mod_001.phpt b/ext/opcache/tests/jit/mod_001.phpt
index 03431fe54eb4..c01be5536b6e 100644
--- a/ext/opcache/tests/jit/mod_001.phpt
+++ b/ext/opcache/tests/jit/mod_001.phpt
@@ -21,12 +21,12 @@ var_dump(mod(-125, -33));
try {
var_dump(mod(125, -1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(mod(125, 0));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -37,4 +37,4 @@ int(-29)
int(26)
int(-26)
int(0)
-Exception (DivisionByZeroError): Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/jit/mod_002.phpt b/ext/opcache/tests/jit/mod_002.phpt
index b1d163b94d5f..a19d8c41ac38 100644
--- a/ext/opcache/tests/jit/mod_002.phpt
+++ b/ext/opcache/tests/jit/mod_002.phpt
@@ -33,12 +33,12 @@ var_dump(modNeg33(-125));
try {
var_dump(modNeg1(125));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(mod0(125));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -49,4 +49,4 @@ int(-29)
int(26)
int(-26)
int(0)
-Exception (DivisionByZeroError): Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/jit/mod_004.phpt b/ext/opcache/tests/jit/mod_004.phpt
index 73cf1a92c47a..b8905ae8c6db 100644
--- a/ext/opcache/tests/jit/mod_004.phpt
+++ b/ext/opcache/tests/jit/mod_004.phpt
@@ -17,4 +17,4 @@ Warning: Undefined array key "xy" in %smod_004.php on line 4
Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smod_004.php:4
Stack trace:
#0 {main}
- thrown in %smod_004.php on line 4
\ No newline at end of file
+ thrown in %smod_004.php on line 4
diff --git a/ext/opcache/tests/jit/mod_006.phpt b/ext/opcache/tests/jit/mod_006.phpt
index 6409cd3253ad..b9abbd8e98ad 100644
--- a/ext/opcache/tests/jit/mod_006.phpt
+++ b/ext/opcache/tests/jit/mod_006.phpt
@@ -15,4 +15,4 @@ function foo(){
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mod_007.phpt b/ext/opcache/tests/jit/mod_007.phpt
index 1d76d34fe436..add360e9f3a7 100644
--- a/ext/opcache/tests/jit/mod_007.phpt
+++ b/ext/opcache/tests/jit/mod_007.phpt
@@ -19,4 +19,4 @@ Fatal error: Uncaught DivisionByZeroError: Modulo by zero in %smod_007.php:4
Stack trace:
#0 %smod_007.php(7): test(NULL)
#1 {main}
- thrown in %smod_007.php on line 4
\ No newline at end of file
+ thrown in %smod_007.php on line 4
diff --git a/ext/opcache/tests/jit/mul_003.phpt b/ext/opcache/tests/jit/mul_003.phpt
index d57534d9b3fc..08f0b4cdd760 100644
--- a/ext/opcache/tests/jit/mul_003.phpt
+++ b/ext/opcache/tests/jit/mul_003.phpt
@@ -29,4 +29,4 @@ mul1_bound(3);
?>
--EXPECT--
int(-6442450944)
-int(-6442450944)
\ No newline at end of file
+int(-6442450944)
diff --git a/ext/opcache/tests/jit/mul_005.phpt b/ext/opcache/tests/jit/mul_005.phpt
index 7476d215f130..9d475bf5e4ea 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 a36bdec41b0e..0dd03fc9dc2a 100644
--- a/ext/opcache/tests/jit/mul_006.phpt
+++ b/ext/opcache/tests/jit/mul_006.phpt
@@ -15,4 +15,4 @@ for ($i = 0; $i<6; $i++) {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mul_007.phpt b/ext/opcache/tests/jit/mul_007.phpt
index 71eb4d4009ca..e4a652de183b 100644
--- a/ext/opcache/tests/jit/mul_007.phpt
+++ b/ext/opcache/tests/jit/mul_007.phpt
@@ -17,4 +17,4 @@ DONE
Deprecated: Implicit conversion from float 1.5 to int loses precision in %smul_007.php on line 3
Deprecated: Implicit conversion from float 0.5 to int loses precision in %smul_007.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/mul_009.phpt b/ext/opcache/tests/jit/mul_009.phpt
index a6016bd535e7..4f3207d2735e 100644
--- a/ext/opcache/tests/jit/mul_009.phpt
+++ b/ext/opcache/tests/jit/mul_009.phpt
@@ -16,4 +16,4 @@ Warning: Undefined variable $y in %smul_009.php on line 3
Fatal error: Uncaught TypeError: Unsupported operand types: array * int in %smul_009.php:3
Stack trace:
#0 {main}
- thrown in %smul_009.php on line 3
\ No newline at end of file
+ thrown in %smul_009.php on line 3
diff --git a/ext/opcache/tests/jit/mul_010.phpt b/ext/opcache/tests/jit/mul_010.phpt
index 6c94f8164487..49422a20ff7f 100644
--- a/ext/opcache/tests/jit/mul_010.phpt
+++ b/ext/opcache/tests/jit/mul_010.phpt
@@ -25,8 +25,8 @@ function test() {
try {
@test();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
-Unsupported operand types: string * float
+TypeError: Unsupported operand types: string * float
diff --git a/ext/opcache/tests/jit/noval_001.phpt b/ext/opcache/tests/jit/noval_001.phpt
index 0fef38652bf4..c09325604940 100644
--- a/ext/opcache/tests/jit/noval_001.phpt
+++ b/ext/opcache/tests/jit/noval_001.phpt
@@ -31,4 +31,3 @@ var_dump(Foo::bar());
?>
--EXPECT--
string(2) "ok"
-
diff --git a/ext/opcache/tests/jit/qm_assign_001.phpt b/ext/opcache/tests/jit/qm_assign_001.phpt
index ecfda50a28c0..3c89b5360bb4 100644
--- a/ext/opcache/tests/jit/qm_assign_001.phpt
+++ b/ext/opcache/tests/jit/qm_assign_001.phpt
@@ -13,4 +13,3 @@ Deprecated: Implicit conversion from float 1.5 to int loses precision in %sqm_as
Deprecated: Implicit conversion from float 1.5 to int loses precision in %sqm_assign_001.php on line 2
-1
-
diff --git a/ext/opcache/tests/jit/qm_assign_002.phpt b/ext/opcache/tests/jit/qm_assign_002.phpt
index 8f6328d81dde..2a12942dc44f 100644
--- a/ext/opcache/tests/jit/qm_assign_002.phpt
+++ b/ext/opcache/tests/jit/qm_assign_002.phpt
@@ -25,4 +25,4 @@ Warning: Undefined variable $b in %sqm_assign_002.php on line 5
Warning: Undefined variable $a in %sqm_assign_002.php on line 4
Warning: Array to string conversion in %sqm_assign_002.php on line 5
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/qm_assign_003.phpt b/ext/opcache/tests/jit/qm_assign_003.phpt
index cb62c5425c79..c9c8b126cbd8 100644
--- a/ext/opcache/tests/jit/qm_assign_003.phpt
+++ b/ext/opcache/tests/jit/qm_assign_003.phpt
@@ -22,4 +22,4 @@ function foo() {
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/qm_assign_undef_exception.phpt b/ext/opcache/tests/jit/qm_assign_undef_exception.phpt
index 4e93e2ed7e56..4c2c513141f9 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 84043ca03d5d..d135f53362f8 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 30999dc278d1..016935f94cba 100644
--- a/ext/opcache/tests/jit/recv_002.phpt
+++ b/ext/opcache/tests/jit/recv_002.phpt
@@ -23,4 +23,4 @@ Fatal error: Uncaught ArgumentCountError: Too few arguments to function test(),
Stack trace:
#0 %s(7): test()
#1 {main}
- thrown in %s on line 3
\ No newline at end of file
+ thrown in %s on line 3
diff --git a/ext/opcache/tests/jit/reg_alloc_005.phpt b/ext/opcache/tests/jit/reg_alloc_005.phpt
index f46d0f64e745..3d4d15b896e0 100644
--- a/ext/opcache/tests/jit/reg_alloc_005.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_005.phpt
@@ -18,4 +18,4 @@ test();
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_006.phpt b/ext/opcache/tests/jit/reg_alloc_006.phpt
index fa7777a12d83..411a614c7782 100644
--- a/ext/opcache/tests/jit/reg_alloc_006.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_006.phpt
@@ -30,4 +30,4 @@ Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
Warning: Undefined variable $y in %sreg_alloc_006.php on line 5
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_010.phpt b/ext/opcache/tests/jit/reg_alloc_010.phpt
index 4dd92d43dfad..02b685f5879c 100644
--- a/ext/opcache/tests/jit/reg_alloc_010.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_010.phpt
@@ -20,4 +20,4 @@ DONE
Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3
Warning: Undefined variable $cnt in %sreg_alloc_010.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_011.phpt b/ext/opcache/tests/jit/reg_alloc_011.phpt
index 521a827cc1f0..8d61ac2047a1 100644
--- a/ext/opcache/tests/jit/reg_alloc_011.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_011.phpt
@@ -21,4 +21,4 @@ foo(null);
?>
DONE
--EXPECTF--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_012.phpt b/ext/opcache/tests/jit/reg_alloc_012.phpt
index b684011fbf16..d9d208203379 100644
--- a/ext/opcache/tests/jit/reg_alloc_012.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_012.phpt
@@ -18,4 +18,4 @@ for ($i = 0; $i < 3; $i++) {
?>
DONE
--EXPECTF--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_013.phpt b/ext/opcache/tests/jit/reg_alloc_013.phpt
index 73bd3abb6566..cba21193a84d 100644
--- a/ext/opcache/tests/jit/reg_alloc_013.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_013.phpt
@@ -15,4 +15,4 @@ foo();
DONE
--EXPECTF--
Warning: Undefined variable $j in %sreg_alloc_013.php on line 3
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/reg_alloc_022.phpt b/ext/opcache/tests/jit/reg_alloc_022.phpt
index fc9a0b29dff4..80f720627bcf 100644
--- a/ext/opcache/tests/jit/reg_alloc_022.phpt
+++ b/ext/opcache/tests/jit/reg_alloc_022.phpt
@@ -22,4 +22,4 @@ test();
?>
DONE
--EXPECT--
-DONE
\ No newline at end of file
+DONE
diff --git a/ext/opcache/tests/jit/shift_left_001.phpt b/ext/opcache/tests/jit/shift_left_001.phpt
index 5b0cbf927caf..c5f0421e780a 100644
--- a/ext/opcache/tests/jit/shift_left_001.phpt
+++ b/ext/opcache/tests/jit/shift_left_001.phpt
@@ -19,12 +19,12 @@ var_dump(shl(-1, 2));
try {
var_dump(shl(1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shl(1, -1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -33,4 +33,4 @@ int(2)
int(4)
int(-4)
int(0)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_left_002.phpt b/ext/opcache/tests/jit/shift_left_002.phpt
index 979aaf96b0bd..5bdbf8bd745e 100644
--- a/ext/opcache/tests/jit/shift_left_002.phpt
+++ b/ext/opcache/tests/jit/shift_left_002.phpt
@@ -31,12 +31,12 @@ var_dump(shl2(-1));
try {
var_dump(shl64(1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shlNEG(1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -45,4 +45,4 @@ int(2)
int(4)
int(-4)
int(0)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_right_001.phpt b/ext/opcache/tests/jit/shift_right_001.phpt
index 454e8a120449..c1ddb627b284 100644
--- a/ext/opcache/tests/jit/shift_right_001.phpt
+++ b/ext/opcache/tests/jit/shift_right_001.phpt
@@ -19,17 +19,17 @@ var_dump(shr(-8, 2));
try {
var_dump(shr(1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr(-1, 64));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr(1, -1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -39,4 +39,4 @@ int(64)
int(-2)
int(0)
int(-1)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/shift_right_002.phpt b/ext/opcache/tests/jit/shift_right_002.phpt
index c7d6d227774c..0dea5171512a 100644
--- a/ext/opcache/tests/jit/shift_right_002.phpt
+++ b/ext/opcache/tests/jit/shift_right_002.phpt
@@ -31,17 +31,17 @@ var_dump(shr2(-8));
try {
var_dump(shr64(1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shr64(-1));
} catch (Throwable $e) {
- echo "Exception " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
try {
var_dump(shrNEG(1));
} catch (Throwable $e) {
- echo "Exception (" . get_class($e) . "): " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
@@ -51,4 +51,4 @@ int(64)
int(-2)
int(0)
int(-1)
-Exception (ArithmeticError): Bit shift by negative number
+ArithmeticError: Bit shift by negative number
diff --git a/ext/opcache/tests/jit/type_check_001.phpt b/ext/opcache/tests/jit/type_check_001.phpt
index 028d2e8637e2..b498fda998dc 100644
--- a/ext/opcache/tests/jit/type_check_001.phpt
+++ b/ext/opcache/tests/jit/type_check_001.phpt
@@ -16,8 +16,8 @@ try {
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 c1308e249a92..dc6e75797d86 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 fb07ee42505d..db46ec2dfff8 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 1be5b21305b4..b1a86548877f 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 50b0076c4011..ad61adc47c4f 100644
--- a/ext/opcache/tests/method_call_on_literal.phpt
+++ b/ext/opcache/tests/method_call_on_literal.phpt
@@ -7,10 +7,10 @@ opcache
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 c3a05d22e7a1..e118df2cc625 100644
--- a/ext/opcache/tests/opt/coalesce_002.phpt
+++ b/ext/opcache/tests/opt/coalesce_002.phpt
@@ -19,4 +19,4 @@ Stack trace:
#0 %scoalesce_002.php(3): var_dump()
#1 %scoalesce_002.php(5): t()
#2 {main}
- thrown in %scoalesce_002.php on line 3
\ No newline at end of file
+ thrown in %scoalesce_002.php on line 3
diff --git a/ext/opcache/tests/opt/gh19792.phpt b/ext/opcache/tests/opt/gh19792.phpt
index edd805ca57a1..69987d7590de 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 046396f21253..b4e585968253 100644
--- a/ext/opcache/tests/opt/inference_003.phpt
+++ b/ext/opcache/tests/opt/inference_003.phpt
@@ -17,4 +17,3 @@ Fatal error: Uncaught Error: Interface "I" not found in %sinference_003.php:2
Stack trace:
#0 {main}
thrown in %sinference_003.php on line 2
-
diff --git a/ext/opcache/tests/opt/inference_016.phpt b/ext/opcache/tests/opt/inference_016.phpt
index 7d1733934fb6..5b8b8a3334cb 100644
--- a/ext/opcache/tests/opt/inference_016.phpt
+++ b/ext/opcache/tests/opt/inference_016.phpt
@@ -15,11 +15,11 @@ function test() {
try {
test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECTF--
NULL
Warning: Decrement on type null has no effect, this will change in the next major version of PHP in %sinference_016.php on line %d
-Modulo by zero
+DivisionByZeroError: Modulo by zero
diff --git a/ext/opcache/tests/opt/inference_017.phpt b/ext/opcache/tests/opt/inference_017.phpt
index 2c9255e3b2b4..00f26bd682a6 100644
--- a/ext/opcache/tests/opt/inference_017.phpt
+++ b/ext/opcache/tests/opt/inference_017.phpt
@@ -14,8 +14,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/opcache/tests/opt/inference_018.phpt b/ext/opcache/tests/opt/inference_018.phpt
index 123cb3b9eb62..f865913d01b4 100644
--- a/ext/opcache/tests/opt/inference_018.phpt
+++ b/ext/opcache/tests/opt/inference_018.phpt
@@ -16,8 +16,8 @@ function test() {
try {
@test();
} catch (Throwable $e) {
- echo $e->getMessage(), "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
--EXPECT--
-Division by zero
+DivisionByZeroError: Division by zero
diff --git a/ext/opcache/tests/opt/tmp_001.phpt b/ext/opcache/tests/opt/tmp_001.phpt
index 83b679f5f76f..3b1e67e006ff 100644
--- a/ext/opcache/tests/opt/tmp_001.phpt
+++ b/ext/opcache/tests/opt/tmp_001.phpt
@@ -15,4 +15,4 @@ Fatal error: Uncaught ArgumentCountError: is_a() expects at least 2 arguments, 1
Stack trace:
#0 %stmp_001.php(2): is_a(0)
#1 {main}
- thrown in %stmp_001.php on line 2
\ No newline at end of file
+ thrown in %stmp_001.php on line 2
diff --git a/ext/opcache/tests/optimize_static_001.phpt b/ext/opcache/tests/optimize_static_001.phpt
index a71f029b3302..894d9f0d8c2e 100644
--- a/ext/opcache/tests/optimize_static_001.phpt
+++ b/ext/opcache/tests/optimize_static_001.phpt
@@ -14,10 +14,10 @@ function foo() {
try {
foo();
} catch (Throwable $e) {
- echo "Exception: " . $e->getMessage() . "\n";
+ echo $e::class, ': ', $e->getMessage(), "\n";
}
?>
OK
--EXPECT--
-Exception: Undefined constant "UNDEFINED_CONST"
+Error: Undefined constant "UNDEFINED_CONST"
OK
diff --git a/ext/opcache/tests/preload_004.phpt b/ext/opcache/tests/preload_004.phpt
index 76047bde6222..fee4eb682146 100644
--- a/ext/opcache/tests/preload_004.phpt
+++ b/ext/opcache/tests/preload_004.phpt
@@ -17,9 +17,9 @@ var_dump(class_exists('Foo'));
try {
new Foo();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-Undefined constant self::DOES_NOT_EXIST
+Error: Undefined constant self::DOES_NOT_EXIST
diff --git a/ext/opcache/tests/preload_009.phpt b/ext/opcache/tests/preload_009.phpt
index bb15998f7ab0..71702922bea3 100644
--- a/ext/opcache/tests/preload_009.phpt
+++ b/ext/opcache/tests/preload_009.phpt
@@ -18,10 +18,10 @@ var_dump(class_exists('Foo'));
try {
new Foo();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
bool(true)
-Undefined constant "UNDEF"
+Error: Undefined constant "UNDEF"
diff --git a/ext/opcache/tests/preload_012.phpt b/ext/opcache/tests/preload_012.phpt
index 836d4707a0d9..b23876666cbe 100644
--- a/ext/opcache/tests/preload_012.phpt
+++ b/ext/opcache/tests/preload_012.phpt
@@ -19,9 +19,9 @@ var_dump(class_exists('Test'));
try {
new Test();
} catch (Throwable $ex) {
- echo $ex->getMessage() . "\n";
+ echo $ex::class, ': ', $ex->getMessage(), "\n";
}
?>
--EXPECT--
bool(true)
-Undefined constant Foo::BAR
+Error: Undefined constant Foo::BAR
diff --git a/ext/opcache/tests/ssa_bug_003.phpt b/ext/opcache/tests/ssa_bug_003.phpt
index 780a02955786..95de8b40290b 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