]> granicus.if.org Git - php/commitdiff
MFH: Use SEPARATE_ZVAL_IF_NOT_REF for cleaner code.
authorJani Taskinen <jani@php.net>
Thu, 19 Jul 2007 15:29:30 +0000 (15:29 +0000)
committerJani Taskinen <jani@php.net>
Thu, 19 Jul 2007 15:29:30 +0000 (15:29 +0000)
Zend/zend_execute.c

index c69dcd72b6a514dd45d4f75faf11d97f6d7fa581..74e9e965877c7ce2d1e0a9353dc9b780fec0dd28 100644 (file)
@@ -430,17 +430,16 @@ static void zend_assign_to_variable_reference(zval **variable_ptr_ptr, zval **va
        }
 }
 
+/* this should modify object only if it's empty */
 static inline void make_real_object(zval **object_ptr TSRMLS_DC)
 {
-/* this should modify object only if it's empty */
        if (Z_TYPE_PP(object_ptr) == IS_NULL
-               || (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr)==0)
-               || (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)) {
-
-               if (!PZVAL_IS_REF(*object_ptr)) {
-                       SEPARATE_ZVAL(object_ptr);
-               }
+               || (Z_TYPE_PP(object_ptr) == IS_BOOL && Z_LVAL_PP(object_ptr) == 0)
+               || (Z_TYPE_PP(object_ptr) == IS_STRING && Z_STRLEN_PP(object_ptr) == 0)
+       ) {
                zend_error(E_STRICT, "Creating default object from empty value");
+
+               SEPARATE_ZVAL_IF_NOT_REF(object_ptr);
                zval_dtor(*object_ptr);
                object_init(*object_ptr);
        }