xref: /PHP-8.4/Zend/tests/match/042.phpt (revision 9fa1d133)
1--TEST--
2Match expression with undefined variable as expression
3--FILE--
4<?php
5
6var_dump(match ($undefinedVariable) {
7    null => 'null',
8    default => 'default',
9});
10
11var_dump(match ($undefinedVariable) {
12    1, 2, 3, 4, 5 => 'foo',
13    default => 'bar',
14});
15
16?>
17--EXPECTF--
18Warning: Undefined variable $undefinedVariable in %s.php on line 3
19string(4) "null"
20
21Warning: Undefined variable $undefinedVariable in %s.php on line 8
22string(3) "bar"
23