xref: /php-src/ext/opcache/tests/jit/match_001.phpt (revision c16ad918)
1--TEST--
2Match with undefined input
3--INI--
4opcache.enable=1
5opcache.enable_cli=1
6opcache.file_update_protection=0
7--FILE--
8<?php
9function foo() {
10    return match($y){1,6=>0};
11}
12foo();
13?>
14--EXPECTF--
15Warning: Undefined variable $y in %smatch_001.php on line 3
16
17Fatal error: Uncaught UnhandledMatchError: Unhandled match case NULL in %smatch_001.php:3
18Stack trace:
19#0 %smatch_001.php(5): foo()
20#1 {main}
21  thrown in %smatch_001.php on line 3