]> granicus.if.org Git - php/commitdiff
Yet another serialization fix - for incomplete class
authorStanislav Malyshev <stas@php.net>
Mon, 29 Apr 2002 15:44:30 +0000 (15:44 +0000)
committerStanislav Malyshev <stas@php.net>
Mon, 29 Apr 2002 15:44:30 +0000 (15:44 +0000)
ext/standard/var.c

index 0f88fae366ccb1ea8c984026c4309e72780fe7db..d13f7b42baaaaea619309372b2bb6627f6866196 100644 (file)
@@ -432,10 +432,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);