How to Exit a PHP Script with an Exit Code
Every program ends with an exit code: 0 when it succeeded, anything else when it didn't. Shells, scripts and CI jobs read that number to decide what happens next. A PHP command-line script sets its own with exit(1).
