On 02/21/2013 08:58 PM, Matthew Weier O'Phinney wrote:
On Thu, Feb 21, 2013 at 11:19 AM, Timothy Madden <[email protected]> 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.
Thank you.
Is there a way to achieve the same result on Zend 1.12 ?
Timothy Madden
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]