029.phpt 584 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Test long match with undefined variable
  3. --FILE--
  4. <?php
  5. set_error_handler(function ($errno, $message) {
  6. throw new Exception("Custom error handler: $message");
  7. });
  8. echo match ($undefVar) {
  9. default => "This should not get printed with or without opcache\n",
  10. 1, 2, 3, 4, 5 => "Also should not be printed\n",
  11. };
  12. echo "unreachable\n";
  13. ?>
  14. --EXPECTF--
  15. Fatal error: Uncaught Exception: Custom error handler: Undefined variable $undefVar in %s029.php:4
  16. Stack trace:
  17. #0 %s029.php(7): {closure}(%d, 'Undefined varia...', '%s', %d)
  18. #1 {main}
  19. thrown in %s029.php on line 4