If it were c++
,this can be achieved by template,but as we know PHP
is written in c
,how's this kind of data struct implemented without template?
Asked
Active
Viewed 172 times
1
-
3maybe its just me, but this question makes little sense. – May 31 '11 at 04:20
-
php arrays can take any arbitrary content, a templated vector in c++ can only hold many objects of the same type (but you can create different vectors of course) – knittl May 31 '11 at 06:30
1 Answers
3
It's a hash table. For the implementation details, see
- http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_hash.c?view=markup
- http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_hash.h?view=markup
or in general

Gordon
- 312,688
- 75
- 539
- 559