Обучение/Помощь новичкам | Массивы
Тема закрыта by
SNEG
mysqli_fetch_assoc и array() имеют какие либо ограничения на количество записей или данных которые можно поместить в них?
________
посл. ред. 08.09.2023 в 03:26; всего 4 раз(а); by SNEG
________
посл. ред. 08.09.2023 в 03:26; всего 4 раз(а); by SNEG
Не надоело?
I would say that AS A LANGUAGE, PHP does in fact have no limit on
array sizes. Period.
Beyond that definition in the language specification, there come two
limiting factors:
1) The hardware limitation of the machine running PHP. i.e. How much
memory it has. This is the most practical answer for most users.
2) Implementation details of the PHP runtime. The reference
implementation of PHP uses a uint32_t to keep track of the number of
elements for quick and easy O(1) access. This may or may not limit
the array to (2^32-1) elements, but it does certainly limit the
functionality of count() when operating on arrays. I think
documenting in the php.net manual (which refers solely to the
reference implementation) a limit of (2^32-1) elements as an
implementation detail is not unreasonable, but it's worthy of nothing
more than a footnote on the arrays reference page. The answer in #1
about memory limits is FAR more salient to typical uses.
array sizes. Period.
Beyond that definition in the language specification, there come two
limiting factors:
1) The hardware limitation of the machine running PHP. i.e. How much
memory it has. This is the most practical answer for most users.
2) Implementation details of the PHP runtime. The reference
implementation of PHP uses a uint32_t to keep track of the number of
elements for quick and easy O(1) access. This may or may not limit
the array to (2^32-1) elements, but it does certainly limit the
functionality of count() when operating on arrays. I think
documenting in the php.net manual (which refers solely to the
reference implementation) a limit of (2^32-1) elements as an
implementation detail is not unreasonable, but it's worthy of nothing
more than a footnote on the arrays reference page. The answer in #1
about memory limits is FAR more salient to typical uses.
Хех

