mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
RFC: https://wiki.php.net/rfc/deprecations_php_8_4#remove_e_strict_error_level_and_deprecate_e_strict_constant Closes GH-13053
35 lines
505 B
PHP
35 lines
505 B
PHP
--TEST--
|
|
throw expression should not leak temporaries
|
|
--FILE--
|
|
<?php
|
|
|
|
try {
|
|
new stdClass(throw new Exception);
|
|
} catch (Exception $e) {
|
|
echo "Caught\n";
|
|
}
|
|
|
|
try {
|
|
$a = [];
|
|
($a + [1]) + throw new Exception;
|
|
} catch (Exception $e) {
|
|
echo "Caught\n";
|
|
}
|
|
|
|
try {
|
|
@throw new Exception;
|
|
} catch (Exception $e) {
|
|
echo "Caught\n";
|
|
}
|
|
var_dump(error_reporting());
|
|
|
|
// Exit also unwinds and thus has the same basic problem.
|
|
new stdClass(exit);
|
|
|
|
?>
|
|
--EXPECT--
|
|
Caught
|
|
Caught
|
|
Caught
|
|
int(30719)
|