diff options
author | Martijn Otto <martijn.otto@copernica.com> | 2016-05-11 17:34:40 +0200 |
---|---|---|
committer | Martijn Otto <martijn.otto@copernica.com> | 2016-05-11 17:34:40 +0200 |
commit | 9f2e816c787c30ceeb139623c8dae594c4b4443d (patch) | |
tree | e434ebd2ff37c98bdc5934120b48cda1bf3899c2 /zend/exception_handler.cpp | |
parent | 570590058d16274005a4994fd8f1046d0eaf7f74 (diff) |
Work in progress on PHP7 compatibility
Diffstat (limited to 'zend/exception_handler.cpp')
-rw-r--r-- | zend/exception_handler.cpp | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/zend/exception_handler.cpp b/zend/exception_handler.cpp index 75faef9..66034e2 100644 --- a/zend/exception_handler.cpp +++ b/zend/exception_handler.cpp @@ -31,16 +31,13 @@ Value set_exception_handler(const std::function<Value(Parameters ¶ms)> &hand Value output; // turn our user_exception_handler into a Value so we can return the original one later on - if (EG(user_exception_handler)) output = EG(user_exception_handler); + if (!Z_ISNULL(EG(user_exception_handler))) output = &EG(user_exception_handler); // detach so we have the zval auto value = functor.detach(true); - // allocate the user_exception_handler - ALLOC_ZVAL(EG(user_exception_handler)); - // copy our zval into the user_exception_handler - MAKE_COPY_ZVAL(&value, EG(user_exception_handler)); + ZVAL_COPY(value, &EG(user_exception_handler)); // return the original handler return output; @@ -61,16 +58,13 @@ Value set_error_handler(const std::function<Value(Parameters ¶ms)> &handler, Value output; // turn our user_error_handler into a Value if we have one, just so we can return it later on - if (EG(user_error_handler)) output = EG(user_error_handler); + if (!Z_ISNULL(EG(user_error_handler))) output = &EG(user_error_handler); // detach so we have the zval auto value = functor.detach(true); - // alocate the user_error_handler - ALLOC_ZVAL(EG(user_error_handler)); - // copy our zval into the user_error_handler - MAKE_COPY_ZVAL(&value, EG(user_error_handler)); + ZVAL_COPY(value, &EG(user_error_handler)); EG(user_error_handler_error_reporting) = (int) error; // return the original handler @@ -98,7 +92,7 @@ Value error_reporting(Error error) if (size < 0) return false; // alter the ini on the fly - zend_alter_ini_entry("error_reporting", sizeof("error_reporting"), str, size, ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); + zend_alter_ini_entry(zend_string_init("error_reporting", sizeof("error_reporting"), 1), zend_string_init(str, size, 1), ZEND_INI_USER, ZEND_INI_STAGE_RUNTIME); // return the output return output; |