Why doesn't array_pad add more than 1,048,576 elements at a time?

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); // prints 1048586 

Indeed, there is a tough check so as not to exceed this value in array_pad sources .

But why?

+5
source share

Source: https://habr.com/ru/post/1272184/


All Articles