Professional Web Applications Themes

#39850 [NEW]: SplFileObject contradictory "failed to open stream: Success" - PHP Bugs

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 ...

  1. #1

    Default #39850 [NEW]: SplFileObject contradictory "failed to open stream: Success"

    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 [url]http://bugs.php.net/?id=39850&edit=1[/url]
    --
    Try a CVS snapshot (PHP 4.4): [url]http://bugs.php.net/fix.php?id=39850&r=trysnapshot44[/url]
    Try a CVS snapshot (PHP 5.2): [url]http://bugs.php.net/fix.php?id=39850&r=trysnapshot52[/url]
    Try a CVS snapshot (PHP 6.0): [url]http://bugs.php.net/fix.php?id=39850&r=trysnapshot60[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=39850&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=39850&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=39850&r=needtrace[/url]
    Need Reproduce Script: [url]http://bugs.php.net/fix.php?id=39850&r=needscript[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=39850&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=39850&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=39850&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=39850&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=39850&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=39850&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=39850&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=39850&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=39850&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=39850&r=gnused[/url]
    Floating point limitations: [url]http://bugs.php.net/fix.php?id=39850&r=float[/url]
    No Zend Extensions: [url]http://bugs.php.net/fix.php?id=39850&r=nozend[/url]
    MySQL Configuration Error: [url]http://bugs.php.net/fix.php?id=39850&r=mysqlcfg[/url]
    judas dot iscariote at gmail dot com Guest

  2. #2

    Default #39850 [Opn->Asn]: SplFileObject contradictory "failed to open stream: Success"

    ID: 39850
    Updated by: [email]tony2001php.net[/email]
    Reported By: judas dot iscariote at gmail dot com
    -Status: Open
    +Status: Assigned
    -Bug Type: SPL related
    +Bug Type: Filesystem function related
    Operating System: Linux 64bit
    PHP Version: 5CVS-2006-12-16 (CVS)
    -Assigned To:
    +Assigned To: tony2001
    New Comment:

    I got a patch, but I want to hear what Ilia thinks about it first..
    [url]http://tony2001.phpclub.net/dev/tmp/bug39850.diff[/url]


    Previous Comments:
    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=39850&edit=1[/url]
    tony2001@php.net Guest

  3. #3

    Default #39850 [Asn->Csd]: SplFileObject contradictory "failed to open stream: Success"

    ID: 39850
    Updated by: [email]tony2001php.net[/email]
    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
    [url]http://snaps.php.net/[/url].

    Thank you for the report, and for helping us make PHP better.




    Previous Comments:
    ------------------------------------------------------------------------

    [2006-12-18 11:08:13] [email]tony2001php.net[/email]

    I got a patch, but I want to hear what Ilia thinks about it first..
    [url]http://tony2001.phpclub.net/dev/tmp/bug39850.diff[/url]

    ------------------------------------------------------------------------

    [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 [url]http://bugs.php.net/?id=39850&edit=1[/url]
    tony2001@php.net Guest

Similar Threads

  1. How to add "..." button to a property to open up "File Open"?
    By slow learner in forum ASP.NET Building Controls
    Replies: 2
    Last Post: August 26th, 06:29 AM
  2. PHP- Creating a "success" message for a form
    By Bloke in forum Dreamweaver AppDev
    Replies: 1
    Last Post: March 28th, 03:54 PM
  3. animation "open" onPress( animation "close" ) go to Frame "myFrame"
    By CheyenneWay webforumsuser@macromedia.com in forum Adobe Flash, Flex & Director
    Replies: 0
    Last Post: January 4th, 09:12 PM
  4. #25886 [Com]: failed to open stream: Too many open files in Unknown on line 0
    By michel dot jansens at ulb dot ac dot be in forum PHP Development
    Replies: 0
    Last Post: October 17th, 07:14 AM
  5. #25886 [NEW]: failed to open stream: Too many open files in Unknown on line 0
    By padair at pntsi dot ca in forum PHP Development
    Replies: 0
    Last Post: October 16th, 04:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139