mirror of
https://github.com/php/php-src.git
synced 2024-11-28 04:14:26 +08:00
- 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:
parent
dacb3a68fe
commit
23b231d0eb
@ -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";
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user