diff options
| author | Marcus Boerger <helly@php.net> | 2003-12-15 16:59:21 +0000 |
|---|---|---|
| committer | Marcus Boerger <helly@php.net> | 2003-12-15 16:59:21 +0000 |
| commit | d4f64f88badd33ae87b9ec9b3120d532c8352b05 (patch) | |
| tree | a8830cb4ed9cc2bd3f831980a1dc4d56bd02abee /Zend/zend.c | |
| parent | 18096396d2e0d0545946a09087ec633f250b9dfd (diff) | |
| download | php-git-d4f64f88badd33ae87b9ec9b3120d532c8352b05.tar.gz | |
Reenable __tostring() magic for print,echo,concatenation,function naming...
but not for other internal things.
# As discussed with Andi
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; |
