#3559 [Opn->Csd]: Serialize does not reset() regular and hash arrays
| From: | hholzgra@php.net | Date: | Mon, 30 Sep 2002 23:52:49 +0000 |
| Subject: | #3559 [Opn->Csd]: Serialize does not reset() regular and hash arrays | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-20829@lists.php.net to get a copy of this message | ||
ID: 3559
Updated by: hholzgra@php.net
Reported By: simon@unitycode.org
-Status: Open
+Status: Closed
Bug Type: Misbehaving function
Operating System: RedHat 6.0, Win2K
PHP Version: 3.0.14
New Comment:
works in 4.2.3
Previous Comments:
------------------------------------------------------------------------
[2000-02-21 23:33:25] simon@unitycode.org
<?
$testvalue = Array('Hi' => 'There', 'Yo' => 'Joe');
$value = serialize($testvalue);
while ( list($key, $val) = each($testvalue) )
{
echo "Via Links (broken): $key = $val<br>\n";
}
echo "Direct Access (works): $testvalue[Hi], $testvalue[Yo]<br>\n";
?>
Temporary fix: reset($your_array); after serialization.
(perm fix courtesy of zerodiv@zerodivide.net)
Permenant fix (version 3.0.x): ~line 240:
php3api_var_serialize(buf, data);
}
// THIS IS THE FIX
_php3_hash_internal_pointer_reset(struc->value.ht);
// END OF FIX
}
STR_CAT(buf, "}", 1);
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=3559&edit=1