mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
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
21 lines
357 B
PHP
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
|