1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00
Files
archived-php-src/ext/spl/tests/gh9883.phpt
George Peter Banyard 6fbf81c674 Fix GH-9883 SplFileObject::__toString() reads next line
We need to overwrite the __toString magic method for SplFileObject, similarly to how DirectoryIterator overwrites it
Moreover, the custom cast handler is useless as we define __toString methods, so use the standard one instead.

Closes GH-9912
2022-11-22 12:21:14 +00:00

21 lines
357 B
PHP

--TEST--
Bug GH-9883 (SplFileObject::__toString() reads next line)
--FILE--
<?php
$file_stream = new SplFileObject(__FILE__, 'rb');
echo $file_stream; // line 4
echo $file_stream; // line 5
echo $file_stream; // line 6
echo $file_stream; // line 7
echo $file_stream; // line 8
echo $file_stream; // line 9
?>
--EXPECT--
<?php
<?php
<?php
<?php
<?php
<?php