ID: 41220
Updated by: [EMAIL PROTECTED]
Reported By: shshzi at gmail dot com
-Status: Open
+Status: Feedback
-Bug Type: Reproducible crash
+Bug Type: Unknown/Other Function
Operating System: Linux i386
PHP Version: 5.2.1
New Comment:
Not reproducible.
Previous Comments:
------------------------------------------------------------------------
[2007-04-28 22:30:41] shshzi at gmail dot com
Description:
------------
when using serialize on some large (not huge) array, it will take
insane
amounts of memory.
look at the code , when using size array of 30,000 , the script works
as expected, indicating that the output is a mere 2MB in length,
while enlarging the array to 50,000 elements causes php to go crazy
and
hit the 600MB i've allowed him to consume...
Reproduce code:
---------------
<?
$a = array();
for($i=0;$i<50000;$i++)
{
$a[$i] = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa";
}
$z = serialize($a);
print strlen($z);
?>
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41220&edit=1