Tutorial by Examples

If it's not already done in php.ini, error reporting can be set dynamically and should be set to allow most errors to be shown: Syntax int error_reporting ([ int $level ] ) Examples // should always be used prior to 5.4 error_reporting(E_ALL); // -1 will show every possible error, even whe...
try/catch try..catch blocks can be used to control the flow of a program where Exceptions may be thrown. They can be caught and handled gracefully rather than letting PHP stop when one is encountered: try { // Do a bunch of things... throw new Exception('My test exception!'); } catch (E...
In PHP, a fatal error is a kind of error that cannot be caught, that is, after experiencing a fatal error a program does not resume. However, to log this error or somehow handle the crash you can use register_shutdown_function to register shutdown handler. function fatalErrorHandler() { // Let...

Page 1 of 1