Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

SplFileObject::__toString() reads next line #9883

Closed
@cmb69

Description

@cmb69

Description

The following code:

<?php$file_stream =newSplFileObject(__FILE__,'rb');echo$file_stream;// line 4echo$file_stream;// line 5echo$file_stream;// line 6echo$file_stream;// line 7echo$file_stream;// line 8echo$file_stream;// line 9

Resulted in this output:

<?php$file_stream = new SplFileObject(__FILE__, 'rb');echo $file_stream; // line 4echo $file_stream; // line 5

But I expected this output instead:

<?php<?php<?php<?php<?php<?php

Seehttps://3v4l.org/gF4tm.

The issue is due to theerroneous fix ofbug 77024, where::__toString() is now an alias of::fgets() what appears to be strange.

This issue has been discovered by@derickr.

PHP Version

PHP 8.0

Operating System

any

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp