What is php's performance on directly accessing array's row with key specified -


i have question regarding array's performance.... how php handle array keys? mean if $my_city = $cities[15]; .... php directly access exact row item in $cities array or php iterate trough array until finds matched row?

and if access row directly... there difference in performance between array 100 rows , array 100,000 rows?

like in example $my_city = $cities[15];

php's arrays implemented hash tables, elements accessed directly possible, without iterating through everything. read more algorithm here: http://en.wikipedia.org/wiki/hash_table


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -