|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2017-07-05 06:45 UTC] rmoisto at gmail dot com
[2017-07-05 08:25 UTC] nikic@php.net
-Status: Open
+Status: Duplicate
[2017-07-05 08:25 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 21:00:01 2025 UTC |
Description: ------------ Tested on 7.0.15(Ubuntu), OSX PHP 7.0.6 (cli) (built: Apr 29 2016 04:21:39) ( NTS ) Copyright (c) 1997-2016 The PHP Group Zend Engine v3.0.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans and OSX PHP 5.6.21 (cli) (built: Apr 29 2016 02:31:44) Copyright (c) 1997-2016 The PHP Group Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies with Xdebug v2.4.0, Copyright (c) 2002-2016, by Derick Rethans all provide similiar result Might be related to https://bugs.php.net/bug.php?id=54114 Test script: --------------- <?php ini_set("memory_limit", "2m"); $v = array_fill(0,1024*5/2/4/2/8, "0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789"); while (true) { $v[] = print_r($v, true); } Expected result: ---------------- Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 581632 bytes) in /private/tmp/test.php on line 7 Call Stack: 0.0003 355824 1. {main}() /private/tmp/test.php:0 0.0012 948768 2. print_r() /private/tmp/test.php:7 Actual result: -------------- ... ... [29] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [30] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [31] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [32] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [33] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [34] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [35] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [36] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [37] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [38] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 [39] => 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789 ) ) ) ) ) ) [46] => Fatal error: Allowed memory size of 2097152 bytes exhausted (tried to allocate 581632 bytes) in /private/tmp/test.php on line 7 Call Stack: 0.0003 355824 1. {main}() /private/tmp/test.php:0 0.0012 948768 2. print_r() /private/tmp/test.php:7