|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2008-06-03 12:06 UTC] gdiego at gmail dot com
Description:
------------
If you store an array with an object inside the object is not stored
Reproduce code:
---------------
class whatever {
};
$a = new whatever();
$z = array(1, $a);
apc_store("hello", $a);
apc_store("hello2", $z);
var_dump(apc_fetch("hello")); //brings the correct object
var_dump(apc_fetch("hello2")); //brings the array 0=>1, 1=>NULL
Expected result:
----------------
bring array 0=>1, 1=>object
Actual result:
--------------
bring array 0=>1, 1=>NULL
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 18:00:01 2025 UTC |
I think the error comes from apc_cache_store_zval function in apc_cache.c... if((src->type & ~IS_CONSTANT_INDEX) == IS_OBJECT) { ... it serializes it } else { ... it doesn't if src->type is an array it might have an object inside and it might be copying a reference, returning NULL later?