diff options
Diffstat (limited to 'Zend/tests/match/042.phpt')
-rw-r--r-- | Zend/tests/match/042.phpt | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/Zend/tests/match/042.phpt b/Zend/tests/match/042.phpt new file mode 100644 index 0000000000..6ea30dd376 --- /dev/null +++ b/Zend/tests/match/042.phpt @@ -0,0 +1,22 @@ +--TEST-- +Match expression with undefined variable as expression +--FILE-- +<?php + +var_dump(match ($undefinedVariable) { + null => 'null', + default => 'default', +}); + +var_dump(match ($undefinedVariable) { + 1, 2, 3, 4, 5 => 'foo', + default => 'bar', +}); + +?> +--EXPECTF-- +Warning: Undefined variable $undefinedVariable in %s.php on line 3 +string(4) "null" + +Warning: Undefined variable $undefinedVariable in %s.php on line 8 +string(3) "bar" |