diff options
Diffstat (limited to 'Zend/zend.c')
| -rw-r--r-- | Zend/zend.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Zend/zend.c b/Zend/zend.c index 983d46e17b..5dbfb950da 100644 --- a/Zend/zend.c +++ b/Zend/zend.c @@ -227,7 +227,11 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop case IS_OBJECT: if (expr->value.obj.handlers->cast_object) { TSRMLS_FETCH(); - if (expr->value.obj.handlers->cast_object(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) { + if (expr->value.obj.handlers->cast_object == zend_std_cast_object) { + if (zend_std_cast_object_tostring(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) { + break; + } + } else if (expr->value.obj.handlers->cast_object(expr, expr_copy, IS_STRING, 0 TSRMLS_CC) == SUCCESS) { break; } if (EG(exception)) { @@ -239,11 +243,6 @@ ZEND_API void zend_make_printable_zval(zval *expr, zval *expr_copy, int *use_cop } expr_copy->value.str.val = (char *) emalloc(sizeof("Object id #")-1 + MAX_LENGTH_OF_LONG); expr_copy->value.str.len = sprintf(expr_copy->value.str.val, "Object id #%ld", (long)expr->value.obj.handle); -#if 0 - /* FIXME: This might break BC for some people */ - expr_copy->value.str.len = sizeof("Object")-1; - expr_copy->value.str.val = estrndup("Object", expr_copy->value.str.len); -#endif break; case IS_DOUBLE: *expr_copy = *expr; |
