]> granicus.if.org Git - php/commitdiff
MFH serializer fix
authorStanislav Malyshev <stas@php.net>
Mon, 29 Apr 2002 15:45:58 +0000 (15:45 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 29 Apr 2002 15:45:58 +0000 (15:45 +0000)
ext/standard/var.c

index 2cda9678dcc3ef142e42fde95baa1dc400290503..1eefc30bf8001389e1c42063ac034d529f389e02 100644 (file)
@@ -389,10 +389,12 @@ static inline void php_var_serialize_class_name(smart_str *buf, zval **struc TSR
 
 static void php_var_serialize_class(smart_str *buf, zval **struc, zval *retval_ptr, HashTable *var_hash TSRMLS_DC)
 {
-       int count = zend_hash_num_elements(HASH_OF(retval_ptr));
+       int count;
 
        php_var_serialize_class_name(buf, struc TSRMLS_CC);
-
+       /* count after serializing name, since php_var_serialize_class_name
+          changes the count if the variable is incomplete class */
+       count = zend_hash_num_elements(HASH_OF(retval_ptr));
        smart_str_append_long(buf, count);
        smart_str_appendl(buf, ":{", 2);