What is the maximum size of an array in PHP?
There is no max on the limit of an array. There is a limit on the amount of memory your script can use. This can be changed in the 'memory_limit' in your php.ini configuration.
Array size is limited only by amount of memory your server has. If your array gets too big, you will get "out of memory" error.
It seems to me to be the 16-bit signed integer limit. (2^15)
$ar = [];
while (array_push($ar, null)) {
print 'a';
}
Length of output: 32768