|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-03-19 02:45 UTC] colder@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ After cloning an instance of SplObjectStorage the number of objects which can be retrieved with count() is very high and foreach() causes a segfault. Reproduce code: --------------- class Foo {} $storageA = new \SplObjectStorage(); $storageA->attach(new \Foo); $storageA->attach(new \Foo); echo ("Count storage A: " . count($storageA)); foreach ($storageA as $object) { echo ' x '; } $storageB = clone $storageA; echo ("Count storage B: " . count($storageB)); foreach ($storageB as $object) { echo ' x '; } Expected result: ---------------- Count storage A: 2 x x Count storage B: 2 x x Actual result: -------------- Count storage A: 2 x x Count storage B: 1953394499