|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-12-16 12:31 UTC] helly@php.net
[2006-12-16 13:56 UTC] helly@php.net
[2007-02-08 22:14 UTC] helly@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 05:00:02 2025 UTC |
Description: ------------ I serialized a SplObjectStorage instance containing several objects. After unserialization, the SplObjectStorage object contained nothing. It doesn't say in the SPL documentation that SplObjectStorage cannot be serialized. Reproduce code: --------------- <?php class test { } $storage = new SplObjectStorage(); for( $i=0; $i<5; $i++ ) { $test = new test(); $test->example = 'testing'.$i; $storage->attach( $test ); } echo "Before: ".count($storage)."<br>"; $str = serialize($storage); $storage2 = unserialize( $str ); echo "After: ".count($storage2)."<br>"; ?> Expected result: ---------------- Before: 5 After: 5 Actual result: -------------- Before: 5 After: 0