如何关联数组PHP实现? [英] How are associative arrays implemented in PHP?

查看:98
本文介绍了如何关联数组PHP实现?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人能解释PHP如何实现关联数组?什么底层的数据结构做PHP用呢? PHP是否散列密钥并将其存储在某种哈希地图吗?我很好奇,因为我想知道什么插入和搜索键在哪里时,关联阵列的性能

Can someone explain how PHP implements associative arrays? What underlying data structure does PHP use? Does PHP hash the key and store it in some kind of hash map? I am curious because I was wondering what the performance of associative arrays where when inserting and searching for keys.

推荐答案

这是一个哈希表。该类型声明和散列函数在这里:结果
<一href=\"http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_hash.h?view=markup\">http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_hash.h?view=markup

It's a hash table. The type declaration and hashing function are here:
http://svn.php.net/viewvc/php/php-src/trunk/Zend/zend_hash.h?view=markup

有一个重量轻阵列和SPL中的一个链表(标准的PHP LIB)

There is a light weight array and a linked list within the spl (standard php lib)

这篇关于如何关联数组PHP实现?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆