array_pad docs say that
You can add up to 1,048,576 items at a time.
I tried to find any information where the limit comes from and could not find. The only PDO related question is # 1 , # 2 , and the solution is to increase the size of the buffer. But there is no PDO in array_pad .
It is absolutely possible to create an array containing more elements:
$array = range(1, 1048576 + 10); echo count($array);
Indeed, there is a tough check so as not to exceed this value in array_pad sources .
But why?
source share