|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-11-27 08:39 UTC] laruence@php.net
[2012-11-27 08:39 UTC] laruence@php.net
-Assigned To:
+Assigned To: helly
[2013-09-12 14:13 UTC] nikic@php.net
-Status: Assigned
+Status: Duplicate
[2013-09-12 14:13 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Oct 28 02:00:01 2025 UTC |
Description: ------------ For some reason not clear to me, using iterator_count with the iterator interface of SplFileObject (as well with SplTempFileObject) results in an endless running script. Test script: --------------- <?php $test = new SplFileObject("data://text/plain,1\n2"); $test->setFlags(SplFileObject::DROP_NEW_LINE); echo "Values: [", implode(', ', iterator_to_array($test)), "]\nCount: ", iterator_count($test), "\n"; ?> -- OR -- <?php $test = new SplTempFileObject(); $test->setFlags(SplTempFileObject::DROP_NEW_LINE); $test->fwrite("1\n2"); echo "Values: [", implode(', ', iterator_to_array($test)), "]\nCount: ", iterator_count($test), "\n"; ?> Expected result: ---------------- Values: [1, 2] Count: 2 Actual result: -------------- Values: [1, 2] Count: