|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39850 SplFileObject contradictory "failed to open stream: Success"
Submitted: 2006-12-16 07:08 UTC Modified: 2006-12-18 14:56 UTC
From: judas dot iscariote at gmail dot com Assigned: tony2001 (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5CVS-2006-12-16 (CVS) OS: Linux 64bit
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
Solve the problem:
9 + 28 = ?
Subscribe to this entry?

 [2006-12-16 07:08 UTC] judas dot iscariote at gmail dot com
A funny Exception is raised by SplFileObject on certain special situation.

Reproduce code:

//yes, get_included_files() is important for the test !!
if(count(get_included_files()) === 1) {

    // yes, **wrong** (mistyped) wrapper.
    $stdout = new SplFileObject('php://stdoutd', 'wb');

Expected result:
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(php://stdoutd): failed to open stream: (Invalid Wrapper ? , File not found ?  or something ;) )

Actual result:
PHP Fatal error:  Uncaught exception 'RuntimeException' with message 'SplFileObject::__construct(php://stdoutd): failed to open stream: **Success**

or in other cases without the get_included_files() call I get 
"Inappropriate ioctl for device" (!!)


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2006-12-18 11:08 UTC]
I got a patch, but I want to hear what Ilia thinks about it first..
 [2006-12-18 14:56 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Thu Jan 20 06:03:34 2022 UTC