On Thu, Feb 21, 2013 at 11:19 AM, Timothy Madden <terminato...@gmail.com> wrote: > Is there a way in Zend that allows me to turn php warnings and notices into > exceptions ? > > In my application an undefined array index or a foreach() statement that > tries to iterate a NULL variable is clearly an application error, not a > notice or warning. > > Is there a way for the Zend Framework to do the equivalent of: > > function exception_error_handler($errno, $errstr, $errfile, $errline ) { > throw new ErrorException($errstr, $errno, 0, $errfile, $errline); > } > set_error_handler("exception_error_handler");
As Marco pointed out, Zend\Stdlib\ErrorHandler. Additionally, you can use Zend\Log\Logger's registerErrorHandler() and registerExceptionHandler() methods. -- Matthew Weier O'Phinney Project Lead | matt...@zend.com Zend Framework | http://framework.zend.com/ PGP key: http://framework.zend.com/zf-matthew-pgp-key.asc -- List: fw-general@lists.zend.com Info: http://framework.zend.com/archives Unsubscribe: fw-general-unsubscr...@lists.zend.com