ID: 47045 Updated by: [email protected] Reported By: karsten at typo3 dot org -Status: Open +Status: Assigned Bug Type: SPL related Operating System: Mac OS X 10.5.6 PHP Version: 5.3.0alpha3 Assigned To: colder
Previous Comments: ------------------------------------------------------------------------ [2009-01-09 10:21:42] karsten at typo3 dot org Description: ------------ Two instances of SplObjectStorage should be considered equal only if they contain the same objects, when using == for comparison. Reproduce code: --------------- <?php $someObject = new \stdClass(); $objectStorage = new \SplObjectStorage(); $objectStorage1 = new \SplObjectStorage(); var_dump($objectStorage === $objectStorage1); // FALSE, fine var_dump($objectStorage == $objectStorage1); // TRUE, fine $objectStorage->attach($someObject); var_dump($objectStorage === $objectStorage1); // FALSE, fine var_dump($objectStorage == $objectStorage1); // TRUE, huh? $objectStorage1->attach($someObject); var_dump($objectStorage === $objectStorage1); // FALSE, fine var_dump($objectStorage == $objectStorage1); // TRUE, fine ?> Expected result: ---------------- bool(false) bool(true) bool(false) bool(false) bool(false) bool(true) Actual result: -------------- bool(false) bool(true) bool(false) bool(true) bool(false) bool(true) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=47045&edit=1
