a PHP error reporting library I've built to finally give pretty errors


Recommended Posts

About a month ago I finally decided to look into wrapping PHP error reporting, to display better errors, and this is the result. PHP Error gives you prettier output, making it easier to 'get' an error in less time. This includes a fully syntax highlighted stack trace, code snippets, improved error messages, and it replaces the output so they aren't hidden behind any HTML or off screen.

What is really special is that it also works with ajax too. When an error strikes, your JS callback is put on hold, and the stack trace is displayed within the page. This allows you to fit the error, and then hit retry, without a page refresh. This feature requires no changes to your JS code, browser extensions, or anything like that. It just works out of the box.

It's also built with deployment in mind, or more how to avoid deploying it. It's simple to integrate (just two lines of code), so you don't need to tie your project to it. You can also run via php.ini, allowing you to keep it entirely out of your projects. Instructions on how to do this are provided on it's GitHub repository.

It can also be globally disabled through php.ini, in case you do accidentally deploy to production, and will only run if 'display_errors' is on anyway.

I've found this very useful on my own sites, especially when I hit an error which isn't related to what I'm working on. I get some insight when it's reported, allowing me to find and fix it slightly sooner.

I others find it as useful as I have.

Link to comment
Share on other sites

wow, works really well.

1. Simple to use.

2. Great syntax highlighting.

3. More than enough info to fix.

By far best error reporting I've used.

Link to comment
Share on other sites

Thanks Stevember, I'm glad you like it.

In CLI mode, it currently just goes silent, and gives you the standard PHP output. This is so you don't get tonnes of HTML blasted at you over the command line.

Link to comment
Share on other sites

You deserve a cookie for this.

I have no use for it myself (being an ASP coder) but this is still great work >.<

Link to comment
Share on other sites

One of the reasons I put it as it's own site was to have the possibility of putting an ad on there. So I might definitely put one on now, or a donation button.

Link to comment
Share on other sites

This topic is now closed to further replies.