PHP数组的本质是什么

PHP数组

用过PHP的都知道,PHP中的数组非常灵活,可变长度,不限类型,还可以定义为key-value模式。跟我们在C语言等其他语言中所说的数组完全是不一样的。那么问题来了,PHP的数组真的是数组么?

官方解释

An array in PHP is actually an ordered map. A map is a type that associates value to keys. This type is optimized for several different uses; it can treated as an array, list(vetor), hash table(an implementation of a map), dictionary, collection, stack, queue, and probably more. As array values can be other arrays, trees and multidimensional arrays are also possible.

官方解释是PHP的数组实际上是一个有序map。

本来想自己研究下源码看看是怎么回事,可是水平不够啊,后来就找了资料学习了一下。
http://nikic.github.io/2012/03/28/Understanding-PHPs-internal-array-implementation.html

加载评论框需要科学上网