]> granicus.if.org Git - php/commitdiff
Fix __tostring() and concatenation
authorMarcus Boerger <helly@php.net>
Sat, 27 Dec 2003 20:16:49 +0000 (20:16 +0000)
committerMarcus Boerger <helly@php.net>
Sat, 27 Dec 2003 20:16:49 +0000 (20:16 +0000)
Zend/zend_object_handlers.c

index fdf3d2bc5e9236ae2163cc22684d1c1c4b178c29..f3884dbd9d8a11d2919aa1ba0cba6705257c05ef 100644 (file)
@@ -918,7 +918,6 @@ int zend_std_object_get_class_name(zval *object, char **class_name, zend_uint *c
 ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int type, int should_free TSRMLS_DC)
 {
        zval fname, *retval;
-       int is_ref, refcount;
        
        switch (type) {
                case IS_STRING:
@@ -932,13 +931,9 @@ ZEND_API int zend_std_cast_object_tostring(zval *readobj, zval *writeobj, int ty
                                        MAKE_STD_ZVAL(retval);
                                        ZVAL_STRINGL(retval, empty_string, 0, 0);
                                }
-                               zval_dtor(writeobj);
-                               is_ref = writeobj->is_ref;
-                               refcount = writeobj->refcount;
                                *writeobj = *retval;
                                zval_copy_ctor(writeobj);
-                               writeobj->is_ref = is_ref;
-                               writeobj->refcount = refcount;
+                               INIT_PZVAL(writeobj);
                                zval_ptr_dtor(&retval);
                                return SUCCESS;
                        }