#39850 [Asn->Csd]: SplFileObject contradictory "failed to open stream: Success"
| From: | tony2001@php.net | Date: | Mon, 18 Dec 2006 14:56:33 +0000 |
| Subject: | #39850 [Asn->Csd]: SplFileObject contradictory "failed to open stream: Success" | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-106496@lists.php.net to get a copy of this message | ||
ID: 39850
Updated by: tony2001@php.net
Reported By: judas dot iscariote at gmail dot com
-Status: Assigned
+Status: Closed
Bug Type: Filesystem function related
Operating System: Linux 64bit
PHP Version: 5CVS-2006-12-16 (CVS)
Assigned To: tony2001
New Comment:
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
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-12-18 11:08:13] tony2001@php.net
I got a patch, but I want to hear what Ilia thinks about it first..
http://tony2001.phpclub.net/dev/tmp/bug39850.diff
------------------------------------------------------------------------
[2006-12-16 07:08:35] judas dot iscariote at gmail dot com
Description:
------------
A funny Exception is raised by SplFileObject on certain special
situation.
Reproduce code:
---------------
<?php
//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" (!!)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=39850&edit=1