Well I mean:  

Suppressing errors is basically always bad.

http://phpmaster.com/why-suppressing-notices-is-wrong/

Also, using exceptions for errors is not bad practice, its AMAZING practise. You do this in development only, and don't catch them hoping to avoid you doing stuff wrong, you use them to help you debug things considerably better with xdebug and/or Whoops-style add ons) and you DO NOT do this in production. If you do, you catch the generic ErrorException app-wide and shove up a generic error page. Again, thats all good practice.

So far you've suggested that @ is ok - its not - and ErrorException is bad - its not. Need to fix that before doing anything else.  

--  
Phil Sturgeon


On Friday, 12 July 2013 at 01:31, Aran Wilkinson wrote:

> In _posts/07-02-01-Errors.md (http://07-02-01-Errors.md):
> > +PHP Errors differ to Exceptions in that they, Errors can halt the execution of your script depending on the level of severity. Exceptions on the other hand can be caught using `try catch` statements. > + > +### Error Severity > + > +PHP's built in error reporting and logging, allows for different levels of reporting via the use of Predefined Constants. The three main constants are `E_ERROR`, `E_NOTICE`, and `E_WARNING`. > + > +The different levels of error severity have different meanings. The three most common types of messages are Errors, Notices and Warnings. Errors are fatal run-time Errors and are usually caused by faults in your code and need to be fixed as they'll cause execution to be halted. Warnings are non-fatal errors, execution of the script will continue and dependant on settings the user may or not may see the Warning message. Notices are advisory messages caused by code that may or may not cause problems during script execution, execution is not halted and again depending on settings the user may or not see the Notice message. > + > +Another type of Error Message reported at compile time are `E_STRICT` messages, these messages are used to suggest > +changes to your code to help ensure best interoperability and forward compatibility for your code. > + > +### Changing PHP's Error Reporting Behaviour > + > +Error Reporting can both be changed using PHP settings and PHP function calls. Using the built in PHP function `error_reporting()` you can set the level of errors for the duration of the script execution by passing one of the Predefined Constants. For more information on this relating to application environments check out the [Error Reporting][errorreport]. > + > +As well as setting the level of error reporting during script execution you can also suppress Errors using the Error Control Operator `@` by putting this operator at the beginning an expression.  
> Oh you actually wanted that Chuck Norris comment in there? lol
>  
> —
> Reply to this email directly or view it on GitHub (https://github.com/codeguy/php-the-right-way/pull/283/files#r5158902).
>  
>  
>