T
T
tushev2014-09-20 13:40:38
PHP
tushev, 2014-09-20 13:40:38

What's the best way to report PHP errors when using xdebug and netbeans?

I use xdebug and NetBeans for PHP development. The most popular way to handle PHP errors and warnings is to write them to a stream, or write them to a log file. It is not aesthetically pleasing to output them to the stream, and it is not always possible to see them on the page if the output occurred in an invisible area or in AJAX. It is also not always possible to notice the appearance of an error in the log file, except to constantly look at the terminal window where "tail -f php_error.log" is run.
Is there any convenient way so that when a PHP error occurs, I automatically open the source and mark the location of the error?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexey, 2014-09-24
@rdifb0

Design in such a way that there are no errors at all, and each error interrupts execution.
Then don't miss it :)
Practically it means to set error_reporting to E_ALL and register an error handler set_error_handler to throw exceptions (there is a great built-in exception ErrorException)/
According to the last paragraph, something like filp.github.io/whoops might suit you

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question