blob: 53588600bd7ce7190184e774584ae3897a6a7abb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
--TEST--
Test string 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 %s030.php:4
Stack trace:
#0 %s030.php(7): {closure}(%d, 'Undefined varia...', '%s', %d)
#1 {main}
thrown in %s030.php on line 4
|