Created
December 13, 2025 13:57
-
-
Save abenevaut/7dad00cc6eb50e254d18ba58df6a2903 to your computer and use it in GitHub Desktop.
`php main.php`
This file contains hidden or 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
| #!/usr/bin/env php | |
| <?php | |
| function main(): int | |
| { | |
| try { | |
| // do stuff | |
| } | |
| catch (\Throwable $exception) { | |
| echo $exception->getMessage() . PHP_EOL; | |
| return 1; | |
| } | |
| return 0; | |
| } | |
| if (php_sapi_name() === 'cli') { | |
| exit(main()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment