mirror of
https://github.com/php/php-src.git
synced 2024-09-21 18:07:23 +00:00
24 lines
584 B
PHP
24 lines
584 B
PHP
--TEST--
|
|
Test long match with undefined variable
|
|
--FILE--
|
|
<?php
|
|
|
|
set_error_handler(function ($errno, $message) {
|
|
throw new Exception("Custom error handler: $message");
|
|
});
|
|
|
|
echo match ($undefVar) {
|
|
default => "This should not get printed with or without opcache\n",
|
|
1, 2, 3, 4, 5 => "Also should not be printed\n",
|
|
};
|
|
|
|
echo "unreachable\n";
|
|
|
|
?>
|
|
--EXPECTF--
|
|
Fatal error: Uncaught Exception: Custom error handler: Undefined variable $undefVar in %s029.php:4
|
|
Stack trace:
|
|
#0 %s029.php(7): {closure}(%d, 'Undefined varia...', '%s', %d)
|
|
#1 {main}
|
|
thrown in %s029.php on line 4
|