does count()
count elements of php array, or value cached somewhere , gets retrieved?
well, can @ source:
php_function(count)
calls php_count_recursive()
, in turn calls zend_hash_num_elements()
non-recursive array, implemented way:
zend_api int zend_hash_num_elements(const hashtable *ht) { is_consistent(ht); return ht->nnumofelements; }
so can see, it's o(1)
$mode = count_normal
.
Comments
Post a Comment