Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on PHP finally gets finally. Parent comment
http://php.net/manual/en/function.set-error-handler.php
along with a function that throws exceptions, e.g.:
function exception_on_error($errnum,$errmsg) { throw new ErrorException($errmsg,$errnum); }
You can't catch all errors (sensibly including compile errors and unhandled exception errors), but it can get you pretty far.
Not that there aren't other reasons not to use PHP, but this one is manageable.
There are no comments on this comment yet.
http://php.net/manual/en/function.set-error-handler.php
along with a function that throws exceptions, e.g.:
function exception_on_error($errnum,$errmsg) { throw new ErrorException($errmsg,$errnum); }
You can't catch all errors (sensibly including compile errors and unhandled exception errors), but it can get you pretty far.
Not that there aren't other reasons not to use PHP, but this one is manageable.