Created
November 14, 2020 06:52
-
-
Save shin1x1/b05e91b412806ae71b9ed61f4275e5b6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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