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)
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)... ...
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)
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)... ...
array_pad()
The SplFixedArray class http://php.net/manual/zh/clas...