summaryrefslogtreecommitdiff
path: root/Zend
diff options
context:
space:
mode:
Diffstat (limited to 'Zend')
-rw-r--r--Zend/zend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/Zend/zend.c b/Zend/zend.c
index bd188c1e26..df3969a609 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -214,7 +214,7 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
expr_copy->value.str.val = estrndup("Array", expr_copy->value.str.len);
break;
case IS_OBJECT:
- if (expr->value.obj.handlers->cast_object) {
+ {
TSRMLS_FETCH();
/* Standard PHP objects */
if (expr->value.obj.handlers == &std_object_handlers) {
@@ -222,7 +222,9 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop
break;
}
zend_error(E_NOTICE, "Object of class %s could not be converted to string", Z_OBJCE_P(expr)->name);
- } else if (expr->value.obj.handlers->cast_object(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
+ }
+ if (expr->value.obj.handlers->cast_object &&
+ expr->value.obj.handlers->cast_object(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
break;
}
if (EG(exception)) {