FAQ
Edit report at https://pear.php.net/bugs/bug.php?id=19141&edit=1

ID: 19141
Comment by: jsnell@e-normous.com
Reported By: jsnell at e-normous dot com
Summary: PEAR::isError() fails with PHP 5.3.7+
Status: Open
Type: Bug
Package: PEAR
Operating System: debian stable
Package Version: 1.9.4
PHP Version: 5.3.8
Roadmap Versions:
New Comment:

For some reason I'm not allowed to upload a patch, so I did it in github
via a pull request:

https://github.com/pear/pear-core/pull/3


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

[2011-12-17 00:10:20] ftzdomino

Description:
------------
PEAR::isError fails to check the type of $data before calling
is_a() on it. In PHP 5.3.7 and newer, if the first argument of
is_a() is a string, PHP will attempt to load it as a class. In PHP
5.3.6 and lower, it will cause warnings in strict mode.

Test script:
---------------
include("/usr/share/php/PEAR.php");
function __autoload($name) {
include($name);
}

PEAR::isError("a string, not a class");



Expected result:
----------------
PEAR::isError() would simply return false when supplied a string

Actual result:
--------------
Warning: include(a string, not a class): failed to open stream: No
such file or directory in Command line code on line 1

Warning: include(): Failed opening 'a string, not a class' for
inclusion (include_path='.:/usr/share/php:/usr/share/pear') in
Command line code on line 1

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

Search Discussions

  • Daniel Oconnor at Dec 17, 2011 at 11:46 am
    Edit report at https://pear.php.net/bugs/bug.php?id=19141&edit=1

    ID: 19141
    Updated by: daniel.oconnor@gmail.com
    Reported By: jsnell at e-normous dot com
    Summary: PEAR::isError() fails with PHP 5.3.7+
    -Status: Open
    +Status: Closed
    Type: Bug
    Package: PEAR
    Operating System: debian stable
    Package Version: 1.9.4
    PHP Version: 5.3.8
    -Assigned To:
    +Assigned To: doconnor
    Roadmap Versions:
    New Comment:

    -Status: Open
    +Status: Closed
    -Assigned To:
    +Assigned To: doconnor
    This bug has been fixed in SVN.

    If this was a documentation problem, the fix will appear on pear.php.net
    by the end of next Sunday (CET).

    If this was a problem with the pear.php.net website, the change should
    be live shortly.

    Otherwise, the fix will appear in the package's next release.

    Thank you for the report and for helping us make PEAR better.

    Thanks for the patch


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

    [2011-12-17 00:12:59] ftzdomino

    For some reason I'm not allowed to upload a patch, so I did it in github
    via a pull request:

    https://github.com/pear/pear-core/pull/3

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

    [2011-12-17 00:10:20] ftzdomino

    Description:
    ------------
    PEAR::isError fails to check the type of $data before calling
    is_a() on it. In PHP 5.3.7 and newer, if the first argument of
    is_a() is a string, PHP will attempt to load it as a class. In PHP
    5.3.6 and lower, it will cause warnings in strict mode.

    Test script:
    ---------------
    include("/usr/share/php/PEAR.php");
    function __autoload($name) {
    include($name);
    }

    PEAR::isError("a string, not a class");



    Expected result:
    ----------------
    PEAR::isError() would simply return false when supplied a string

    Actual result:
    --------------
    Warning: include(a string, not a class): failed to open stream: No
    such file or directory in Command line code on line 1

    Warning: include(): Failed opening 'a string, not a class' for
    inclusion (include_path='.:/usr/share/php:/usr/share/pear') in
    Command line code on line 1

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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppear-bugs @
categoriesphp
postedDec 16, '11 at 11:12p
activeDec 17, '11 at 11:46a
posts2
users2
websitepear.php.net

2 users in discussion

Daniel Oconnor: 1 post Jsnell: 1 post

People

Translate

site design / logo © 2022 Grokbase