#35488 [Bgs->Opn]: serialize() segmentation fault

From: Date: Wed, 30 Nov 2005 14:55:21 +0000
Subject: #35488 [Bgs->Opn]: serialize() segmentation fault
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-89488@lists.php.net to get a copy of this message
ID: 35488 User updated by: kenashkov at gmail dot com Reported By: kenashkov at gmail dot com -Status: Bogus +Status: Open Bug Type: *General Issues Operating System: Fedora Core 4 PHP Version: 4.4.1 New Comment: Quote from the docs of the function serialize(): "You can even serialize() arrays that contain references to itself. References inside the array/object you are serialize()ing will also be stored." Previous Comments: ------------------------------------------------------------------------ [2005-11-30 14:03:31] sniper@php.net Don't use references with serialize(). ------------------------------------------------------------------------ [2005-11-30 13:58:20] kenashkov at gmail dot com Description: ------------ Segmentation fault when serializing multidimentional recursive arrays. The code below works fine with 4.3.11 (again on FC4). When the argument is passend by reference (which is deprecated): print_r(unserialize(serialize(&$arr1))); it is fine. Or passing a reference: print_r(unserialize(serialize($ref=&$arr1))); also works. No problem with serializing just $arr1[0]=&$arr; Reproduce code: --------------- <? $arr1[0][0] =& $arr1; print_r(unserialize(serialize($arr1))); ?> Expected result: ---------------- Array ( [0] => Array ( [0] => Array ( [0] => Array ( [0] => Array *RECURSION* ) ) ) ) Actual result: -------------- Segmentation fault ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35488&edit=1

« previous php.bugs (#89488) next »