summaryrefslogtreecommitdiff
path: root/zend
diff options
context:
space:
mode:
authorToon Schoenmakers <toon.schoenmakers@copernica.com>2015-09-17 10:47:53 +0200
committerToon Schoenmakers <toon.schoenmakers@copernica.com>2015-09-17 10:47:53 +0200
commit448b1b873537bed4b616c284ba75ce9392f838a9 (patch)
tree54dd039d4581280451490fadc35580db7ec0b5ef /zend
parent2df547bfd3caf93d36b3775f3e748ad52f6e422b (diff)
Added support for passing the error types in the set_error_handler
Diffstat (limited to 'zend')
-rw-r--r--zend/exception_handler.cpp7
-rw-r--r--zend/includes.h1
2 files changed, 6 insertions, 2 deletions
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<Value(Parameters &params)> &hand
return output;
}
-Value set_error_handler(const std::function<Value(Parameters &params)> &handler)
+/**
+ * Set a std::function as a php error handler
+ */
+Value set_error_handler(const std::function<Value(Parameters &params)> &handler, Error error)
{
// create the functor which wraps our callback
Function functor(handler);
@@ -62,7 +65,7 @@ Value set_error_handler(const std::function<Value(Parameters &params)> &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;
diff --git a/zend/includes.h b/zend/includes.h
index aed5ed0..4d35cfd 100644
--- a/zend/includes.h
+++ b/zend/includes.h
@@ -57,6 +57,7 @@
#include "../include/fatalerror.h"
#include "../include/streams.h"
#include "../include/type.h"
+#include "../include/errors.h"
#include "../include/hashparent.h"
#include "../include/value.h"
#include "../include/valueiterator.h"