From 448b1b873537bed4b616c284ba75ce9392f838a9 Mon Sep 17 00:00:00 2001 From: Toon Schoenmakers Date: Thu, 17 Sep 2015 10:47:53 +0200 Subject: Added support for passing the error types in the set_error_handler --- zend/exception_handler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'zend/exception_handler.cpp') diff --git a/zend/exception_handler.cpp b/zend/exception_handler.cpp index 75361b2..b864e78 100644 --- a/zend/exception_handler.cpp +++ b/zend/exception_handler.cpp @@ -43,7 +43,10 @@ Value set_exception_handler(const std::function &hand return output; } -Value set_error_handler(const std::function &handler) +/** + * Set a std::function as a php error handler + */ +Value set_error_handler(const std::function &handler, Error error) { // create the functor which wraps our callback Function functor(handler); @@ -62,7 +65,7 @@ Value set_error_handler(const std::function &handler) // copy our zval into the user_error_handler MAKE_COPY_ZVAL(&value, EG(user_error_handler)); - EG(user_error_handler_error_reporting) = (int) (E_ALL | E_STRICT); + EG(user_error_handler_error_reporting) = (int) error; // return the original handler return output; -- cgit v1.2.3