#define COMMON (is_ref ? "&" : "")
/* }}} */
-static uint32_t zend_hash_recalc_elements(HashTable *ht) /* {{{ */
+static uint32_t php_array_recalc_elements(HashTable *ht) /* {{{ */
{
zval *val;
uint32_t num = ht->nNumOfElements;
}
/* }}} */
-static uint32_t zend_obj_num_elements(HashTable *ht) /* {{{ */
+static uint32_t php_array_num_elements(HashTable *ht) /* {{{ */
{
uint32_t num = ht->nNumOfElements;
if (UNEXPECTED(ht->u.v.flags & HASH_FLAG_HAS_EMPTY_IND)) {
- num = zend_hash_recalc_elements(ht);
+ num = php_array_recalc_elements(ht);
if (UNEXPECTED(ht->nNumOfElements == num)) {
ht->u.v.flags &= ~HASH_FLAG_HAS_EMPTY_IND;
}
return;
}
if (UNEXPECTED(Z_SYMBOLTABLE_P(struc))) {
- count = zend_hash_recalc_elements(myht);
+ count = php_array_recalc_elements(myht);
} else {
- count = zend_hash_num_elements(myht);
+ count = php_array_num_elements(myht);
}
php_printf("%sarray(%d) {\n", COMMON, count);
is_temp = 0;
myht = Z_OBJDEBUG_P(struc, is_temp);
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
- php_printf("%sobject(%s)#%d (%d) {\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0);
+ php_printf("%sobject(%s)#%d (%d) {\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? php_array_num_elements(myht) : 0);
zend_string_release(class_name);
if (myht) {
return;
}
if (UNEXPECTED(Z_SYMBOLTABLE_P(struc))) {
- count = zend_hash_recalc_elements(myht);
+ count = php_array_recalc_elements(myht);
} else {
- count = zend_hash_num_elements(myht);
+ count = php_array_num_elements(myht);
}
php_printf("%sarray(%d) refcount(%u){\n", COMMON, count, Z_REFCOUNTED_P(struc) ? Z_REFCOUNT_P(struc) : 1);
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
}
}
class_name = Z_OBJ_HANDLER_P(struc, get_class_name)(Z_OBJ_P(struc));
- php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? zend_obj_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
+ php_printf("%sobject(%s)#%d (%d) refcount(%u){\n", COMMON, ZSTR_VAL(class_name), Z_OBJ_HANDLE_P(struc), myht ? php_array_num_elements(myht) : 0, Z_REFCOUNT_P(struc));
zend_string_release(class_name);
if (myht) {
ZEND_HASH_FOREACH_KEY_VAL_IND(myht, index, key, val) {
if (Z_TYPE_P(retval_ptr) == IS_ARRAY) {
ht = Z_ARRVAL_P(retval_ptr);
if (UNEXPECTED(Z_SYMBOLTABLE_P(struc))) {
- count = zend_hash_recalc_elements(ht);
+ count = php_array_recalc_elements(ht);
} else {
- count = zend_hash_num_elements(ht);
+ count = php_array_num_elements(ht);
}
} else if (Z_TYPE_P(retval_ptr) == IS_OBJECT) {
ht = Z_OBJPROP_P(retval_ptr);
- count = zend_obj_num_elements(ht);
+ count = php_array_num_elements(ht);
if (incomplete_class) {
--count;
}
smart_str_appendl(buf, "a:", 2);
myht = Z_ARRVAL_P(struc);
if (UNEXPECTED(Z_SYMBOLTABLE_P(struc))) {
- i = zend_hash_recalc_elements(myht);
+ i = php_array_recalc_elements(myht);
} else {
- i = zend_hash_num_elements(myht);
+ i = php_array_num_elements(myht);
}
} else {
incomplete_class = php_var_serialize_class_name(buf, struc);
myht = Z_OBJPROP_P(struc);
/* count after serializing name, since php_var_serialize_class_name
* changes the count if the variable is incomplete class */
- i = zend_obj_num_elements(myht);
+ i = php_array_num_elements(myht);
if (i > 0 && incomplete_class) {
--i;
}