From: judas dot iscariote at gmail dot com
Operating system: Linux 64bit
PHP version: 5CVS-2006-12-16 (CVS)
PHP Bug Type: SPL related
Bug description: SplFileObject contradictory "failed to open stream: Success"
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 bug report at http://bugs.php.net/?id=39850&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=39850&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=39850&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=39850&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=39850&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=39850&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=39850&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=39850&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=39850&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=39850&r=support
Expected behavior: http://bugs.php.net/fix.php?id=39850&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=39850&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=39850&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=39850&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39850&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=39850&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=39850&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=39850&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=39850&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=39850&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=39850&r=mysqlcfg