|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-07-18 11:30 UTC] gopalv@php.net
[2011-07-18 12:42 UTC] tyra3l at gmail dot com
[2011-07-19 01:03 UTC] gopalv@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ yesterday I noticed that the following code isn't working if the $versions array is coming from apc (apc_fetch), as the internal pointer for that array isn't at the first element. I think that we should set that, as unserialize, json_decode, and every other method that I can came up with sets this correctly. Reproduce code: --------------- <?php $foo = array('bar', 'baz'); $foo2 = unserialize(serialize($foo)); $foo3 = json_decode(json_encode($foo)); apc_store('test', $foo); $foo4 = apc_fetch('test'); var_dump(current($foo)); var_dump(current($foo2)); var_dump(current($foo3)); var_dump(current($foo4)); Expected result: ---------------- string(3) "bar" string(3) "bar" string(3) "bar" string(3) "bar" Actual result: -------------- string(3) "bar" string(3) "bar" string(3) "bar" bool(false)