Someone asked me a question during the last interview. I was quite surprised. Do you have any good answers?
迷茫2017-05-16 13:17:52
SplFixedArray is a fixed-length standard (standard array) and only allows integers in the range as indexes. The advantage is that it allows faster array implementation.
PHP arrays are actually implemented as ordered hash tables (a collection of data)
仅有的幸福2017-05-16 13:17:52
I asked similar questions when interviewing others. What I asked was to write a data structure with 1000 rows * 1000 columns and the values are all random numbers from 1 to 99. Many people did not know how to write it. This is obviously For the data structure test, in fact, all developers are playing with arrays, so I have requirements for this. It is very simple if you use two for loops to nest. As for the value, it is even simpler, mt_rand(1,99)... ...