Skip to content

Instantly share code, notes, and snippets.

@shin1x1
Created November 14, 2020 06:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shin1x1/b05e91b412806ae71b9ed61f4275e5b6 to your computer and use it in GitHub Desktop.
Save shin1x1/b05e91b412806ae71b9ed61f4275e5b6 to your computer and use it in GitHub Desktop.
<?php
declare(strict_types=1);
for ($i = 0 ; $i < 4 ; $i++) {
try {
$no = match ($i) {
0 => '0',
1 => throw new RuntimeException(),
// 2 => continue, Parse error: syntax error, unexpected token "continue"
default => 'default',
};
var_dump($no);
} catch (Throwable $e) {
// nop
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment