- Revert the revert of these patches. This overloading can only be used

- by C extensions such as SimpleXML and *NOT* PHP code. Reasons given
- on the mailing list and problem with reentrancy inside the opcodes.
This commit is contained in:
Andi Gutmans 2003-12-02 21:09:24 +00:00
parent dacb3a68fe
commit 23b231d0eb
2 changed files with 8 additions and 3 deletions

View File

@ -315,10 +315,17 @@ static char *zend_parse_arg_impl(zval **arg, va_list *va, char **spec TSRMLS_DC)
*p = Z_STRVAL_PP(arg);
*pl = Z_STRLEN_PP(arg);
break;
case IS_OBJECT: {
if (Z_OBJ_HANDLER_PP(arg, cast_object)
&& Z_OBJ_HANDLER_PP(arg, cast_object)(*arg, *arg, IS_STRING, 0 TSRMLS_CC) == SUCCESS) {
*pl = Z_STRLEN_PP(arg);
*p = Z_STRVAL_PP(arg);
break;
}
}
case IS_ARRAY:
case IS_RESOURCE:
case IS_OBJECT:
default:
return "string";
}

View File

@ -492,7 +492,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
op->value.str.len = sizeof("Array")-1;
break;
case IS_OBJECT: {
#if ANDI_0
TSRMLS_FETCH();
if (op->value.obj.handlers->cast_object) {
if (op->value.obj.handlers->cast_object(op, op, IS_STRING, 1 TSRMLS_CC) == SUCCESS) {
@ -502,7 +501,6 @@ ZEND_API void _convert_to_string(zval *op ZEND_FILE_LINE_DC)
} else {
zend_error(E_NOTICE, "Object of class %s to string conversion", Z_OBJCE_P(op)->name);
}
#endif
zval_dtor(op);
op->value.str.val = estrndup_rel("Object", sizeof("Object")-1);
op->value.str.len = sizeof("Object")-1;