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
Post a Comment