[go: nahoru, domu]

PHP 8.4.0 RC4 available for testing

Voting

: nine minus eight?
(Example: nine)

The Note You're Voting On

artaxerxes
11 years ago
As the documentation says, SplFixedArray is meant to be *faster* than array. Do not blindly believe other people's benchmarks, and beextra careful with the user comments on php.net. For instance, nairbv's benchmark code is completely wrong. Among other errors, it intends to increase the size of the arrays, but always initialize a 20 elements SplFixedArray.

On a PHP 5.4 64 bits linux server, I found SplFixedArray to be always faster than array().
* small data (1,000):
* write: SplFixedArray is 15 % faster
* read: SplFixedArray is 5 % faster
* larger data (512,000):
* write: SplFixedArray is 33 % faster
* read: SplFixedArray is 10 % faster

<< Back to user notes page

To Top