From: Stanislav Malyshev Date: Mon, 29 Apr 2002 15:45:58 +0000 (+0000) Subject: MFH serializer fix X-Git-Tag: php-4.2.1RC1~14 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3d1401d45870281177184abb340b08b26c97549f;p=php MFH serializer fix --- diff --git a/ext/standard/var.c b/ext/standard/var.c index 2cda9678dc..1eefc30bf8 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -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);