Bug #79921 [Opn]: memory exhausted, on array definition, in require
| From: | chandleg at wizardsworks dot org | Date: | Sat, 01 Aug 2020 08:28:11 +0000 |
| Subject: | Bug #79921 [Opn]: memory exhausted, on array definition, in require | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-228357@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79921&edit=1
ID: 79921
User updated by: chandleg at wizardsworks dot org
Reported by: chandleg at wizardsworks dot org
Summary: memory exhausted, on array definition, in require
Status: Open
Type: Bug
Package: Unknown/Other Function
Operating System: Slackware Linux
PHP Version: 7.2.32
Block user comment: N
Private report: N
New Comment:
I meant to mention the array format is variable
array of:
array(int, int, int, float, array, array, array)
Where each 3rd level array is of 1-3 elements, but the same number of elements of the other arrays
in the 2nd level.
Also the 100006 line file is 1.2Meg.
It appears to be running out of stack/heap trying to load it, but I thought that arrays in PHP were
unlimited size, the best calculation I have on this, is it should be around 22Meg in memory.
It's tossing "memory exhausted" in the parser, not in the running, so I'm
wondering what the limit for either a require, or an array is.
I am fairly certain I have function files I include larger than 10,000 lines, and I am extremely
certain I have arrays with element counts over 300,000.
Previous Comments:
------------------------------------------------------------------------
[2020-08-01 08:21:44] chandleg at wizardsworks dot org
Description:
------------
I have a 10006 line "config" file, which is an array set for data values.
The format is: array(int, int, int, float, array, array, array)
Exerpt:
<?php
$star_map = array (
array(-587, 418, -182, 849.85998846869, array(2, 2), array(5.96541E+29, 5.96541E+29),
array(278538822.144, 278538822.144),
array(-949, 457, -877, 1603.2251869279, array(2, 2), array(5.96541E+29, 5.96541E+29),
array(278538822.144, 278538822.144),
array(1087, -401, 144, 1543.9799221492, array(2, 2), array(5.96541E+29, 5.96541E+29),
array(278538822.144, 278538822.144),
........
array(-685, 113, -82, 972.20059658488, array(2), array(5.96541E+29), array(278538822.144),
array(554, 244, -57, 785.54503371863, array(2, 2), array(5.96541E+29, 5.96541E+29),
array(278538822.144, 278538822.144),
array(1022, -77, -865, 1684.3969247182, array(2, 2), array(5.96541E+29, 5.96541E+29),
array(278538822.144, 278538822.144),
);
?>
Test script:
---------------
<?php
require "./config.php";
?>
Expected result:
----------------
I would expect it to properly import the inline code.
Actual result:
--------------
redacted:~/public_html/game/tmp$ php index.php
PHP Parse error: memory exhausted in ./chart.php on line 2500
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79921&edit=1