diff options
author | Aaron Piotrowski <aaron@trowski.com> | 2016-07-03 22:42:10 -0500 |
---|---|---|
committer | Aaron Piotrowski <aaron@trowski.com> | 2016-07-03 22:42:10 -0500 |
commit | d9a9cf8ecaef891b2369969e9efe9f6261359158 (patch) | |
tree | 04bcc83b3c9be1924007e007e1f508f7229af7ab /Zend/zend_builtin_functions.c | |
parent | 583386d59e6b362fe49e51594718a109d0c0cc2f (diff) | |
parent | c2b29a58bc0916e248ba2584564558097b16b51f (diff) | |
download | php-git-d9a9cf8ecaef891b2369969e9efe9f6261359158.tar.gz |
Merge branch 'master' into iterable
Diffstat (limited to 'Zend/zend_builtin_functions.c')
-rw-r--r-- | Zend/zend_builtin_functions.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c index 5ae536f425..c84a1f1bcd 100644 --- a/Zend/zend_builtin_functions.c +++ b/Zend/zend_builtin_functions.c @@ -767,7 +767,7 @@ ZEND_FUNCTION(each) Return the current error_reporting level, and if an argument was passed - change to the new level */ ZEND_FUNCTION(error_reporting) { - zval *err; + zval *err = NULL; int old_error_reporting; #ifndef FAST_ZPP @@ -2477,8 +2477,10 @@ ZEND_FUNCTION(debug_print_backtrace) if (object) { if (func->common.scope) { class_name = func->common.scope->name; - } else { + } else if (object->handlers->get_class_name == std_object_handlers.get_class_name) { class_name = object->ce->name; + } else { + class_name = object->handlers->get_class_name(object); } call_type = "->"; @@ -2538,6 +2540,11 @@ ZEND_FUNCTION(debug_print_backtrace) if (class_name) { ZEND_PUTS(ZSTR_VAL(class_name)); ZEND_PUTS(call_type); + if (object + && !func->common.scope + && object->handlers->get_class_name != std_object_handlers.get_class_name) { + zend_string_release(class_name); + } } zend_printf("%s(", function_name); if (Z_TYPE(arg_array) != IS_UNDEF) { @@ -2702,9 +2709,10 @@ ZEND_API void zend_fetch_debug_backtrace(zval *return_value, int skip_last, int if (object) { if (func->common.scope) { ZVAL_STR_COPY(&tmp, func->common.scope->name); - } else { + } else if (object->handlers->get_class_name == std_object_handlers.get_class_name) { ZVAL_STR_COPY(&tmp, object->ce->name); - + } else { + ZVAL_STR(&tmp, object->handlers->get_class_name(object)); } zend_hash_add_new(Z_ARRVAL(stack_frame), CG(known_strings)[ZEND_STR_CLASS], &tmp); if ((options & DEBUG_BACKTRACE_PROVIDE_OBJECT) != 0) { |