|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-05-24 14:37 UTC] stof at notk dot org
[2015-03-25 22:06 UTC] danack@php.net
-Status: Open
+Status: Feedback
[2015-03-25 22:06 UTC] danack@php.net
[2015-04-05 04:22 UTC] php-bugs at lists dot php dot net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Nov 05 12:00:01 2025 UTC |
Description: ------------ The doc documents SplFileObject::__toString as being an alias for SplFileObject::current. When calling __toString explicitly, this indeed works (and can return an array when READ_CSV is used, which seems confusing) But when casting a SplFileObject to a string, it will return the path to the file, like for the SplFileInfo parent class. Test script: --------------- $tempFile = new \SplTempFileObject(); $tempFile->fwrite('foobar-'); $tempFile->rewind(); echo (string) $tempFile; echo PHP_EOL; echo $tempFile->__toString(); Expected result: ---------------- Result according to the doc: foobar- foobar- Actual result: -------------- php://temp foobar-