|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-03-21 12:30 UTC] cataphract@php.net
-Assigned To:
+Assigned To: cataphract
[2012-03-21 12:45 UTC] cataphract@php.net
-Status: Assigned
+Status: Closed
[2012-03-21 12:45 UTC] cataphract@php.net
[2014-10-07 23:28 UTC] stas@php.net
[2014-10-07 23:39 UTC] stas@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 19 23:00:01 2025 UTC |
Description: ------------ When I have a large collection of objects stored in a SplObjectStorage it starts to behave strange. It says that an object already exists in the storage and returns the stored data for another object. Test script: --------------- $limit = 1000; $objects = new SplObjectStorage; for($i = 0; $i < $limit; $i++){ $object = new StdClass; if(isset($objects[$object])){ die("this should never happen, but did after $i iteration"); } $objects[$object] = 1; } echo "\nfinished\n"; Expected result: ---------------- The script should never enter the if condition and die, because the object has not been added to the object storage yet Actual result: -------------- The scripts dies because of it finding an object in the storage that should not have been there. This happens at random iteration, i'm guessing based on memory usage or something.