}
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) {