From c0c2b6916edc77bf434e7b3ccecfeab2a368fd18 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 29 Apr 2002 16:03:57 +0000 Subject: [PATCH] MFH --- ext/standard/var.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/standard/var.c b/ext/standard/var.c index 1eefc30bf8..844c704163 100644 --- a/ext/standard/var.c +++ b/ext/standard/var.c @@ -513,12 +513,14 @@ static void php_var_serialize_intern(smart_str *buf, zval **struc, HashTable *va } case IS_ARRAY: myht = HASH_OF(*struc); - i = zend_hash_num_elements(myht); if (Z_TYPE_PP(struc) == IS_ARRAY) { smart_str_appendl(buf, "a:", 2); } else { 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 */ + i = zend_hash_num_elements(myht); smart_str_append_long(buf, i); smart_str_appendl(buf, ":{", 2); if (i > 0) { -- 2.50.1